vtlib library
Public Member Functions | List of all members
vtGeode Class Reference
Inheritance diagram for vtGeode:
Inheritance graph
[legend]

Public Member Functions

void AddMesh (vtMesh *pMesh, int iMatIdx)
 
void RemoveMesh (vtMesh *pMesh)
 
void RemoveAllMeshes ()
 
void AddTextMesh (vtTextMesh *pMesh, int iMatIdx, bool bOutline=true)
 
uint NumMeshes () const
 
vtMeshGetMesh (int i) const
 
vtTextMeshGetTextMesh (int i) const
 
- Public Member Functions inherited from NodeExtension
void SetEnabled (bool bOn)
 
bool GetEnabled () const
 
void SetCastShadow (bool b)
 Set this node to cast a shadow, if it is under a vtShadow node. Default is false.
 
bool GetCastShadow ()
 Get whether this node casts a shadow.
 
void GetBoundSphere (FSphere &sphere, bool bGlobal=false)
 Get the Bounding Sphere of the node.
 

Detailed Description

A vtGeode is a "Geometry Node "which can contain any number of visible vtMesh objects.

A vtGeode also manages a set of Materials (vtMaterial). Each contained mesh is assigned one of these materials, by index.
This separation (Group/Mesh) provides the useful ability to define a vtMesh once in memory, and have multiple vtGeode nodes which contain it, which permits a large number of visual instances (each with potentially different material and transform) with very little memory cost.

Member Function Documentation

void vtGeode::AddMesh ( vtMesh pMesh,
int  iMatIdx 
)

Add a mesh to this geometry.

Parameters
pMeshThe mesh to add
iMatIdxThe material index for this mesh, which is an index into the material array of the geometry.
void vtGeode::AddTextMesh ( vtTextMesh pMesh,
int  iMatIdx,
bool  bOutline = true 
)

Add a text mesh to this geometry.

Parameters
pMeshThe mesh to add
iMatIdxThe material index for this mesh, which is an index into the material array of the geometry.
bOutlinetrue to put a dark outline around the text for contrast.
vtMesh * vtGeode::GetMesh ( int  i) const

Return a contained vtMesh by index.

vtTextMesh * vtGeode::GetTextMesh ( int  i) const

Return a contained vtTextMesh by index.

uint vtGeode::NumMeshes ( ) const

Return the number of contained meshes.

void vtGeode::RemoveAllMeshes ( )

Remove all meshes from the geomtry. They are refcounted so there is no need to worry about freeing them.

void vtGeode::RemoveMesh ( vtMesh pMesh)

Remove a mesh from the geomtry. Has no effect if the mesh is not currently contained.