Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     return(CollisionWorld.CalculateDistance(input, ref collector));
 }
Ejemplo n.º 4
0
 public bool CalculateDistance(ColliderDistanceInput input, ref NativeList <DistanceHit> allHits) => QueryWrappers.CalculateDistance(ref this, input, ref allHits);
Ejemplo n.º 5
0
 public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit) => QueryWrappers.CalculateDistance(ref this, input, out closestHit);
Ejemplo n.º 6
0
 // Collider distance
 public bool CalculateDistance(ColliderDistanceInput input) => QueryWrappers.CalculateDistance(ref this, input);
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 9
0
 public bool CalculateDistance <T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector <DistanceHit>
 {
     return(Broadphase.CalculateDistance(input, m_PhysicsBodies, ref collector));
 }
Ejemplo n.º 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));
 }