simple ear clipping triangulator. the final triangles will be present in the triangleIndices list
Exemple #1
0
		public PolygonMesh( Vector2[] points, bool arePointsCCW = true )
		{
			var triangulator = new Triangulator();
			triangulator.triangulate( points, arePointsCCW );

			setVertPositions( points );
			setTriangles( triangulator.triangleIndices.ToArray() );
			recalculateBounds( true );
		}