C# Class UnityPlatformer.Triangulator

http://wiki.unity3d.com/index.php?title=Triangulator This script can be used to split a 2D polygon into triangles. The algorithm supports concave polygons, but not polygons with holes, or multiple polygons at once. Note: This is a naive triangulation implementation. For more well-distributed triangles, consider using Delaunay triangulation, such as with the script here [1]
Exibir arquivo Open project: llafuente/unity-platformer Class Usage Examples

Public Methods

Method Description
Triangulate ( ) : int[]

Triangulate logic

Triangulator ( Vector2 points ) : UnityEngine

Constructor

Private Methods

Method Description
Area ( ) : float
InsideTriangle ( Vector2 A, Vector2 B, Vector2 C, Vector2 P ) : bool
Snip ( int u, int v, int w, int n, int V ) : bool

Method Details

Triangulate() public method

Triangulate logic
public Triangulate ( ) : int[]
return int[]

Triangulator() public method

Constructor
public Triangulator ( Vector2 points ) : UnityEngine
points UnityEngine.Vector2 Points to triangulate
return UnityEngine