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

Ogre::Mesh Class Reference

Resource holding data about 3D mesh. More...

#include <OgreMesh.h>

Inheritance diagram for Ogre::Mesh:

Inheritance graph
[legend]
Collaboration diagram for Ogre::Mesh:

Collaboration graph
[legend]
List of all members.

Public Types

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

typedef MapIterator< VertexBoneAssignmentListBoneAssignmentIterator

Public Methods

 Mesh (const String &name)
 Default constructor - used by MeshManager.

 ~Mesh ()
virtual void load (void)
 Generic load - called by MeshManager.

virtual void unload (void)
 Generic unload - called by MeshManager.

SubMeshcreateSubMesh (void)
 Creates a new SubMesh.

SubMeshcreateSubMesh (const String &name)
 Creates a new SubMesh and gives it a name.

void nameSubMesh (const String &name, ushort index)
 Gives a name to a SubMesh.

ushort _getSubMeshIndex (const String &name) const
 Gets the index of a submesh with a given name.

unsigned short getNumSubMeshes (void) const
 Gets the number of sub meshes which comprise this mesh.

SubMeshgetSubMesh (unsigned short index) const
 Gets a pointer to the submesh indicated by the index.

SubMeshgetSubMesh (const String &name) const
 Gets a SubMesh by name.

void setManuallyDefined (bool manuallyDefined)
 Call this to indicate that this Mesh will be manually defined rather than loaded from a file.

Mesh * clone (const String &newName)
 Makes a copy of this mesh object and gives it a new name.

const AxisAlignedBoxgetBounds (void) const
 Get the axis-aligned bounding box for this mesh.

Real getBoundingSphereRadius (void) const
 Gets the radius of the bounding sphere surrounding this mesh.

void _setBounds (const AxisAlignedBox &bounds)
 Manually set the bounding box for this Mesh.

void _setBoundingSphereRadius (Real radius)
 Manually set the bounding radius.

void setSkeletonName (const String &skelName)
 Sets the name of the skeleton this Mesh uses for animation.

bool hasSkeleton (void) const
 Returns true if this Mesh has a linked Skeleton.

SkeletongetSkeleton (void) const
 Gets a pointer to any linked Skeleton.

const StringgetSkeletonName (void) const
 Gets the name of any linked Skeleton.

void _initAnimationState (AnimationStateSet *animSet)
 Initialise an animation set suitable for use with 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.

unsigned short _getNumBoneMatrices (void) const
 Returns the number of bone matrices this mesh uses.

void _getBoneMatrices (const AnimationStateSet &animSet, Matrix4 *pMatrices)
 Applies the animation set passed in, and populates the passed in array of bone matrices.

void _notifySkeleton (Skeleton *pSkel)
 Internal notification, used to tell the Mesh which Skeleton to use without loading it.

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

void generateLodLevels (const LodDistanceList &lodDistances, ProgressiveMesh::VertexReductionQuota reductionMethod, Real reductionValue)
 Automatically generates lower level of detail versions of this mesh for use when a simpler version of the model is acceptable for rendering.

ushort getNumLodLevels (void) const
 Returns the number of levels of detail that this mesh supports.

const MeshLodUsagegetLodLevel (ushort index) const
 Gets details of the numbered level of detail entry.

void createManualLodLevel (Real fromDepth, const String &meshName)
 Adds a new manual level-of-detail entry to this Mesh.

void updateManualLodLevel (ushort index, const String &meshName)
 Changes the alternate mesh to use as a manual LOD at the given index.

ushort getLodIndex (Real depth) const
 Retrieves the level of detail index for the given depth value.

ushort getLodIndexSquaredDepth (Real squaredDepth) const
 Retrieves the level of detail index for the given squared depth value.

bool isLodManual (void) const
 Returns true if this mesh is using manual LOD.

void _setLodInfo (unsigned short numLevels, bool isManual)
 Internal methods for loading LOD, do not use.

void _setLodUsage (unsigned short level, Mesh::MeshLodUsage &usage)
 Internal methods for loading LOD, do not use.

void _setSubMeshLodFaceList (unsigned short subIdx, unsigned short level, IndexData *facedata)
 Internal methods for loading LOD, do not use.

void removeLodLevels (void)
 Removes all LOD data from this Mesh.

void setVertexBufferPolicy (HardwareBuffer::Usage usage, bool shadowBuffer=false)
 Sets the policy for the vertex buffers to be used when loading this Mesh.

void setIndexBufferPolicy (HardwareBuffer::Usage usage, bool shadowBuffer=false)
 Sets the policy for the index buffers to be used when loading this Mesh.

HardwareBuffer::Usage getVertexBufferUsage (void) const
 Gets the usage setting for this meshes vertex buffers.

HardwareBuffer::Usage getIndexBufferUsage (void) const
 Gets the usage setting for this meshes index buffers.

bool isVertexBufferShadowed (void) const
 Gets whether or not this meshes vertex buffers are shadowed.

bool isIndexBufferShadowed (void) const
 Gets whether or not this meshes index buffers are shadowed.

unsigned short _rationaliseBoneAssignments (size_t vertexCount, VertexBoneAssignmentList &assignments)
 Rationalises the passed in bone assignment list.

void _compileBoneAssignments (void)
 Internal method, be called once to compile bone assignments into geometry buffer.

void buildTangentVectors (unsigned short sourceTexCoordSet=0, unsigned short destTexCoordSet=1)
 This method builds a set of tangent vectors for a given mesh into a 3D texture coordinate buffer.

virtual size_t getSize (void) const
 Retrieves info about the size of the resource.

virtual void touch (void)
 'Touches' the resource to indicate it has been used.

time_t getLastAccess (void) const
 Gets the last time the resource was 'touched'.

const StringgetName (void) const
 Gets resource name.

ResourceHandle getHandle (void) const
bool isLoaded (void) const
 Returns true if the Resource has been loaded, false otherwise.

virtual void destroy ()
 A method to make the resource delete itself.


Public Attributes

VertexDatasharedVertexData
 Shared vertex data.


Protected Types

typedef std::vector< SubMesh * > SubMeshList
typedef HashMap< String, ushort,
_StringHash
SubMeshNameMap
 A hashmap used to store optional SubMesh names.

typedef std::vector< MeshLodUsageMeshLodUsageList

Protected Methods

HardwareVertexBufferSharedPtr getTangentsBuffer (VertexData *vertexData, unsigned short texCoordSet)
 Internal method for getting or creating a 3D texture coord buffer to hold tangents.

void compileBoneAssignmentsSoftware (const VertexBoneAssignmentList &boneAssignments, unsigned short numBlendWeightsPerVertex, VertexData *targetVertexData)
 Software blending oriented bone assignment compilation.

