C# Class FarseerPhysics.Common.Decomposition.BayazitDecomposer

Convex decomposition algorithm created by Mark Bayazit (http://mnbayazit.com/) Properties: - Tries to decompose using polygons instead of triangles. - Tends to produce optimal results with low processing time. - Running time is O(nr), n = number of vertices, r = reflex vertices. - Does not support holes. For more information about this algorithm, see http://mnbayazit.com/406/bayazit
显示文件 Open project: prime31/Nez Class Usage Examples

Public Methods

Method Description
ConvexPartition ( Vertices vertices ) : List

Decompose the polygon into several smaller non-concave polygon. If the polygon is already convex, it will return the original polygon, unless it is over Settings.MaxPolygonVertices.

Private Methods

Method Description
At ( int i, Vertices vertices ) : Vector2
CanSee ( int i, int j, Vertices vertices ) : bool
Copy ( int i, int j, Vertices vertices ) : Vertices
Left ( Vector2 a, Vector2 b, Vector2 c ) : bool
LeftOn ( Vector2 a, Vector2 b, Vector2 c ) : bool
Reflex ( int i, Vertices vertices ) : bool
Right ( Vector2 a, Vector2 b, Vector2 c ) : bool
Right ( int i, Vertices vertices ) : bool
RightOn ( Vector2 a, Vector2 b, Vector2 c ) : bool
SquareDist ( Vector2 a, Vector2 b ) : float
TriangulatePolygon ( Vertices vertices ) : List

Method Details

ConvexPartition() public static method

Decompose the polygon into several smaller non-concave polygon. If the polygon is already convex, it will return the original polygon, unless it is over Settings.MaxPolygonVertices.
public static ConvexPartition ( Vertices vertices ) : List
vertices Vertices
return List