public static float FindCollision(Vector3 fromPos, Vector3 direction, Vector3 pointOnPlane, Vector3 normalPlane) { float dist = Mathf.Infinity; float divideBy = direction.InProduct(normalPlane); if(divideBy != 0f) dist = (pointOnPlane - fromPos).InProduct(normalPlane) / direction.InProduct(normalPlane); return dist; }
public static float DistanceToPlane(Vector3 fromPos, Vector3 direction, Vector3 pointOnPlane, Vector3 normalPlane) { float dist = Mathf.Infinity; float divideBy = direction.InProduct(normalPlane); if (divideBy != 0f) { dist = (pointOnPlane - fromPos).InProduct(normalPlane) / direction.InProduct(normalPlane); } return(dist); }
public static float DistanceToPlane(Vector3 fromPos, Vector3 direction, Vector3 pointOnPlane, Vector3 normalPlane) { float result = float.PositiveInfinity; float num = direction.InProduct(normalPlane); if (num != 0f) { result = (pointOnPlane - fromPos).InProduct(normalPlane) / direction.InProduct(normalPlane); } return(result); }
public static float DistanceToPlane(Vector3 fromPos, Vector3 direction, Vector3 pointOnPlane, Vector3 normalPlane) { float result = float.PositiveInfinity; float num = direction.InProduct(normalPlane); if (num != 0f) { result = (pointOnPlane - fromPos).InProduct(normalPlane) / direction.InProduct(normalPlane); } return result; }