void compileBoneAssignmentsHardware (const VertexBoneAssignmentList &boneAssignments, unsigned short numBlendWeightsPerVertex, VertexData *targetVertexData)
 Hardware blending oriented bone assignment compilation.


Protected Attributes

SubMeshList mSubMeshList
 A list of submeshes which make up this mesh.

SubMeshNameMap mSubMeshNameMap
AxisAlignedBox mAABB
 Local bounding box volume.

Real mBoundRadius
 Local bounding sphere radius (centered on object).

bool mManuallyDefined
String mSkeletonName
 Optional linked skeleton.

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

HardwareVertexBufferSharedPtr mBlendingVB
bool mUseSoftwareBlending
 Option whether to use software or hardware blending, there are tradeoffs to both.

bool mIsLodManual
ushort mNumLods
MeshLodUsageList mMeshLodUsageList
HardwareBuffer::Usage mVertexBufferUsage
HardwareBuffer::Usage mIndexBufferUsage
bool mVertexBufferShadowBuffer
bool mIndexBufferShadowBuffer
String mName
ResourceHandle mHandle
bool mIsLoaded
time_t mLastAccess
size_t mSize

Friends

class MeshSerializerImpl
class MeshSerializerImpl_v1
class SubMesh

Detailed Description

Resource holding data about 3D mesh.

Remarks:
This class holds the data used to represent a discrete 3-dimensional object. Mesh data usually contains more than just vertices and triangle information; it also includes references to materials (and the faces which use them), level-of-detail reduction information, convex hull definition, skeleton/bones information, keyframe animation etc. However, it is important to note the emphasis on the word 'discrete' here. This class does not cover the large-scale sprawling geometry found in level / landscape data.

Multiple world objects can (indeed should) be created from a single mesh object - see the Entity class for more info. The mesh object will have it's own default material properties, but potentially each world instance may wish to customise the materials from the original. When the object is instantiated into a scene node, the mesh material properties will be taken by default but may be changed. These properties are actually held at the SubMesh level since a single mesh may have parts with different materials.

As described above, because the mesh may have sections of differing material properties, a mesh is inherently a compound contruct, consisting of one or more SubMesh objects. However, it strongly 'owns' it's SubMeshes such that they are loaded / unloaded at the same time. This is contrary to the approach taken to hierarchically related (but loosely owned) scene nodes, where data is loaded / unloaded separately. Note also that mesh sub-sections (when used in an instantiated object) share the same scene node as the parent.

Definition at line 79 of file OgreMesh.h.


Member Typedef Documentation

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

Definition at line 99 of file OgreMesh.h.

Referenced by getBoneAssignmentIterator().

typedef std::vector<Real> Ogre::Mesh::LodDistanceList
 

Definition at line 96 of file OgreMesh.h.

typedef std::vector<MeshLodUsage> Ogre::Mesh::MeshLodUsageList [protected]
 

Definition at line 154 of file OgreMesh.h.

typedef std::vector<SubMesh*> Ogre::Mesh::SubMeshList [protected]
 

Definition at line 102 of file OgreMesh.h.

typedef HashMap<String, ushort, _StringHash> Ogre::Mesh::SubMeshNameMap [protected]
 

A hashmap used to store optional SubMesh names.

Translates a name into SubMesh index

Definition at line 117 of file OgreMesh.h.

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

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

Definition at line 98 of file OgreMesh.h.


Constructor & Destructor Documentation

Ogre::Mesh::Mesh const String   name
 

Default constructor - used by MeshManager.

Warning:
Do not call this method directly.

Definition at line 44 of file OgreMesh.cpp.

References Ogre::Mesh::MeshLodUsage::fromDepthSquared, mBoneAssignmentsOutOfDate, mBoundRadius, mIndexBufferShadowBuffer, mIndexBufferUsage, mIsLodManual, mManuallyDefined, mMeshLodUsageList, Ogre::Resource::mName, mNumLods, mUseSoftwareBlending, mVertexBufferShadowBuffer, mVertexBufferUsage, setSkeletonName(), and sharedVertexData.

Ogre::Mesh::~Mesh  
 

Definition at line 73 of file OgreMesh.cpp.

References unload().


Member Function Documentation

void Ogre::Mesh::_compileBoneAssignments void   
 

Internal method, be called once to compile bone assignments into geometry buffer.

Remarks:
The OGRE engine calls this method automatically. It compiles the information submitted as bone assignments into a format usable in realtime. It also eliminates excessive bone assignments (max is OGRE_MAX_BLEND_WEIGHTS) and re-normalises the remaining assignments.

Definition at line 504 of file OgreMesh.cpp.

References _rationaliseBoneAssignments(), compileBoneAssignmentsHardware(), compileBoneAssignmentsSoftware(), mBoneAssignments, mBoneAssignmentsOutOfDate, sharedVertexData, and Ogre::VertexData::vertexCount.

Referenced by _initAnimationState().

void Ogre::Mesh::_getBoneMatrices const AnimationStateSet   animSet,
Matrix4   pMatrices
 

Applies the animation set passed in, and populates the passed in array of bone matrices.

Remarks:
Internal use only. The array pointed to by the passed in Matrix4 pointer must have enough 'slots' for the number of bone matrices required (see _getNumBoneMatrices).

Definition at line 408 of file OgreMesh.cpp.

References Ogre::Skeleton::_getBoneMatrices(), Ogre::AnimationStateSet, mSkeleton, and Ogre::Skeleton::setAnimationState().

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

unsigned short Ogre::Mesh::_getNumBoneMatrices void    const
 

Returns the number of bone matrices this mesh uses.

Remarks:
Only applicable if hasSkeleton() is true, for internal use only.

Definition at line 400 of file OgreMesh.cpp.

References Ogre::Skeleton::getNumBones(), and mSkeleton.

Referenced by Ogre::Entity::cacheBoneMatrices(), and Ogre::Entity::Entity().

ushort Ogre::Mesh::_getSubMeshIndex const String   name const
 

Gets the index of a submesh with a given name.

Remarks:
Useful if you identify the SubMeshes by name (using nameSubMesh) but wish to have faster repeat access.

Definition at line 815 of file OgreMesh.cpp.

References Except, mSubMeshNameMap, and Ogre::ushort.

Referenced by Ogre::Entity::getSubEntity(), and getSubMesh().

void Ogre::Mesh::_initAnimationState AnimationStateSet   animSet
 

Initialise an animation set suitable for use with this mesh.

Remarks:
Only recommended for use inside the engine, not by applications.

Definition at line 380 of file OgreMesh.cpp.

References _compileBoneAssignments(), Ogre::Skeleton::_initAnimationState(), Ogre::AnimationStateSet, mSkeleton, and mSubMeshList.

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

