ANSYS::Nexus::GLTFWriter::Utils Namespace Reference
Last update: 17.04.2023Set of functions and classes that perform often required tasks. More...
Classes | |
class | Repack |
Manages repacking of indices from unsigned int type to unsigned short type. This only works for POINTS, LINES, or TRIANGLES. More... | |
Functions | |
void | ComputeElementNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned short *indices, float *normals) |
void | ComputeElementNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned int *indices, float *normals) |
void | ComputeVertexNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned short *indices, float *normals) |
void | ComputeVertexNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned int *indices, float *normals) |
Detailed Description
Set of functions and classes that perform often required tasks.
Function Documentation
◆ ComputeElementNormals3() [1/2]
void ANSYS::Nexus::GLTFWriter::Utils::ComputeElementNormals3 | ( | const unsigned int | numVertices, |
const float * | vertices, | ||
const unsigned int | numElements, | ||
const unsigned int | elementSize, | ||
const unsigned int * | indices, | ||
float * | normals | ||
) |
Computes XYZ element normals from vertices and elements. unsigned int and unsigned short indices are supported.
- Parameters
-
[in] numVertices Number of vertices. [in] vertices XYZ vertex data. [in] numElements Number of elements. [in] elementSize Number of vertices in element. [in] indices Vertex indices of element. [in] normals Memory into which element normals are inserted. This is preallocated to a size of 3 * numVertices floats.
◆ ComputeElementNormals3() [2/2]
void ANSYS::Nexus::GLTFWriter::Utils::ComputeElementNormals3 | ( | const unsigned int | numVertices, |
const float * | vertices, | ||
const unsigned int | numElements, | ||
const unsigned int | elementSize, | ||
const unsigned short * | indices, | ||
float * | normals | ||
) |
Computes XYZ element normals from vertices and elements. unsigned int and unsigned short indices are supported.
- Parameters
-
[in] numVertices Number of vertices. [in] vertices XYZ vertex data. [in] numElements Number of elements. [in] elementSize Number of vertices in element. [in] indices Vertex indices of element. [in] normals Memory into which element normals are inserted. This is preallocated to a size of 3 * numVertices floats.
◆ ComputeVertexNormals3() [1/2]
void ANSYS::Nexus::GLTFWriter::Utils::ComputeVertexNormals3 | ( | const unsigned int | numVertices, |
const float * | vertices, | ||
const unsigned int | numElements, | ||
const unsigned int | elementSize, | ||
const unsigned int * | indices, | ||
float * | normals | ||
) |
Computes XYZ vertex normals from vertices and elements. The element normals for all elements adjacent to a vertex are combined to get the vertex normal. unsigned int and unsigned short indices are supported.
- Parameters
-
[in] numVertices Number of vertices. [in] vertices XYZ vertex data. [in] numElements Number of elements. [in] elementSize Number of vertices in element. [in] indices Vertex indices of element. [in] normals Memory into which vertex normals are inserted. This is preallocated to a size of 3 * numElements floats.
◆ ComputeVertexNormals3() [2/2]
void ANSYS::Nexus::GLTFWriter::Utils::ComputeVertexNormals3 | ( | const unsigned int | numVertices, |
const float * | vertices, | ||
const unsigned int | numElements, | ||
const unsigned int | elementSize, | ||
const unsigned short * | indices, | ||
float * | normals | ||
) |
Computes XYZ vertex normals from vertices and elements. The element normals for all elements adjacent to a vertex are combined to get the vertex normal. unsigned int and unsigned short indices are supported.
- Parameters
-
[in] numVertices Number of vertices. [in] vertices XYZ vertex data. [in] numElements Number of elements. [in] elementSize Number of vertices in element. [in] indices Vertex indices of element. [in] normals Memory into which vertex normals are inserted. This is preallocated to a size of 3 * numElements floats.
- Examples
- Test002.cpp, Test005.cpp, and Test010.cpp.