Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::SubMesh Class Reference

Defines a part of a complete mesh. More...

#include <OgreSubMesh.h>

List of all members.

Public Types

typedef std::multimap< unsigned
short, VertexBoneAssignment
VertexBoneAssignmentList
 Multimap of verex bone assignments (orders by vertex index). More...

typedef MapIterator< VertexBoneAssignmentListBoneAssignmentIterator

Public Methods

 SubMesh ()
 ~SubMesh ()
void setMaterialName (const String &matName)
 Sets the name of the Material which this SubMesh will use. More...

const StringgetMaterialName (void) const
bool isMatInitialised (void) const
 Returns true if a material has been assigned to the submesh, otherwise returns false. More...

void _getRenderOperation (RenderOperation &rend, ushort lodIndex=0)
 Returns a RenderOperation structure required to render this mesh. More...

void addBoneAssignment (const VertexBoneAssignment &vertBoneAssign)
 Assigns a vertex to a bone with a given weight, for skeletal animation. More...

void clearBoneAssignments (void)
 Removes all bone assignments for this mesh. More...

BoneAssignmentIterator getBoneAssignmentIterator (void)
 Gets an iterator for access all bone assignments. More...


Public Attributes

bool useSharedVertices
 Indicates if this submesh shares vertex data with other meshes or whether it has it's own vertices. More...

bool useTriStrips
 Boolean indicating if the face indexes included are for a continuous triangle strip. More...

GeometryData geometry
 Dedicated geometry data (only valid if useSharedVertices = false). More...

unsigned short numFaces
 Number of faces contained in this submesh. More...

unsigned short * faceVertexIndices
 List of indices into geometry to describe faces. More...

ProgressiveMesh::LODFaceList mLodFaceList
Meshparent
 Reference to parent Mesh. More...


Protected Methods

void compileBoneAssignments (void)
 Must be called once to compile bone assignments into geometry buffer. More...


Protected Attributes

String mMaterialName
 Name of the material this SubMesh uses. More...

bool mMatInitialised
 Is there a material yet? More...

VertexBoneAssignmentList mBoneAssignments
bool mBoneAssignmentsOutOfDate
 Flag indicating that bone assignments need to be recompiled. More...


Friends

class Mesh
class MeshSerializer


Detailed Description

Defines a part of a complete mesh.

Remarks:
Meshes which make up the definition of a discrete 3D object are made up of potentially multiple parts. This is because different parts of the mesh may use different materials or use different vertex formats, such that a rendering state change is required between them.

Like the Mesh class, instatiations of 3D objects in the scene share the SubMesh instances, and have the option of overriding their material differences on a per-object basis if required. See the SubEntity class for more information.


Member Typedef Documentation

typedef MapIterator<VertexBoneAssignmentList> Ogre::SubMesh::BoneAssignmentIterator
 

typedef std::multimap<unsigned short, VertexBoneAssignment> Ogre::SubMesh::VertexBoneAssignmentList
 

Multimap of verex bone assignments (orders by vertex index).


Constructor & Destructor Documentation

Ogre::SubMesh::SubMesh  
 

Ogre::SubMesh::~SubMesh  
 


Member Function Documentation

void Ogre::SubMesh::_getRenderOperation RenderOperation   rend,
ushort    lodIndex = 0
 

Returns a RenderOperation structure required to render this mesh.

Parameters:
rend  Reference to a RenderOperation structure to populate.
lodIndex  The index of the LOD to use.

void Ogre::SubMesh::addBoneAssignment const VertexBoneAssignment   vertBoneAssign
 

Assigns a vertex to a bone with a given weight, for skeletal animation.

Remarks:
This method is only valid after calling setSkeletonName. Since this is a one-off process there exists only 'addBoneAssignment' and 'clearBoneAssignments' methods, no 'editBoneAssignment'. You should not need to modify bone assignments during rendering (only the positions of bones) and OGRE reserves the right to do some internal data reformatting of this information, depending on render system requirements.

This method is for assigning weights to the dedicated geometry of the SubMesh. To assign weights to the shared Mesh geometry, see the equivalent methods on Mesh.

void Ogre::SubMesh::clearBoneAssignments void   
 

Removes all bone assignments for this mesh.

This method is for assigning weights to the dedicated geometry of the SubMesh. To assign weights to the shared Mesh geometry, see the equivalent methods on Mesh.

void Ogre::SubMesh::compileBoneAssignments void    [protected]
 

Must be called once to compile bone assignments into geometry buffer.

SubMesh::BoneAssignmentIterator Ogre::SubMesh::getBoneAssignmentIterator void   
 

Gets an iterator for access all bone assignments.

Remarks:
Only valid if this SubMesh has dedicated geometry.

const String & Ogre::SubMesh::getMaterialName void    const
 

bool Ogre::SubMesh::isMatInitialised void    const
 

Returns true if a material has been assigned to the submesh, otherwise returns false.

void Ogre::SubMesh::setMaterialName const String   matName
 

Sets the name of the Material which this SubMesh will use.


Friends And Related Function Documentation

friend class Mesh [friend]
 

friend class MeshSerializer [friend]
 


Member Data Documentation

unsigned short* Ogre::SubMesh::faceVertexIndices
 

List of indices into geometry to describe faces.

GeometryData Ogre::SubMesh::geometry
 

Dedicated geometry data (only valid if useSharedVertices = false).

Remarks:
This data is completely owned by this submesh. When a submesh uses a very small subset of the shared geometry it is (processor) inefficient since the whole buffer is sent during the submesh rendering operation. Therefore in this case the SubMesh would use it's own vertex data. For other cases it is more memory efficient to use a shared buffer since vertices are not duplicated, or if hardware vertex buffers are available it can be better to use one set of data.

The use of shared or non-shared buffers is determined when model data is converted to the OGRE .mesh format.

VertexBoneAssignmentList Ogre::SubMesh::mBoneAssignments [protected]
 

bool Ogre::SubMesh::mBoneAssignmentsOutOfDate [protected]
 

Flag indicating that bone assignments need to be recompiled.

ProgressiveMesh::LODFaceList Ogre::SubMesh::mLodFaceList
 

String Ogre::SubMesh::mMaterialName [protected]
 

Name of the material this SubMesh uses.

bool Ogre::SubMesh::mMatInitialised [protected]
 

Is there a material yet?

unsigned short Ogre::SubMesh::numFaces
 

Number of faces contained in this submesh.

Mesh* Ogre::SubMesh::parent
 

Reference to parent Mesh.

bool Ogre::SubMesh::useSharedVertices
 

Indicates if this submesh shares vertex data with other meshes or whether it has it's own vertices.

bool Ogre::SubMesh::useTriStrips
 

Boolean indicating if the face indexes included are for a continuous triangle strip.

Copyright © 2002 by The OGRE Team