void Ogre::Mesh::_notifySkeleton Skeleton   pSkel
 

Internal notification, used to tell the Mesh which Skeleton to use without loading it.

Remarks:
This is only here for unusual situation where you want to manually set up a Skeleton. Best to let OGRE deal with this, don't call it yourself unless you really know what you're doing.

Definition at line 653 of file OgreMesh.cpp.

References Ogre::Resource::getName(), mSkeleton, and mSkeletonName.

unsigned short Ogre::Mesh::_rationaliseBoneAssignments size_t    vertexCount,
VertexBoneAssignmentList   assignments
 

Rationalises the passed in bone assignment list.

Remarks:
OGRE supports up to 4 bone assignments per vertex. The reason for this limit is that this is the maximum number of assignments that can be passed into a hardware-assisted blending algorithm. This method identifies where there are more than 4 bone assignments for a given vertex, and eliminates the bone assignments with the lowest weights to reduce to this limit. The remaining weights are then re-balanced to ensure that they sum to 1.0.
Parameters:
vertexCount  The number of vertices.
assignments  The bone assignment list to rationalise. This list will be modified and entries will be removed where the limits are exceeded.
Returns:
The maximum number of bone assignments per vertex found, clamped to [1-4]

Definition at line 419 of file OgreMesh.cpp.

References Ogre::Resource::mName, OGRE_MAX_BLEND_WEIGHTS, Ogre::Real, and Ogre::WeightIteratorMap.

Referenced by Ogre::SubMesh::_compileBoneAssignments(), and _compileBoneAssignments().

void Ogre::Mesh::_setBoundingSphereRadius Real    radius
 

Manually set the bounding radius.

Remarks:
Calling this method is required when building manual meshes now, because OGRE can no longer update the bounds for you, because it cannot necessarily read vertex data back from the vertex buffers which this mesh uses (they very well might be write-only, and even if they are not, reading data from a hardware buffer is a bottleneck).

Definition at line 322 of file OgreMesh.cpp.

References mBoundRadius, and Ogre::Real.

Referenced by Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl::readBoundsInfo(), and Ogre::MeshSerializerImpl_v1::readGeometry().

void Ogre::Mesh::_setBounds const AxisAlignedBox   bounds
 

Manually set the bounding box for this Mesh.

Remarks:
Calling this method is required when building manual meshes now, because OGRE can no longer update the bounds for you, because it cannot necessarily read vertex data back from the vertex buffers which this mesh uses (they very well might be write-only, and even if they are not, reading data from a hardware buffer is a bottleneck).

Definition at line 304 of file OgreMesh.cpp.

References Ogre::AxisAlignedBox::getMaximum(), Ogre::AxisAlignedBox::getMinimum(), mAABB, mBoundRadius, Ogre::Real, Ogre::AxisAlignedBox::setExtents(), and Ogre::Vector3::squaredLength().

Referenced by Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl::readBoundsInfo(), and Ogre::MeshSerializerImpl_v1::readGeometry().

void Ogre::Mesh::_setLodInfo unsigned short    numLevels,
bool    isManual
 

Internal methods for loading LOD, do not use.

Definition at line 790 of file OgreMesh.cpp.

References mIsLodManual, mMeshLodUsageList, mNumLods, and mSubMeshList.

void Ogre::Mesh::_setLodUsage unsigned short    level,
Mesh::MeshLodUsage   usage
 

Internal methods for loading LOD, do not use.

Definition at line 802 of file OgreMesh.cpp.

References mMeshLodUsageList.

void Ogre::Mesh::_setSubMeshLodFaceList unsigned short    subIdx,
unsigned short    level,
IndexData   facedata
 

Internal methods for loading LOD, do not use.

Definition at line 807 of file OgreMesh.cpp.

References Ogre::SubMesh::mLodFaceList, and mSubMeshList.

void Ogre::Mesh::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 shared geometry of the Mesh. To assign weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.

Definition at line 367 of file OgreMesh.cpp.

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

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

void Ogre::Mesh::buildTangentVectors unsigned short    sourceTexCoordSet = 0,
unsigned short    destTexCoordSet = 1
 

This method builds a set of tangent vectors for a given mesh into a 3D texture coordinate buffer.

Remarks:
Tangent vectors are vectors representing the local 'X' axis for a given vertex based on the orientation of the 2D texture on the geometry. They are built from a combination of existing normals, and from the 2D texture coordinates already baked into the model. They can be used for a number of things, but most of all they are useful for vertex and fragment programs, when you wish to arrive at a common space for doing per-pixel calculations.

The prerequisites for calling this method include that the vertex data used by every SubMesh has both vertex normals and 2D texture coordinates.

Parameters:
sourceTexCoordSet  The texture coordinate index which should be used as the source of 2D texture coordinates, with which to calculate the tangents.
destTexCoordSet  The texture coordinate set which should be used to store the 3D coordinates representing a tangent vector per vertex. If this already exists, it will be overwritten.

Definition at line 907 of file OgreMesh.cpp.

References Except, Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexBufferBinding::getBuffer(), getNumSubMeshes(), Ogre::VertexElement::getSource(), getSubMesh(), getTangentsBuffer(), Ogre::VertexElement::getType(), Ogre::IndexData::indexBuffer, Ogre::IndexData::indexCount, Ogre::SubMesh::indexData, Ogre::Resource::mName, Ogre::Vector3::normalise(), Ogre::Real, sharedVertexData, Ogre::SubMesh::useSharedVertices, Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::SubMesh::vertexData, Ogre::VertexData::vertexDeclaration, Ogre::VES_POSITION, Ogre::VES_TEXTURE_COORDINATES, Ogre::VET_FLOAT2, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

void Ogre::Mesh::clearBoneAssignments void   
 

Removes all bone assignments for this mesh.

Remarks:
This method is for modifying weights to the shared geometry of the Mesh. To assign weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.

Definition at line 374 of file OgreMesh.cpp.

References mBoneAssignments, and mBoneAssignmentsOutOfDate.

Mesh * Ogre::Mesh::clone const String   newName
 

Makes a copy of this mesh object and gives it a new name.

Remarks:
This is useful if you want to tweak an existing mesh without affecting the original one. The newly cloned mesh is registered with the MeshManager under the new name.

Definition at line 193 of file OgreMesh.cpp.

