Exemplo n.º 1
0
 public static bool IsRayInsectTriangle2(Vector2 rayOrigin, Vector2 rayDirection, Vector2 p1, Vector2 p2, Vector2 p3, ref GeoInsectPointArrayInfo insect)
 {
     if (GeoLineUtils.IsLineInsectTriangle2(rayOrigin, rayOrigin + rayDirection, p1, p2, p3, ref insect))
     {
         List <Vector3> tmp  = insect.mHitGlobalPoint.mPointArray;
         List <Vector3> tmp1 = new List <Vector3>();
         for (int i = 0; i < tmp.Count; ++i)
         {
             Vector2 v = new Vector2(tmp[i].x, tmp[i].y);
             if (IsPointInRay2(rayOrigin, rayDirection, ref v))
             {
                 tmp1.Add(tmp[i]);
             }
         }
         if (tmp1.Count > 0)
         {
             insect.mHitGlobalPoint.mPointArray = tmp1;
         }
     }
     return(insect.mIsIntersect);
 }
 public static bool IsTriangleInsectLine2(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 line1, Vector2 line2, ref GeoInsectPointArrayInfo insect)
 {
     return(GeoLineUtils.IsLineInsectTriangle2(line1, line2, p1, p2, p3, ref insect));
 }