Public Member Functions

 Triangulator (Vector3[] vertices)
 
 Triangulator (Vector3[] vertices, int start, int vertexCount)
 
 Triangulator (Vector3[] vertices, int start, int vertexCount, bool useZ)
 
int[] Triangulate (List< int > contours)
 Note that you must have set Vertices first. Triangulates each declared contour individually. More...
 
int[] Triangulate (List< int > contours, bool testWinding)
 Note that you must have set Vertices first. Triangulates each declared contour individually. More...
 
void Reset ()
 Resets the triangulator. More...
 
void AddVertex (Vector3 vert, ref TriangulationVertex first, ref TriangulationVertex last)
 Adds a vertex to the current set of open vertices. More...
 
void Complete (TriangulationVertex first, TriangulationVertex last)
 Completes an externally built triangulation set. More...
 
void Select (int start, int vertexCount)
 
void FindWinding ()
 Call this to find the winding order of the polygon. More...
 
float GetArea ()
 Gets the area of the polygon to triangulate. More...
 
void AddTriangle (int a, int b, int c)
 
int[] Triangulate ()
 
void Triangulate (int[] triangles, int triangleCount, int offset)
 

Public Attributes

bool OutputClockwise
 
int[] Triangles
 
Vector3[] Vertices
 
int TriangleIndex
 
int VertexCount
 
int VertexOffset
 
TriangulationVertex Current
 
bool UseZ
 
OnTriangulatorRange OutOfRange
 Delegate used when the triangulator wants to add an out of range triangle. More...
 

Properties

bool Clockwise [get, set]
 Set this true if the verts wind clockwise. More...
 

Private Member Functions

float GetSignedArea ()
 Gets the area of the polygon to triangulate. Note: may be negative. More...
 
bool InsideTriangleAnti (TriangulationVertex A, TriangulationVertex B, TriangulationVertex C, TriangulationVertex P)
 
bool InsideTriangle (TriangulationVertex A, TriangulationVertex B, TriangulationVertex C, TriangulationVertex P)
 

Private Attributes

bool RawClockwise
 True if the verts go around clockwise. In most cases this depends on which direction the polygon was drawn in. More...
 

Constructor & Destructor Documentation

Blaze.Triangulator.Triangulator ( Vector3[]  vertices)
inline
Blaze.Triangulator.Triangulator ( Vector3[]  vertices,
int  start,
int  vertexCount 
)
inline
Blaze.Triangulator.Triangulator ( Vector3[]  vertices,
int  start,
int  vertexCount,
bool  useZ 
)
inline

Member Function Documentation

void Blaze.Triangulator.AddTriangle ( int  a,
int  b,
int  c 
)
inline
void Blaze.Triangulator.AddVertex ( Vector3  vert,
ref TriangulationVertex  first,
ref TriangulationVertex  last 
)
inline

Adds a vertex to the current set of open vertices.

void Blaze.Triangulator.Complete ( TriangulationVertex  first,
TriangulationVertex  last 
)
inline

Completes an externally built triangulation set.

void Blaze.Triangulator.FindWinding ( )
inline

Call this to find the winding order of the polygon.

float Blaze.Triangulator.GetArea ( )
inline

Gets the area of the polygon to triangulate.

float Blaze.Triangulator.GetSignedArea ( )
inlineprivate

Gets the area of the polygon to triangulate. Note: may be negative.

bool Blaze.Triangulator.InsideTriangle ( TriangulationVertex  A,
TriangulationVertex  B,
TriangulationVertex  C,
TriangulationVertex  P 
)
inlineprivate
bool Blaze.Triangulator.InsideTriangleAnti ( TriangulationVertex  A,
TriangulationVertex  B,
TriangulationVertex  C,
TriangulationVertex  P 
)
inlineprivate
void Blaze.Triangulator.Reset ( )
inline

Resets the triangulator.

void Blaze.Triangulator.Select ( int  start,
int  vertexCount 
)
inline
int [] Blaze.Triangulator.Triangulate ( List< int >  contours)
inline

Note that you must have set Vertices first. Triangulates each declared contour individually.

int [] Blaze.Triangulator.Triangulate ( List< int >  contours,
bool  testWinding 
)
inline

Note that you must have set Vertices first. Triangulates each declared contour individually.

Parameters
testWindingOptionally tests the winding direction of the first contour. Assumes all contours wind the same way.
int [] Blaze.Triangulator.Triangulate ( )
inline
void Blaze.Triangulator.Triangulate ( int[]  triangles,
int  triangleCount,
int  offset 
)
inline

Member Data Documentation

TriangulationVertex Blaze.Triangulator.Current
OnTriangulatorRange Blaze.Triangulator.OutOfRange

Delegate used when the triangulator wants to add an out of range triangle.

bool Blaze.Triangulator.OutputClockwise
bool Blaze.Triangulator.RawClockwise
private

True if the verts go around clockwise. In most cases this depends on which direction the polygon was drawn in.

int Blaze.Triangulator.TriangleIndex
int [] Blaze.Triangulator.Triangles
bool Blaze.Triangulator.UseZ
int Blaze.Triangulator.VertexCount
int Blaze.Triangulator.VertexOffset
Vector3 [] Blaze.Triangulator.Vertices

Property Documentation

bool Blaze.Triangulator.Clockwise
getset

Set this true if the verts wind clockwise.