Beispiel #1
0
        public bool DistanceQuery(NativeBVHTree.DistanceQueryInput query)
        {
            fixed(Collider *target = &this)
            {
                switch (type)
                {
                case Type.Box:
                    return(((BoxCollider *)target->data)->DistanceQuery(query));

                case Type.Sphere:
                    return(((SphereCollider *)target->data)->DistanceQuery(query));

#if ENABLE_UNITY_COLLECTIONS_CHECKS
                default:
                    throw new ArgumentOutOfRangeException();
#endif
                }
            }
        }
Beispiel #2
0
 public bool DistanceQuery(NativeBVHTree.DistanceQueryInput query)
 {
     return(math.distance(query.origin, center) - radius < query.maxDistance);
 }
Beispiel #3
0
 public bool DistanceQuery(NativeBVHTree.DistanceQueryInput query)
 {
     return(IntersectionUtils.IsInRange(LowerBound, UpperBound, query.origin, query.maxDistance));
 }