[This is preliminary documentation and is subject to change.]

The sub-mesh data. [(baseVertIndex, vertCount, baseTriIndex, triCount) * meshCount] [Size: >= 4 * meshCount]

Namespace: org.critterai.nmgen
Assembly: cai-nmgen (in cai-nmgen.dll) Version: 0.4.0.0 (0.4.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public uint[] meshes
Public meshes As UInteger()
public:
array<unsigned int>^ meshes

Remarks

Maximum number of vertices per sub-mesh: 127
Maximum number of triangles per sub-mesh: 255

Examples

An example of iterating the triangles in a sub-mesh.

CopyC#
 // Where iMesh is the index for the sub-mesh within detailMesh
 int pMesh = iMesh * 4;
 int pVertBase = meshes[pMesh + 0] * 3;
 int pTriBase = meshes[pMesh + 2] * 4;
 int tCount = meshes[pMesh + 3];
 int vertX, vertY, vertZ;

 for (int iTri = 0; iTri < tCount; iTri++)
 {
    for (int iVert = 0; iVert < 3; iVert++)
    {
        int pVert = pVertBase
            + (tris[pTriBase + (iTri * 4 + iVert)] * 3);
        vertX = verts[pVert + 0];
        vertY = verts[pVert + 1];
        vertZ = verts[pVert + 2];
        // Do something with the vertex.
    }
}

See Also