References Ogre::IndexData::clone(), Ogre::VertexData::clone(), createSubMesh(), Ogre::SubMesh::indexData, mAABB, mBoneAssignments, Ogre::SubMesh::mBoneAssignments, mBoneAssignmentsOutOfDate, Ogre::SubMesh::mBoneAssignmentsOutOfDate, mBoundRadius, mIndexBufferShadowBuffer, mIndexBufferUsage, mIsLodManual, Ogre::SubMesh::mMaterialName, Ogre::SubMesh::mMatInitialised, mMeshLodUsageList, mNumLods, mSkeleton, mSkeletonName, mSubMeshList, mSubMeshNameMap, mUseSoftwareBlending, mVertexBufferShadowBuffer, mVertexBufferUsage, Ogre::SubMesh::parent, sharedVertexData, Ogre::SubMesh::useSharedVertices, and Ogre::SubMesh::vertexData.

void Ogre::Mesh::compileBoneAssignmentsHardware const VertexBoneAssignmentList   boneAssignments,
unsigned short    numBlendWeightsPerVertex,
VertexData   targetVertexData
[protected]
 

Hardware blending oriented bone assignment compilation.

Definition at line 575 of file OgreMesh.cpp.

References Ogre::VertexDeclaration::addElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexElement::getIndex(), Ogre::VertexBufferBinding::getNextIndex(), Ogre::VertexDeclaration::getVertexSize(), mBlendingVB, Ogre::Real, Ogre::VertexDeclaration::removeElement(), Ogre::VertexBufferBinding::setBinding(), Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VES_BLEND_INDICES, Ogre::VES_BLEND_WEIGHTS, Ogre::VET_FLOAT1, and Ogre::VET_SHORT1.

Referenced by Ogre::SubMesh::_compileBoneAssignments(), and _compileBoneAssignments().

void Ogre::Mesh::compileBoneAssignmentsSoftware const VertexBoneAssignmentList   boneAssignments,
unsigned short    numBlendWeightsPerVertex,
VertexData   targetVertexData
[protected]
 

Software blending oriented bone assignment compilation.

Definition at line 528 of file OgreMesh.cpp.

References Ogre::Real, Ogre::VertexData::softwareBlendInfo, and Ogre::VertexData::vertexCount.

Referenced by Ogre::SubMesh::_compileBoneAssignments(), and _compileBoneAssignments().

void Ogre::Mesh::createManualLodLevel Real    fromDepth,
const String   meshName
 

Adds a new manual level-of-detail entry to this Mesh.

Remarks:
As an alternative to generating lower level of detail versions of a mesh, you can use your own manually modelled meshes as lower level versions. This lets you have complete control over the LOD, and in addition lets you scale down other aspects of the model which cannot be done using the generated method; for example, you could use less detailed materials and / or use less bones in the skeleton if this is an animated mesh. Therefore for complex models you are likely to be better off modelling your LODs yourself and using this method, whilst for models with fairly simple materials and no animation you can just use the generateLodLevels method.
Parameters:
fromDepth  The z value from which this Lod will apply.
meshName  The name of the mesh which will be the lower level detail version.

Definition at line 740 of file OgreMesh.cpp.

References Ogre::Mesh::MeshLodUsage::fromDepthSquared, Ogre::Mesh::MeshLodUsage::manualMesh, Ogre::Mesh::MeshLodUsage::manualName, mIsLodManual, mMeshLodUsageList, mNumLods, and Ogre::Real.

SubMesh * Ogre::Mesh::createSubMesh const String   name
 

Creates a new SubMesh and gives it a name.

Definition at line 92 of file OgreMesh.cpp.

References createSubMesh(), mSubMeshList, nameSubMesh(), and Ogre::ushort.

SubMesh * Ogre::Mesh::createSubMesh void   
 

Creates a new SubMesh.

Remarks:
Method for manually creating geometry for the mesh. Note - use with extreme caution - you must be sure that you have set up the geometry properly.

Definition at line 82 of file OgreMesh.cpp.

References mSubMeshList, Ogre::SubMesh::parent, and SubMesh.

Referenced by clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), createSubMesh(), Ogre::PatchMesh::load(), Ogre::MeshSerializerImpl_v1::readSubMesh(), and Ogre::MeshSerializerImpl::readSubMesh().

virtual void Ogre::Resource::destroy void    [virtual, inherited]
 

A method to make the resource delete itself.

Note:
This exists because Resource objects could be created in other processes, and they need to be destroyed in the process that created them.

Definition at line 137 of file OgreResource.h.

void Ogre::Mesh::generateLodLevels const LodDistanceList   lodDistances,
ProgressiveMesh::VertexReductionQuota    reductionMethod,
Real    reductionValue
 

Automatically generates lower level of detail versions of this mesh for use when a simpler version of the model is acceptable for rendering.

Remarks:
There are 2 ways that you can create level-of-detail (LOD) versions of a mesh; the first is to call this method, which does fairly extensive calculations to work out how to simplify the mesh whilst having the minimum affect on the model. The alternative is to actually create simpler versions of the mesh yourself in a modelling tool, and having exported them, tell the 'master' mesh to use these alternative meshes for lower detail versions; this is done by calling the createManualLodLevel method.

As well as creating the lower detail versions of the mesh, this method will also associate them with depth values. As soon as an object is at least as far away from the camera as the depth value associated with it's LOD, it will drop to that level of detail.

I recommend calling this method before mesh export, not at runtime.

Parameters:
lodDistances  A list of depth values indicating the distances at which new lods should be generated.
reductionMethod  The way to determine the number of vertices collapsed per LOD
reductionValue  Meaning depends on reductionMethod, typically either the proportion of remaining vertices to collapse or a fixed number of vertices.

Definition at line 670 of file OgreMesh.cpp.

References Ogre::ProgressiveMesh::build(), Ogre::Mesh::MeshLodUsage::fromDepthSquared, mIsLodManual, mMeshLodUsageList, Ogre::Resource::mName, mNumLods, mSubMeshList, Ogre::Real, and sharedVertexData.

Mesh::BoneAssignmentIterator Ogre::Mesh::getBoneAssignmentIterator void   
 

Gets an iterator for access all bone assignments.

Definition at line 659 of file OgreMesh.cpp.

References BoneAssignmentIterator, and mBoneAssignments.

Real Ogre::Mesh::getBoundingSphereRadius void    const
 

Gets the radius of the bounding sphere surrounding this mesh.

Definition at line 851 of file OgreMesh.cpp.

References mBoundRadius, and Ogre::Real.

Referenced by Ogre::MeshSerializerImpl::exportMesh(), and Ogre::Entity::getBoundingRadius().

const AxisAlignedBox & Ogre::Mesh::getBounds void    const
 

Get the axis-aligned bounding box for this mesh.

Definition at line 295 of file OgreMesh.cpp.

References mAABB.

Referenced by Ogre::MeshSerializerImpl::exportMesh(), and Ogre::Entity::getBoundingBox().

ResourceHandle Ogre::Resource::getHandle void    const [inherited]
 

Definition at line 120 of file OgreResource.h.

