Triangulator
Description
The Triangulator class performs triangulation of terrain meshes.
- See also
Public / Methods
Begin
Begins a new triangulation cycle.
Triangulation outputs chunks up to 128 indices each and will stop if the given output buffer has not enough space left for another whole chunk.
Decode
Decodes the given triangulation buffer into a triangle list.
For rendering, the decoding of the triangulation buffer content is usually done on the GPU, in a dedicated shader program. This method is intended for exporting the triangulation buffer content to a 3D model, but is it also useful for verification and testing.
FanLeaf
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).
Mark
Returns the number of vertex indices that have been emitted so far.
The returned index count can be used to render arbitrary parts of the triangulation.