Utility functions for prtx::Mesh.
◆ createTriangulatedMesh()
Creates a triangulated version of the passed Mesh.
- Parameters
-
mesh | The mesh to trriangulate. |
triangle2FaceMap | Optional pointer to index vector to return the mapping of the new triangles (faces) to the old faces. |
◆ transformCoords()
Transforms a number of vertices (i.e. (x, y, z) coordinate triples) with a transformation matrix.
- Parameters
-
[in,out] | coords | Vertices to transform. Size must be multiple of 3 (3 * number of vertices). |
| matrix | Matrix to transform vertices with. 4x4 harmonic transformation matrix, column major (OpenGL). |
◆ transformNormals()
Transforms a number of normals (i.e. (x, y, z) coordinate triples) with a transformation matrix. The normals are transformed with the inverse transpose of the matrix and then normalized. #param[in, out] normals Normals to transform. Size must be multiple of 3 (3 * number of normals). Normals must be normalized. #param matrix Matrix to transform the normals with. 4x4 harmonic transformation matrix, column major (OpenGL). Must be invertible.