References Ogre::ResourceHandle.

Referenced by Ogre::Material::clone(), Ogre::BspLevel::loadQuake3Level(), and Ogre::ResourceManager::unload().

HardwareBuffer::Usage Ogre::Mesh::getIndexBufferUsage void    const
 

Gets the usage setting for this meshes index buffers.

Definition at line 486 of file OgreMesh.h.

time_t Ogre::Resource::getLastAccess void    const [inherited]
 

Gets the last time the resource was 'touched'.

Definition at line 108 of file OgreResource.h.

ushort Ogre::Mesh::getLodIndex Real    depth const
 

Retrieves the level of detail index for the given depth value.

Definition at line 766 of file OgreMesh.cpp.

References getLodIndexSquaredDepth(), Ogre::Real, and Ogre::ushort.

ushort Ogre::Mesh::getLodIndexSquaredDepth Real    squaredDepth const
 

Retrieves the level of detail index for the given squared depth value.

Remarks:
Internally the lods are stored at squared depths to avoid having to perform square roots when determining the lod. This method allows you to provide a squared length depth value to avoid having to do your own square roots.

Definition at line 771 of file OgreMesh.cpp.

References mMeshLodUsageList, Ogre::Real, and Ogre::ushort.

Referenced by Ogre::Entity::_notifyCurrentCamera(), and getLodIndex().

const Mesh::MeshLodUsage & Ogre::Mesh::getLodLevel ushort    index const
 

Gets details of the numbered level of detail entry.

Definition at line 719 of file OgreMesh.cpp.

References mIsLodManual, mMeshLodUsageList, and Ogre::ushort.

Referenced by Ogre::Entity::cacheBoneMatrices(), Ogre::Entity::Entity(), and Ogre::MeshSerializerImpl::writeLodInfo().

const String& Ogre::Resource::getName void    const [inherited]
 

Gets resource name.

Reimplemented in Ogre::Material, and Ogre::Overlay.

Definition at line 115 of file OgreResource.h.

