triangulate() public method

Computes a triangle list that fully covers the area enclosed by the given set of points. If points are not CCW, pass false for the arePointsCCW parameter
public triangulate ( Vector2 points, bool arePointsCCW = true ) : void
points Vector2 A list of points that defines an enclosing path.
arePointsCCW bool
return void
コード例 #1
0
ファイル: PolygonMesh.cs プロジェクト: prime31/Nez
		public PolygonMesh( Vector2[] points, bool arePointsCCW = true )
		{
			var triangulator = new Triangulator();
			triangulator.triangulate( points, arePointsCCW );

			setVertPositions( points );
			setTriangles( triangulator.triangleIndices.ToArray() );
			recalculateBounds( true );
		}
コード例 #2
0
ファイル: PolygonMesh.cs プロジェクト: Hobbs2000/CSharpGame
        public PolygonMesh(Vector2[] points)
        {
            var triangulator = new Triangulator();

            triangulator.triangulate(points);

            setVertPositions(points);
            setTriangles(triangulator.triangleIndices.ToArray());
            recalculateBounds(true);
        }
コード例 #3
0
        public PolygonMesh(Vector2[] points, bool arePointsCCW = true)
        {
            var triangulator = new Triangulator();

            triangulator.triangulate(points, arePointsCCW);

            SetVertPositions(points);
            SetTriangles(triangulator.triangleIndices.ToArray());
            RecalculateBounds(true);
        }