Exemplo n.º 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
                }
            }
        }
Exemplo n.º 2
0
 public bool DistanceQuery(NativeBVHTree.DistanceQueryInput query)
 {
     return(math.distance(query.origin, center) - radius < query.maxDistance);
 }
Exemplo n.º 3
0
 public bool DistanceQuery(NativeBVHTree.DistanceQueryInput query)
 {
     return(IntersectionUtils.IsInRange(LowerBound, UpperBound, query.origin, query.maxDistance));
 }