Referenced by Ogre::D3D9Texture::_loadCubeTex(), _notifySkeleton(), Ogre::ResourceManager::add(), Ogre::PopupMenuGuiElement::addListItem(), Ogre::ListGuiElement::addListItem(), Ogre::PopupMenuGuiElement::addMenuItem(), Ogre::MeshManager::createPrefabPlane(), Ogre::TTYGuiElement::getFontName(), Ogre::TextAreaGuiElement::getFontName(), Ogre::PopupMenuGuiElement::getListItemName(), Ogre::ListGuiElement::getListItemName(), Ogre::GpuProgramUsage::getProgramName(), Ogre::MeshSerializer::importMesh(), Ogre::GLTexture::load(), Ogre::TextureManager::loadImage(), Ogre::TextureManager::loadRawData(), Ogre::FontManager::logBadAttrib(), Ogre::MeshSerializerImpl_v1::readMaterial(), Ogre::MeshSerializerImpl::readMeshLodInfo(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageManual(), Ogre::PopupMenuGuiElement::removeListItem(), Ogre::ListGuiElement::removeListItem(), Ogre::SceneManager::setSkyBox(), Ogre::SceneManager::setSkyDome(), and Ogre::ResourceManager::unload().

ushort Ogre::Mesh::getNumLodLevels void    const
 

Returns the number of levels of detail that this mesh supports.

Remarks:
This number includes the original model.

Definition at line 714 of file OgreMesh.cpp.

References mNumLods, and Ogre::ushort.

Referenced by Ogre::Entity::Entity(), Ogre::MeshSerializerImpl::writeLodInfo(), and Ogre::MeshSerializerImpl::writeMesh().

unsigned short Ogre::Mesh::getNumSubMeshes void    const
 

Gets the number of sub meshes which comprise this mesh.

Definition at line 99 of file OgreMesh.cpp.

References mSubMeshList.

Referenced by Ogre::Entity::buildSubEntityList(), buildTangentVectors(), Ogre::MeshSerializerImpl::calcMeshSize(), Ogre::MeshSerializerImpl::readMeshLodInfo(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::writeLodUsageGenerated(), and Ogre::MeshSerializerImpl::writeMesh().

virtual size_t Ogre::Resource::getSize void    const [virtual, inherited]
 

Retrieves info about the size of the resource.

Definition at line 93 of file OgreResource.h.

Referenced by Ogre::ResourceManager::unload().

Skeleton * Ogre::Mesh::getSkeleton void    const
 

Gets a pointer to any linked Skeleton.

Definition at line 362 of file OgreMesh.cpp.

References mSkeleton.

Referenced by Ogre::Entity::_updateRenderQueue(), Ogre::Entity::attachObjectToBone(), and Ogre::Entity::cacheBoneMatrices().

const String & Ogre::Mesh::getSkeletonName void    const
 

Gets the name of any linked Skeleton.

Definition at line 665 of file OgreMesh.cpp.

References mSkeletonName.

Referenced by Ogre::MeshSerializerImpl::calcMeshSize(), and Ogre::MeshSerializerImpl::writeMesh().

SubMesh * Ogre::Mesh::getSubMesh const String   name const
 

Gets a SubMesh by name.

Definition at line 111 of file OgreMesh.cpp.

References _getSubMeshIndex(), getSubMesh(), and Ogre::ushort.

SubMesh * Ogre::Mesh::getSubMesh unsigned short    index const
 

Gets a pointer to the submesh indicated by the index.

Definition at line 117 of file OgreMesh.cpp.

References mSubMeshList.

Referenced by Ogre::Entity::buildSubEntityList(), buildTangentVectors(), Ogre::MeshSerializerImpl::calcMeshSize(), Ogre::Node::getRenderOperation(), getSubMesh(), Ogre::MeshSerializerImpl::readMeshLodInfo(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::PatchMesh::setSubdivision(), Ogre::MeshSerializerImpl::writeLodUsageGenerated(), and Ogre::MeshSerializerImpl::writeMesh().

HardwareVertexBufferSharedPtr Ogre::Mesh::getTangentsBuffer VertexData   vertexData,
unsigned short    texCoordSet
[protected]
 

Internal method for getting or creating a 3D texture coord buffer to hold tangents.

Definition at line 868 of file OgreMesh.cpp.

References Ogre::VertexDeclaration::addElement(), Ogre::VertexDeclaration::findElementBySemantic(), Ogre::VertexBufferBinding::getBuffer(), Ogre::VertexBufferBinding::getNextIndex(), Ogre::VertexElement::getSource(), Ogre::VertexElement::getType(), Ogre::VertexDeclaration::removeElement(), Ogre::VertexBufferBinding::setBinding(), Ogre::VertexBufferBinding::unsetBinding(), Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VES_TEXTURE_COORDINATES, and Ogre::VET_FLOAT3.

Referenced by buildTangentVectors().

HardwareBuffer::Usage Ogre::Mesh::getVertexBufferUsage void    const
 

Gets the usage setting for this meshes vertex buffers.

Definition at line 484 of file OgreMesh.h.

Referenced by Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords().

bool Ogre::Mesh::hasSkeleton void    const
 

Returns true if this Mesh has a linked Skeleton.

Definition at line 357 of file OgreMesh.cpp.

References mSkeletonName.

Referenced by Ogre::Entity::_updateRenderQueue(), Ogre::Entity::attachObjectToBone(), Ogre::Entity::cacheBoneMatrices(), Ogre::MeshSerializerImpl::calcMeshSize(), Ogre::Entity::Entity(), and Ogre::MeshSerializerImpl::writeMesh().

bool Ogre::Mesh::isIndexBufferShadowed void    const
 

Gets whether or not this meshes index buffers are shadowed.

Definition at line 490 of file OgreMesh.h.

bool Ogre::Resource::isLoaded void    const [inherited]
 

Returns true if the Resource has been loaded, false otherwise.

Definition at line 127 of file OgreResource.h.

Referenced by Ogre::GpuProgramUsage::_load(), Ogre::Technique::isLoaded(), Ogre::D3D9Texture::load(), Ogre::D3D9Texture::unload(), and Ogre::D3D9Texture::~D3D9Texture().

bool Ogre::Mesh::isLodManual void    const
 

Returns true if this mesh is using manual LOD.

Remarks:
A mesh can either use automatically generated LOD, or it can use alternative meshes as provided by an artist. A mesh can only use either all manual LODs or all generated LODs, not a mixture of both.

Definition at line 425 of file OgreMesh.h.

Referenced by Ogre::Entity::_updateRenderQueue(), Ogre::Entity::cacheBoneMatrices(), Ogre::Entity::Entity(), Ogre::MeshSerializerImpl::readMeshLodInfo(), and Ogre::MeshSerializerImpl::writeLodInfo().

bool Ogre::Mesh::isVertexBufferShadowed void    const
 

Gets whether or not this meshes vertex buffers are shadowed.

Definition at line 488 of file OgreMesh.h.

Referenced by Ogre::MeshSerializerImpl_v1_1::readGeometryTexCoords().

void Ogre::Mesh::load void    [virtual]
 

Generic load - called by MeshManager.

Implements Ogre::Resource.

Reimplemented in Ogre::PatchMesh.

Definition at line 123 of file OgreMesh.cpp.

References Ogre::DataChunk::clear(), Except, Ogre::MeshSerializer::importMesh(), Ogre::Resource::mIsLoaded, mManuallyDefined, Ogre::Resource::mName, Ogre::String::split(), Ogre::String::toLowerCase(), and unload().

void Ogre::Mesh::nameSubMesh const String   name,
ushort    index
 

Gives a name to a SubMesh.

Definition at line 105 of file OgreMesh.cpp.

References mSubMeshNameMap, and Ogre::ushort.

Referenced by createSubMesh().

void Ogre::Mesh::removeLodLevels void   
 

Removes all LOD data from this Mesh.

Definition at line 825 of file OgreMesh.cpp.

References Ogre::Mesh::MeshLodUsage::fromDepthSquared, mIsLodManual, mMeshLodUsageList, mNumLods, and mSubMeshList.

void Ogre::Mesh::setIndexBufferPolicy HardwareBuffer::Usage    usage,
bool    shadowBuffer = false
 

Sets the policy for the index buffers to be used when loading this Mesh.

Remarks:
By default, when loading the Mesh, static, write-only vertex and index buffers will be used where possible in order to improve rendering performance. However, such buffers cannot be manipulated on the fly by CPU code (although shader code can). If you wish to use the CPU to modify these buffers, you should call this method. Note, however, that it only takes effect after the Mesh has been reloaded. Note that you still have the option of manually repacing the buffers in this mesh with your own if you see fit too, in which case you don't need to call this method since it only affects buffers created by the mesh itself.

You can define the approach to a Mesh by changing the default parameters to MeshManager::load if you wish; this means the Mesh is loaded with those options the first time instead of you having to reload the mesh after changing these options.

Parameters:
usage  The usage flags, which by default are HardwareBuffer::HBU_STATIC_WRITE_ONLY
shadowBuffer  If set to true, the index buffers will be created with a system memory shadow buffer. You should set this if you want to be able to read from the buffer, because reading from a hardware buffer is a no-no.

Definition at line 862 of file OgreMesh.cpp.

References mIndexBufferShadowBuffer, and mIndexBufferUsage.

Referenced by Ogre::MeshManager::load().

void Ogre::Mesh::setManuallyDefined bool    manuallyDefined
 

Call this to indicate that this Mesh will be manually defined rather than loaded from a file.

Remarks:
Normally, when load() is called on a Resource such as a Mesh, a file of data is loaded. However, by calling this method with a parameter of 'true' you are indicating that the contents of this Mesh will be defined programmatically rather than by loading from a file. Note that the load() method must still be called in order to confirm the Mesh's use for the renderer, set up materials etc.

Definition at line 187 of file OgreMesh.cpp.

References mManuallyDefined.

Referenced by Ogre::MeshManager::createBezierPatch(), and Ogre::MeshManager::createManual().

void Ogre::Mesh::setSkeletonName const String   skelName
 

Sets the name of the skeleton this Mesh uses for animation.

Remarks:
Meshes can optionally be assigned a skeleton which can be used to animate the mesh through bone assignments. The default is for the Mesh to use no skeleton. Calling this method with a valid skeleton filename will cause the skeleton to be loaded if it is not already (a single skeleton can be shared by many Mesh objects).
Parameters:
skelName  The name of the .skeleton file to use, or an empty string to use no skeleton

Definition at line 327 of file OgreMesh.cpp.

References Ogre::Skeleton::load(), Ogre::Resource::mName, mSkeleton, and mSkeletonName.

Referenced by Mesh(), and Ogre::MeshSerializerImpl::readSkeletonLink().

void Ogre::Mesh::setVertexBufferPolicy HardwareBuffer::Usage    usage,
bool    shadowBuffer = false
 

Sets the policy for the vertex buffers to be used when loading this Mesh.

Remarks:
By default, when loading the Mesh, static, write-only vertex and index buffers will be used where possible in order to improve rendering performance. However, such buffers cannot be manipulated on the fly by CPU code (although shader code can). If you wish to use the CPU to modify these buffers, you should call this method. Note, however, that it only takes effect after the Mesh has been reloaded. Note that you still have the option of manually repacing the buffers in this mesh with your own if you see fit too, in which case you don't need to call this method since it only affects buffers created by the mesh itself.

You can define the approach to a Mesh by changing the default parameters to MeshManager::load if you wish; this means the Mesh is loaded with those options the first time instead of you having to reload the mesh after changing these options.

Parameters:
usage  The usage flags, which by default are HardwareBuffer::HBU_STATIC_WRITE_ONLY
shadowBuffer  If set to true, the vertex buffers will be created with a system memory shadow buffer. You should set this if you want to be able to read from the buffer, because reading from a hardware buffer is a no-no.

Definition at line 856 of file OgreMesh.cpp.

References mVertexBufferShadowBuffer, and mVertexBufferUsage.

Referenced by Ogre::MeshManager::load(), and Ogre::MeshSerializerImpl::readMesh().

virtual void Ogre::Resource::touch void    [virtual, inherited]
 

'Touches' the resource to indicate it has been used.

Reimplemented in Ogre::Material.

Definition at line 100 of file OgreResource.h.

Referenced by Ogre::ResourceManager::load().

void Ogre::Mesh::unload void    [virtual]
 

Generic unload - called by MeshManager.

Reimplemented from Ogre::Resource.

Definition at line 167 of file OgreMesh.cpp.

References Ogre::Resource::mIsLoaded, mSubMeshList, mSubMeshNameMap, and sharedVertexData.

Referenced by load(), and ~Mesh().

void Ogre::Mesh::updateManualLodLevel ushort    index,
const String   meshName
 

Changes the alternate mesh to use as a manual LOD at the given index.

Remarks:
Note that the index of a LOD may change if you insert other LODs. If in doubt, use getLodIndex().
Parameters:
index  The index of the level to be changed
meshName  The name of the mesh which will be the lower level detail version.

Definition at line 753 of file OgreMesh.cpp.

References Ogre::Mesh::MeshLodUsage::manualMesh, Ogre::Mesh::MeshLodUsage::manualName, mIsLodManual, mMeshLodUsageList, and Ogre::ushort.


Friends And Related Function Documentation

friend class MeshSerializerImpl [friend]
 

Definition at line 81 of file OgreMesh.h.

friend class MeshSerializerImpl_v1 [friend]
 

Definition at line 82 of file OgreMesh.h.

friend class SubMesh [friend]
 

Definition at line 83 of file OgreMesh.h.

Referenced by createSubMesh().


Member Data Documentation

AxisAlignedBox Ogre::Mesh::mAABB [protected]
 

Local bounding box volume.

Definition at line 121 of file OgreMesh.h.

Referenced by _setBounds(), clone(), getBounds(), Ogre::MeshSerializerImpl_v1::readGeometry(), and Ogre::MeshSerializerImpl::writeBoundsInfo().

HardwareVertexBufferSharedPtr Ogre::Mesh::mBlendingVB [protected]
 

Definition at line 148 of file OgreMesh.h.

Referenced by compileBoneAssignmentsHardware().

VertexBoneAssignmentList Ogre::Mesh::mBoneAssignments [protected]
 

Definition at line 136 of file OgreMesh.h.

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

bool Ogre::Mesh::mBoneAssignmentsOutOfDate [protected]
 

Flag indicating that bone assignments need to be recompiled.

Definition at line 139 of file OgreMesh.h.

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

Real Ogre::Mesh::mBoundRadius [protected]
 

Local bounding sphere radius (centered on object).

Definition at line 123 of file OgreMesh.h.

Referenced by _setBoundingSphereRadius(), _setBounds(), clone(), getBoundingSphereRadius(), Mesh(), Ogre::MeshSerializerImpl_v1::readGeometry(), and Ogre::MeshSerializerImpl::writeBoundsInfo().

ResourceHandle Ogre::Resource::mHandle [protected, inherited]
 

Definition at line 57 of file OgreResource.h.

Referenced by Ogre::ResourceManager::add(), Ogre::Material::clone(), Ogre::Material::copyDetailsTo(), and Ogre::Material::operator=().

bool Ogre::Mesh::mIndexBufferShadowBuffer [protected]
 

Definition at line 160 of file OgreMesh.h.

Referenced by clone(), Ogre::PatchMesh::load(), Mesh(), Ogre::PatchMesh::PatchMesh(), Ogre::MeshSerializerImpl::readGeometryPositions(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl_v1::readSubMesh(), Ogre::MeshSerializerImpl::readSubMesh(), and setIndexBufferPolicy().

HardwareBuffer::Usage Ogre::Mesh::mIndexBufferUsage [protected]
 

Definition at line 158 of file OgreMesh.h.

Referenced by clone(), Ogre::PatchMesh::load(), Mesh(), Ogre::PatchMesh::PatchMesh(), Ogre::MeshSerializerImpl_v1::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl_v1::readSubMesh(), Ogre::MeshSerializerImpl::readSubMesh(), and setIndexBufferPolicy().

bool Ogre::Resource::mIsLoaded [protected, inherited]
 

Definition at line 58 of file OgreResource.h.

Referenced by Ogre::D3D9Texture::_initMembers(), Ogre::D3D9Texture::_loadCubeTex(), Ogre::D3D9Texture::_loadNormTex(), Ogre::D3D9Texture::_loadVolumeTex(), Ogre::Material::_notifyNeedsRecompile(), Ogre::Material::clone(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), Ogre::DynLib::DynLib(), Ogre::Zip::load(), Ogre::Skeleton::load(), Ogre::PatchMesh::load(), load(), Ogre::Material::load(), Ogre::HighLevelGpuProgram::load(), Ogre::GpuProgram::load(), Ogre::GLTexture::load(), Ogre::Font::load(), Ogre::DynLib::load(), Ogre::D3D9Texture::load(), Ogre::D3D9GpuProgram::load(), Ogre::D3DTexture::load(), Ogre::BspLevel::load(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), Ogre::Material::Material(), Ogre::Material::operator=(), Ogre::Skeleton::unload(), unload(), Ogre::Material::unload(), Ogre::HighLevelGpuProgram::unload(), Ogre::GLTexture::unload(), Ogre::Font::unload(), Ogre::DynLib::unload(), Ogre::D3D9Texture::unload(), Ogre::D3DTexture::unload(), and Ogre::BspLevel::~BspLevel().

bool Ogre::Mesh::mIsLodManual [protected]
 

Definition at line 152 of file OgreMesh.h.

Referenced by _setLodInfo(), clone(), createManualLodLevel(), generateLodLevels(), getLodLevel(), Mesh(), Ogre::MeshSerializerImpl::readMeshLodInfo(), removeLodLevels(), and updateManualLodLevel().

time_t Ogre::Resource::mLastAccess [protected, inherited]
 

Definition at line 59 of file OgreResource.h.

Referenced by Ogre::Material::operator=().

bool Ogre::Mesh::mManuallyDefined [protected]
 

Definition at line 125 of file OgreMesh.h.

Referenced by load(), Mesh(), and setManuallyDefined().

MeshLodUsageList Ogre::Mesh::mMeshLodUsageList [protected]
 

Definition at line 155 of file OgreMesh.h.

Referenced by _setLodInfo(), _setLodUsage(), clone(), createManualLodLevel(), generateLodLevels(), getLodIndexSquaredDepth(), getLodLevel(), Mesh(), Ogre::MeshSerializerImpl::readMeshLodInfo(), removeLodLevels(), and updateManualLodLevel().

String Ogre::Resource::mName [protected, inherited]
 

Definition at line 56 of file OgreResource.h.

Referenced by Ogre::Skeleton::_dumpContents(), _rationaliseBoneAssignments(), Ogre::BspLevel::BspLevel(), buildTangentVectors(), Ogre::Material::clone(), Ogre::Material::compile(), Ogre::Material::copyDetailsTo(), Ogre::Quake3Shader::createAsMaterial(), Ogre::D3D9HLSLProgram::createLowLevelImpl(), Ogre::CgProgram::createLowLevelImpl(), Ogre::Font::createTextureFromFont(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), Ogre::DynLib::DynLib(), Ogre::Font::Font(), generateLodLevels(), Ogre::Material::getBestTechnique(), Ogre::Overlay::getName(), Ogre::Material::getName(), Ogre::GLTexture::GLTexture(), Ogre::GpuProgram::GpuProgram(), Ogre::Zip::load(), Ogre::Skeleton::load(), load(), Ogre::GLTexture::load(), Ogre::Font::load(), Ogre::DynLib::load(), Ogre::D3DTexture::load(), Ogre::BspLevel::load(), Ogre::D3D9GpuFragmentProgram::loadFromMicrocode(), Ogre::D3D9GpuVertexProgram::loadFromMicrocode(), Ogre::GLArbGpuProgram::loadFromSource(), Ogre::D3D9HLSLProgram::loadFromSource(), Ogre::D3D9GpuProgram::loadFromSource(), Ogre::CgProgram::loadFromSource(), Ogre::GLTexture::loadImages(), Ogre::Material::Material(), Mesh(), Ogre::Material::operator=(), Ogre::Overlay::Overlay(), Ogre::Quake3Shader::Quake3Shader(), Ogre::CgProgram::selectProfile(), setSkeletonName(), Ogre::Skeleton::Skeleton(), Ogre::StringResource::StringResource(), Ogre::Zip::unload(), Ogre::DynLib::unload(), Ogre::CgProgram::unloadImpl(), and Ogre::Zip::Zip().

ushort Ogre::Mesh::mNumLods [protected]
 

Definition at line 153 of file OgreMesh.h.

Referenced by _setLodInfo(), clone(), createManualLodLevel(), generateLodLevels(), getNumLodLevels(), Mesh(), Ogre::MeshSerializerImpl::readMeshLodInfo(), and removeLodLevels().

size_t Ogre::Resource::mSize [protected, inherited]
 

Definition at line 60 of file OgreResource.h.

Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), and Ogre::Material::operator=().

Skeleton* Ogre::Mesh::mSkeleton [protected]
 

Definition at line 133 of file OgreMesh.h.

Referenced by _getBoneMatrices(), _getNumBoneMatrices(), _initAnimationState(), _notifySkeleton(), clone(), getSkeleton(), and setSkeletonName().

String Ogre::Mesh::mSkeletonName [protected]
 

Optional linked skeleton.

Definition at line 132 of file OgreMesh.h.

Referenced by _notifySkeleton(), clone(), getSkeletonName(), hasSkeleton(), and setSkeletonName().

SubMeshList Ogre::Mesh::mSubMeshList [protected]
 

A list of submeshes which make up this mesh.

Each mesh is made up of 1 or more submeshes, which are each based on a single material and can have their own vertex data (they may not - they can share vertex data from the Mesh, depending on preference).

Definition at line 109 of file OgreMesh.h.

Referenced by _initAnimationState(), _setLodInfo(), _setSubMeshLodFaceList(), clone(), createSubMesh(), generateLodLevels(), getNumSubMeshes(), getSubMesh(), removeLodLevels(), and unload().

SubMeshNameMap Ogre::Mesh::mSubMeshNameMap [protected]
 

Definition at line 118 of file OgreMesh.h.

Referenced by _getSubMeshIndex(), clone(), nameSubMesh(), and unload().

bool Ogre::Mesh::mUseSoftwareBlending [protected]
 

Option whether to use software or hardware blending, there are tradeoffs to both.

Definition at line 150 of file OgreMesh.h.

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

bool Ogre::Mesh::mVertexBufferShadowBuffer [protected]
 

Definition at line 159 of file OgreMesh.h.

Referenced by clone(), Ogre::PatchMesh::load(), Mesh(), Ogre::PatchMesh::PatchMesh(), Ogre::MeshSerializerImpl_v1::readGeometry(), Ogre::MeshSerializerImpl::readGeometryColours(), Ogre::MeshSerializerImpl::readGeometryNormals(), Ogre::MeshSerializerImpl::readGeometryTexCoords(), and setVertexBufferPolicy().

HardwareBuffer::Usage Ogre::Mesh::mVertexBufferUsage [protected]
 

Definition at line 157 of file OgreMesh.h.

Referenced by clone(), Ogre::PatchMesh::load(), Mesh(), Ogre::PatchMesh::PatchMesh(), Ogre::MeshSerializerImpl_v1::readGeometry(), Ogre::MeshSerializerImpl::readGeometryColours(), Ogre::MeshSerializerImpl::readGeometryNormals(), Ogre::MeshSerializerImpl::readGeometryPositions(), Ogre::MeshSerializerImpl::readGeometryTexCoords(), and setVertexBufferPolicy().

VertexData* Ogre::Mesh::sharedVertexData
 

Shared vertex data.

Remarks:
This vertex data can be shared among multiple submeshes. SubMeshes may not have their own VertexData, they may share this one.

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

Definition at line 224 of file OgreMesh.h.

Referenced by _compileBoneAssignments(), Ogre::SubMesh::_getRenderOperation(), buildTangentVectors(), Ogre::MeshSerializerImpl::calcMeshSize(), clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::MeshManager::createPrefabPlane(), generateLodLevels(), Mesh(), Ogre::MeshSerializerImpl_v1::readMesh(), Ogre::MeshSerializerImpl::readMesh(), unload(), and Ogre::MeshSerializerImpl::writeMesh().


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

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