public static bool CalculateDistance <T>(ref T target, ColliderDistanceInput input, out DistanceHit result) where T : struct, ICollidable { var collector = new ClosestHitCollector <DistanceHit>(input.MaxDistance); if (target.CalculateDistance(input, ref collector)) { result = collector.ClosestHit; // TODO: would be nice to avoid this copy return(true); } result = new DistanceHit(); return(false); }
public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit) => QueryWrappers.CalculateDistance(ref this, input, out closestHit);