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>

Collaboration diagram for Ogre::SubMesh:

Collaboration graph
[legend]
List of all members.

Public Types

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

typedef MapIterator< VertexBoneAssignmentListBoneAssignmentIterator

Public Methods

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

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

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

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

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

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

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


Public Attributes

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

RenderOperation::OperationType operationType
 The render operation type used to render this submesh.

VertexDatavertexData
 Dedicated vertex data (only valid if useSharedVertices = false).

IndexDataindexData
 Face index data.

ProgressiveMesh::LODFaceList mLodFaceList
Meshparent
 Reference to parent Mesh.


Protected Methods

void removeLodLevels (void)
 Internal method for removing LOD data.


Protected Attributes

String mMaterialName
 Name of the material this SubMesh uses.

bool mMatInitialised
 Is there a material yet?

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


Friends

class Mesh
class MeshSerializerImpl
class MeshSerializerImpl_v1

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.

Definition at line 51 of file OgreSubMesh.h.


Member Typedef Documentation

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

Definition at line 123 of file OgreSubMesh.h.

Referenced by getBoneAssignmentIterator().

typedef std::multimap<size_t, VertexBoneAssignment> Ogre::SubMesh::VertexBoneAssignmentList
 

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

Definition at line 122 of file OgreSubMesh.h.


Constructor & Destructor Documentation

Ogre::SubMesh::SubMesh  
 

Definition at line 34 of file OgreSubMesh.cpp.

References indexData, mBoneAssignmentsOutOfDate, mMatInitialised, operationType, useSharedVertices, and vertexData.

Ogre::SubMesh::~SubMesh  
 

Definition at line 45 of file OgreSubMesh.cpp.

References indexData, removeLodLevels(), and vertexData.


Member Function Documentation

void Ogre::SubMesh::_compileBoneAssignments void   
 

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

Definition at line 112 of file OgreSubMesh.cpp.

References Ogre::Mesh::_rationaliseBoneAssignments(), Ogre::Mesh::compileBoneAssignmentsHardware(), Ogre::Mesh::compileBoneAssignmentsSoftware(), mBoneAssignments, mBoneAssignmentsOutOfDate, Ogre::Mesh::mUseSoftwareBlending, parent, Ogre::VertexData::vertexCount, and vertexData.

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.

Definition at line 74 of file OgreSubMesh.cpp.

References indexData, Ogre::RenderOperation::indexData, mLodFaceList, operationType, Ogre::RenderOperation::operationType, parent, Ogre::Mesh::sharedVertexData, Ogre::RenderOperation::useIndexes, useSharedVertices, Ogre::ushort, vertexData, and Ogre::RenderOperation::vertexData.

Referenced by Ogre::SubEntity::getRenderOperation(), and Ogre::Node::getRenderOperation().

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.

Definition at line 93 of file OgreSubMesh.cpp.

References Except, mBoneAssignments, mBoneAssignmentsOutOfDate, and Ogre::VertexBoneAssignment_s::vertexIndex.

Referenced by Ogre::MeshSerializerImpl_v1::readSubMeshBoneAssignment(), and Ogre::MeshSerializerImpl::readSubMeshBoneAssignment().

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.

Definition at line 105 of file OgreSubMesh.cpp.

References mBoneAssignments, and mBoneAssignmentsOutOfDate.

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

Gets an iterator for access all bone assignments.

Remarks:
Only valid if this SubMesh has dedicated geometry.

Definition at line 135 of file OgreSubMesh.cpp.

References BoneAssignmentIterator, and mBoneAssignments.

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

Definition at line 63 of file OgreSubMesh.cpp.

References mMaterialName.

Referenced by Ogre::Entity::buildSubEntityList(), Ogre::MeshSerializerImpl::calcSubMeshSize(), and Ogre::MeshSerializerImpl::writeSubMesh().

bool Ogre::SubMesh::isMatInitialised void    const
 

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

Definition at line 68 of file OgreSubMesh.cpp.

References mMatInitialised.

Referenced by Ogre::Entity::buildSubEntityList().

void Ogre::SubMesh::removeLodLevels void    [protected]
 

Internal method for removing LOD data.

Definition at line 141 of file OgreSubMesh.cpp.

References mLodFaceList.

Referenced by ~SubMesh().

void Ogre::SubMesh::setMaterialName const String   matName
 

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

Definition at line 57 of file OgreSubMesh.cpp.

References mMaterialName, and mMatInitialised.

Referenced by Ogre::MeshSerializerImpl_v1::readSubMesh(), and Ogre::MeshSerializerImpl::readSubMesh().


