示例#1
0
 public unsafe bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     fixed(PhysicsCompoundCollider *target = &this)
     {
         return(DistanceQueries.ColliderDistance(input, (Collider *)target, ref collector));
     }
 }
示例#2
0
        public static bool CalculateDistance <T>(ref T target, ColliderDistanceInput input, out DistanceHit result) where T : struct, IQueryable
        {
            var collector = new ClosestHitCollector <DistanceHit>(input.MaxDistance);

            if (target.CalculateDistance(input, ref collector))
            {
                result = collector.ClosestHit;
                return(true);
            }

            result = new DistanceHit();
            return(false);
        }
示例#3
0
 public bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     return(CollisionWorld.CalculateDistance(input, ref collector));
 }
示例#4
0
 public bool CalculateDistance(ColliderDistanceInput input, ref NativeList <DistanceHit> allHits) => QueryWrappers.CalculateDistance(ref this, input, ref allHits);
示例#5
0
 public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit) => QueryWrappers.CalculateDistance(ref this, input, out closestHit);
示例#6
0
 // Collider distance
 public bool CalculateDistance(ColliderDistanceInput input) => QueryWrappers.CalculateDistance(ref this, input);
示例#7
0
        public static bool CalculateDistance <T>(ref T target, ColliderDistanceInput input, ref NativeList <DistanceHit> allHits) where T : struct, IQueryable
        {
            var collector = new AllHitsCollector <DistanceHit>(input.MaxDistance, ref allHits);

            return(target.CalculateDistance(input, ref collector));
        }
示例#8
0
        public static bool CalculateDistance <T>(ref T target, ColliderDistanceInput input) where T : struct, IQueryable
        {
            var collector = new AnyHitCollector <DistanceHit>(input.MaxDistance);

            return(target.CalculateDistance(input, ref collector));
        }
示例#9
0
 public bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     return(Broadphase.CalculateDistance(input, m_PhysicsBodies, ref collector));
 }
示例#10
0
 public bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     return(Collider.IsCreated && Collider.Value.CalculateDistance(input, ref collector));
 }