C# Class FarseerPhysics.Common.Decomposition.FlipcodeDecomposer

Triangulates a polygon into triangles. Doesn't handle holes.
Show file Open project: prime31/Nez Class Usage Examples

Public Methods

Method Description
ConvexPartition ( Vertices vertices ) : List

Decompose the polygon into triangles. Properties: - Only works on counter clockwise polygons

Private Methods

Method Description
InsideTriangle ( Vector2 &a, Vector2 &b, Vector2 &c, Vector2 &p ) : bool

Check if the point P is inside the triangle defined by the points A, B, C

Snip ( Vertices contour, int u, int v, int w, int n, int V ) : bool

Cut a the contour and add a triangle into V to describe the location of the cut

Method Details

ConvexPartition() public static method

Decompose the polygon into triangles. Properties: - Only works on counter clockwise polygons
public static ConvexPartition ( Vertices vertices ) : List
vertices Vertices The list of points describing the polygon
return List