Пример #1
0
 /// <summary>
 /// Calculates the surface normal normal of the polygon using the cross product
 /// </summary>
 /// <param name="poly"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public static Vector3 CalcSurfaceNormal(this IPoly poly, int index)
 {
     return(-Vector3.Cross(poly.GetNormal(), poly.GetPoint((index + 1) % poly.Resolution) - poly.GetPoint(index)));
 }
Пример #2
0
 public static bool PointInPoly(this IPoly poly, Vector3 point)
 {
     return(poly.PointInPoly(point, poly.GetNormal()));
 }