Friends And Related Function Documentation

friend class Mesh [friend]
 

Definition at line 53 of file OgreSubMesh.h.

friend class MeshSerializerImpl [friend]
 

Definition at line 54 of file OgreSubMesh.h.

friend class MeshSerializerImpl_v1 [friend]
 

Definition at line 55 of file OgreSubMesh.h.


Member Data Documentation

IndexData* Ogre::SubMesh::indexData
 

Face index data.

Definition at line 77 of file OgreSubMesh.h.

Referenced by _getRenderOperation(), Ogre::Mesh::buildTangentVectors(), Ogre::MeshSerializerImpl::calcSubMeshSize(), Ogre::Mesh::clone(), Ogre::MeshManager::createPrefabPlane(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl_v1::readSubMesh(), Ogre::MeshSerializerImpl::readSubMesh(), Ogre::PatchMesh::setSubdivision(), SubMesh(), Ogre::MeshManager::tesselate2DMesh(), Ogre::MeshSerializerImpl::writeSubMesh(), and ~SubMesh().

VertexBoneAssignmentList Ogre::SubMesh::mBoneAssignments [protected]
 

Definition at line 142 of file OgreSubMesh.h.

Referenced by _compileBoneAssignments(), addBoneAssignment(), clearBoneAssignments(), Ogre::Mesh::clone(), getBoneAssignmentIterator(), and Ogre::MeshSerializerImpl::writeSubMesh().

bool Ogre::SubMesh::mBoneAssignmentsOutOfDate [protected]
 

Flag indicating that bone assignments need to be recompiled.

Definition at line 145 of file OgreSubMesh.h.

Referenced by _compileBoneAssignments(), addBoneAssignment(), clearBoneAssignments(), Ogre::Mesh::clone(), and SubMesh().

ProgressiveMesh::LODFaceList Ogre::SubMesh::mLodFaceList
 

Definition at line 79 of file OgreSubMesh.h.

Referenced by _getRenderOperation(), Ogre::Mesh::_setSubMeshLodFaceList(), Ogre::MeshSerializerImpl::readMeshLodInfo(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), removeLodLevels(), and Ogre::MeshSerializerImpl::writeLodUsageGenerated().

String Ogre::SubMesh::mMaterialName [protected]
 

Name of the material this SubMesh uses.

Definition at line 136 of file OgreSubMesh.h.

Referenced by Ogre::Mesh::clone(), getMaterialName(), and setMaterialName().

bool Ogre::SubMesh::mMatInitialised [protected]
 

Is there a material yet?

Definition at line 139 of file OgreSubMesh.h.

Referenced by Ogre::Mesh::clone(), isMatInitialised(), setMaterialName(), and SubMesh().

RenderOperation::OperationType Ogre::SubMesh::operationType
 

The render operation type used to render this submesh.

Definition at line 65 of file OgreSubMesh.h.

Referenced by _getRenderOperation(), Ogre::MeshSerializerImpl::readSubMeshOperation(), SubMesh(), and Ogre::MeshSerializerImpl::writeSubMeshOperation().

Mesh* Ogre::SubMesh::parent
 

Reference to parent Mesh.

Definition at line 82 of file OgreSubMesh.h.

Referenced by _compileBoneAssignments(), _getRenderOperation(), Ogre::Mesh::clone(), and Ogre::Mesh::createSubMesh().

bool Ogre::SubMesh::useSharedVertices
 

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

Definition at line 62 of file OgreSubMesh.h.

Referenced by _getRenderOperation(), Ogre::Mesh::buildTangentVectors(), Ogre::MeshSerializerImpl::calcSubMeshSize(), Ogre::Mesh::clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl_v1::readSubMesh(), Ogre::MeshSerializerImpl::readSubMesh(), SubMesh(), and Ogre::MeshSerializerImpl::writeSubMesh().

VertexData* Ogre::SubMesh::vertexData
 

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

Remarks:
This data is completely owned by this submesh.

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

Definition at line 74 of file OgreSubMesh.h.

Referenced by _compileBoneAssignments(), _getRenderOperation(), Ogre::Mesh::buildTangentVectors(), Ogre::MeshSerializerImpl::calcSubMeshSize(), Ogre::Mesh::clone(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl_v1::readSubMesh(), Ogre::MeshSerializerImpl::readSubMesh(), SubMesh(), Ogre::MeshSerializerImpl::writeSubMesh(), and ~SubMesh().


The documentation for this class was generated from the following files:

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:20:56 2004