Class BayazitDecomposer
- Assembly
- Alis.dll
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
internal static class BayazitDecomposer
Inheritance
Inherited Members
Methods
At(int, Vertices)
Ats the i
private static Vector2 At(int i, Vertices vertices)
Parameters
Returns
- Vector2
-
The vector
CanSee(int, int, Vertices)
Describes whether can see
private static bool CanSee(int i, int j, Vertices vertices)
Parameters
Returns
- bool
-
The bool
ConvexPartition(Vertices)
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 List<Vertices> ConvexPartition(Vertices vertices)
Parameters
vertices
Vertices
Returns
Copy(int, int, Vertices)
Copies the i
private static Vertices Copy(int i, int j, Vertices vertices)
Parameters
Returns
- Vertices
-
The
Left(Vector2, Vector2, Vector2)
Describes whether left
private static bool Left(Vector2 a, Vector2 b, Vector2 c)
Parameters
Returns
- bool
-
The bool
LeftOn(Vector2, Vector2, Vector2)
Describes whether left on
private static bool LeftOn(Vector2 a, Vector2 b, Vector2 c)
Parameters
Returns
- bool
-
The bool
Reflex(int, Vertices)
Describes whether reflex
private static bool Reflex(int i, Vertices vertices)
Parameters
Returns
- bool
-
The bool
Right(int, Vertices)
Describes whether right
private static bool Right(int i, Vertices vertices)
Parameters
Returns
- bool
-
The bool
Right(Vector2, Vector2, Vector2)
Describes whether right
private static bool Right(Vector2 a, Vector2 b, Vector2 c)
Parameters
Returns
- bool
-
The bool
RightOn(Vector2, Vector2, Vector2)
Describes whether right on
private static bool RightOn(Vector2 a, Vector2 b, Vector2 c)
Parameters
Returns
- bool
-
The bool
SquareDist(Vector2, Vector2)
Squares the dist using the specified a
private static float SquareDist(Vector2 a, Vector2 b)
Parameters
Returns
- float
-
The float
TriangulatePolygon(Vertices)
Triangulates the polygon using the specified vertices
private static List<Vertices> TriangulatePolygon(Vertices vertices)
Parameters
vertices
Vertices-
The vertices