#DOTS equivalent of Collider.ClosestPoint

1 messages · Page 1 of 1 (latest)

stiff forge
#

Does anyone know how to achieve the effect of Collider.ClosestPoint in DOTS (com.unity.physics)?

gloomy escarp
#

I'm not 100% certain its identical, but you can

#
        /// <summary>   Calculates the distance. </summary>
        ///
        /// <param name="input">        The input. </param>
        /// <param name="closestHit">   [out] The closest hit. </param>
        ///
        /// <returns>   True if there is a hit, false otherwise. </returns>
        public bool CalculateDistance(PointDistanceInput input, out DistanceHit closestHit);```
as it seems to return the closest hit
i'm just not 100% certain it won't return the closest hit along a line between the point and to the center instead of a potentially closer face