The Triangulator class performs triangulation of terrain meshes.
sealed class
|
Triangulator
|
See also:
IMesh.TriangulatorBegins a new triangulation cycle.
public
method
|
Begin
(TriangulationBuffer triangulationBuffer)
|
||
params
|
triangulationBuffer
|
[not-null]
|
The output triangulation buffer to use. |
See also:
SectorEnds the current triangulation cycle.
public
method
|
End
()
|
See also:
BeginGenerates a triangle fan that covers the given mesh sector.
public
method
|
Fan
(int32 sector,
[]
int32[] triangleFanIndices)
|
||
type
|
int32
|
||
params
|
sector
|
The mesh sector. | |
triangleFanIndices
|
[not-null]
|
Output array for generated vertex indices. | |
returns
|
|
The number of vertex indices that have been written to triangleFanIndices |
Remarks:
Triangle fans can be generated at any time. It is not necessary to call Begin first.
Generates a triangle fan for a quadrant of the given mesh sector, assuming that it is a leaf (i.e. it has no child sectors).
public
method
|
FanLeaf
(int32 sector,
int32 childIdx)
|
||
type
|
Vec4I
|
||
params
|
sector
|
The mesh sector. | |
childIdx
|
Child index of the non-existent sector in sector which area shall be triangulated. | ||
returns
|
The
vertex
indices
of
the
triangle
fan,
to
be
processed
in
this
order:
X,
Y,
Z,
W.
The resulting counter-clockwise triangles are thus defined as: <X, Y, Z > <X, Z, W > The second triangle can be degenerated, in which case W will be equal to X. The missing area will then be covered by the triangle fan of an adjacent quadrant. |
Remarks:
Triangle fans can be generated at any time. It is not necessary to call Begin first.
Marks the current end of the triangulation and returns an offset that can be used to render all subsequent triangles.
public
method
|
Mark
()
|
||
type
|
int32
|
||
returns
|
|
The number of generated vertex indices so far. |
See also:
BeginGenerates triangles that cover the given mesh sector.
public
method
|
Sector
(int32 sector)
|
||
params
|
sector
|
The mesh sector. |
See also:
BeginGenerates triangles that cover a quadrant of the given mesh sector, assuming that it is a leaf (i.e. it has no child sectors).
public
method
|
SectorLeaf
(int32 sector,
int32 childIdx)
|
||
params
|
sector
|
Index of center vertex of sector to visit. | |
childIdx
|
Child index of the non-existent sector in sector which area shall be triangulated. |
See also:
Begin