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

Represents a triangle mesh with area data, spatially divided into nodes for more efficient querying.

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 sealed class ChunkyTriMesh
Public NotInheritable Class ChunkyTriMesh
public ref class ChunkyTriMesh sealed

Members

         
 All Members  Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
Dispose()()()()
Frees all resources and marks object as disposed.
ExtractMesh(array<Byte>[]()[][]%)
Extracts all triangles from the mesh. (Not efficient.)
Finalize()()()()
Destructor.
(Overrides Object..::..Finalize()()()().)
GetChunks(Single, Single, Single, Single, List<(Of <<'(ChunkyTriMeshNode>)>>))
Gets all nodes overlapped by the specified bounds.
IsDisposed
True if the object has been disposed and should no longer be used.
NodeCount
The number of spacial nodes in the mesh.
TriCount
The number of triangles in the mesh.

Remarks

Objects of this type are created using the ChunkyTriMeshBuilder class.

Storage is optimized for use by the NMGen build process across muliple threads. It is not efficient for other uses.

The content of a node can be inspected as follows:

CopyC#
// Where lmesh is a TriangleMesh object and lareas is a byte array obtained
// from ChunkyTriMesh.ExtractMesh.
for (int j = 0; j < node.count; j++, i++)
{
    int pTri = (node.i + j) * 3;

    int iVertA = lmesh.tris[pTri + 0];
    int iVertB = lmesh.tris[pTri + 1];
    int iVertC = lmesh.tris[pTri + 2];

    byte triArea = lareas[node.i + j];

    Vector3 vertA = new Vector3(lmesh.verts[iVertA]
        , lmesh.verts[iVertA]
        , lmesh.verts[iVertA]);

    // Repeat for vertB and vertC...

    // Use the vertices...
}

Behavior is undefined if used after disposal.

Inheritance Hierarchy

System..::..Object
  org.critterai.nmgen..::..ChunkyTriMesh

See Also