コード例 #1
0
 /// <summary>
 /// Returns a vector which is on the same plane as the polygon, and perpendiculat to the nth edge
 /// </summary>
 /// <param name="poly"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public static Vector3 GetSurfaceNormal(this IPoly poly, int index)
 {
     if (poly is IPolyExtensionSurfaceNormal)
     {
         return(((IPolyExtensionSurfaceNormal)poly).AdvGetSurfaceNormal(index));
     }
     else if (poly is IPolyForwarder)
     {
         return(((IPolyForwarder)poly).GetPoly().GetSurfaceNormal(index));
     }
     else
     {
         return(poly.CalcSurfaceNormal(index));
     }
 }