Example #1
0
 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;
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 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;
 }