public static GetDistancePointToPlane ( System.Vector3 &point, System.Vector3 &normal, System.Vector3 &pointOnPlane ) : float | ||
point | System.Vector3 | Point to project onto plane. |
normal | System.Vector3 | Normal of the plane. |
pointOnPlane | System.Vector3 | Point located on the plane. |
Résultat | float |
public static float GetDistancePointToPlane(ref Vector3 point, ref Vector3 normal, ref Vector3 pointOnPlane)
{
Vector3 offset;
Vector3.Subtract(ref point, ref pointOnPlane, out offset);
float dot;
Vector3.Dot(ref normal, ref offset, out dot);
return dot / normal.LengthSquared();
}