C# Class Nez.Triangulator

simple ear clipping triangulator. the final triangles will be present in the triangleIndices list
Show file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
triangleIndices List

Public Methods

Method Description
initialize ( int count ) : void
testPointTriangle ( Vector2 point, Vector2 a, Vector2 b, Vector2 c ) : bool
triangulate ( Vector2 points, bool arePointsCCW = true ) : void

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

Method Details

initialize() public method

public initialize ( int count ) : void
count int
return void

testPointTriangle() public static method

public static testPointTriangle ( Vector2 point, Vector2 a, Vector2 b, Vector2 c ) : bool
point Vector2
a Vector2
b Vector2
c Vector2
return bool

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

Property Details

triangleIndices public property

The indexes of triangle list entries for the list of points used in the last triangulate call.
public List triangleIndices
return List