OGRE-Next: Ogre::v1::Mesh Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Ogre::v1::Mesh Class Reference
Core » Resources

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

`#include <OgreMesh.h>`

Inheritance diagram for Ogre::v1::Mesh:
[legend]

## Public Types
typedef MapIterator< VertexBoneAssignmentList > | BoneAssignmentIterator
typedef ConstVectorIterator< PoseList > | ConstPoseIterator
typedef FastArray< unsigned short > | IndexMap
typedef FastArray< Real > | LodValueArray
typedef vector< MeshLodUsage >::type | MeshLodUsageList
typedef VectorIterator< PoseList > | PoseIterator
typedef VectorIterator< SubMeshList > | SubMeshIterator
typedef vector< SubMesh * >::type | SubMeshList
typedef unordered_map< String, ushort >::type | SubMeshNameMap
| A hashmap used to store optional SubMesh names.
typedef multimap< size_t, VertexBoneAssignment >::type | VertexBoneAssignmentList
| Multimap of vertex bone assignments (orders by vertex index).
Public Types inherited from Ogre::Resource
enum | LoadingFlags { LF_DEFAULT = 0 , LF_INCLUDE_NON_RELOADABLE = 1 , LF_ONLY_UNREFERENCED = 2 , LF_ONLY_UNREFERENCED_INCLUDE_NON_RELOADABLE = 3 , LF_PRESERVE_STATE = 4 , LF_MARKED_FOR_RELOAD = 8 }
| Enum that allow to choose subset of unloaded/reloaded resources and to adjust reloading behavior. More...
enum | LoadingState { LOADSTATE_UNLOADED , LOADSTATE_LOADING , LOADSTATE_LOADED , LOADSTATE_UNLOADING , LOADSTATE_PREPARED , LOADSTATE_PREPARING , LOADSTATE_UNLOADED_MARKED_FOR_RELOAD }
| Enum identifying the loading state of the resource. More...

## Public Member Functions
| Mesh (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
| Default constructor - used by MeshManager.
| ~Mesh () override
void | _calcBoundsFromVertexBuffer (VertexData *vertexData, AxisAlignedBox &outAABB, Real &outRadius, bool updateOnly=false)
| Calculates.
void | _compileBoneAssignments ()
| Internal method, be called once to compile bone assignments into geometry buffer.
void | _computeBoneBoundingRadius ()
| Compute the bone bounding radius by looking at the vertices, vertex-bone-assignments, and skeleton bind pose.
void | _determineAnimationTypes () const
| Internal method which, if animation types have not been determined, scans any vertex animations and determines the type for each set of vertex data (cannot have 2 different types).
virtual Animation * | _getAnimationImpl (const String &name) const
| Internal access to the named vertex Animation object - returns null if it does not exist.
bool | _getAnimationTypesDirty () const
| Are the derived animation types out of date?
const LodValueArray * | _getLodValueArray () const
unsigned | _getSubMeshIndex (const String &name) const
| Gets the index of a submesh with a given name.
void | _initAnimationState (AnimationStateSet *animSet)
| Initialise an animation set suitable for use with this mesh.
bool | _isManualLodLevel (unsigned short level) const
| Internal methods for loading LOD, do not use.
void | _notifySkeleton (SkeletonPtr &pSkel)
| Internal notification, used to tell the Mesh which Skeleton to use without loading it.
unsigned short | _rationaliseBoneAssignments (size_t vertexCount, VertexBoneAssignmentList &assignments)
| Rationalises the passed in bone assignment list.
void | _refreshAnimationState (AnimationStateSet *animSet)
| Refresh an animation set suitable for use with this mesh.
void | _setBoneBoundingRadius (Real radius)
| Manually set the bone bounding radius.
void | _setBoundingSphereRadius (Real radius)
| Manually set the bounding radius.
void | _setBounds (const AxisAlignedBox &bounds, bool pad=true)
| Manually set the bounding box for this Mesh.
void | _setLodInfo (unsigned short numLevels)
| Internal methods for loading LOD, do not use.
void | _setLodUsage (unsigned short level, const MeshLodUsage &usage)
| Internal methods for loading LOD, do not use.
void | _setSubMeshLodFaceList (unsigned subIdx, unsigned short level, IndexData *facedata, bool casterPass)
| Internal methods for loading LOD, do not use.
void | _updateBoundsFromVertexBuffers (bool pad=false)
| Automatically update the bounding radius and bounding box for this Mesh.
void | _updateCompiledBoneAssignments ()
| Internal method, be called once to update the compiled bone assignments.
void | addBoneAssignment (const VertexBoneAssignment &vertBoneAssign)
| Assigns a vertex to a bone with a given weight, for skeletal animation.
void | arrangeEfficient (bool halfPos, bool halfTexCoords, bool qTangents)
| Rearranges the buffers in this Mesh so that they are more efficient for rendering with shaders.
void | buildEdgeList ()
| Builds an edge list for this mesh, which can be used for generating a shadow volume among other things.
void | buildTangentVectors (VertexElementSemantic targetSemantic=VES_TANGENT, unsigned short sourceTexCoordSet=0, unsigned short index=0, bool splitMirrored=false, bool splitRotated=false, bool storeParityInW=false)
| This method builds a set of tangent vectors for a given mesh into a 3D texture coordinate buffer.
void | clearBoneAssignments ()
| Removes all bone assignments for this mesh.
MeshPtr | clone (const String &newName, const String &newGroup=BLANKSTRING)
| Makes a copy of this mesh object and gives it a new name.
Animation * | createAnimation (const String &name, Real length) override
| Creates a new Animation object for vertex animating this mesh.
void | createAzdoBuffers ()
Pose * | createPose (ushort target, const String &name=BLANKSTRING)
| Create a new Pose for this mesh or one of its submeshes.
SubMesh * | createSubMesh ()
| Creates a new SubMesh.
SubMesh * | createSubMesh (const String &name)
| Creates a new SubMesh and gives it a name.
void | dearrangeToInefficient ()
| Reverts the effects from arrangeEfficient by converting all 16-bit half float back to 32-bit float; and QTangents to Normal, Tangent + Reflection representation, which are more compatible for doing certain operations vertex operations in the CPU.
void | destroyShadowMappingGeom ()
void | destroySubMesh (const String &name)
| Destroy a SubMesh with the given name.
void | destroySubMesh (unsigned index)
| Destroy a SubMesh with the given index.
void | freeEdgeList ()
| Destroys and frees the edge lists this mesh has built.
Animation * | getAnimation (const String &name) const override
| Returns the named vertex Animation object.
Animation * | getAnimation (unsigned short index) const override
| Gets a single morph animation by index.
bool | getAutoBuildEdgeLists () const
| Sets whether or not this Mesh should automatically build edge lists when asked for them, or whether it should never build them if they are not already provided.
BoneAssignmentIterator | getBoneAssignmentIterator ()
| Gets an iterator for access all bone assignments.
const VertexBoneAssignmentList & | getBoneAssignments () const
| Gets a const reference to the list of bone assignments.
Real | getBoneBoundingRadius () const
| Gets the radius used to inflate the bounding box around the bones.
Real | getBoundingSphereRadius () const
| Gets the radius of the bounding sphere surrounding this mesh.
const AxisAlignedBox & | getBounds () const
| Get the axis-aligned bounding box for this mesh.
EdgeData * | getEdgeList (unsigned short lodIndex=0)
| Return the edge list for this mesh, building it if required.
const EdgeData * | getEdgeList (unsigned short lodIndex=0) const
| Return the edge list for this mesh, building it if required.
HardwareBufferManagerBase * | getHardwareBufferManager ()
const uint64 * | getHashForCaches () const
| Returns an array of [2] containing a hash for use in caches.
HardwareBuffer::Usage | getIndexBufferUsage () const
| Gets the usage setting for this meshes index buffers.
ushort | getLodIndex (Real value) const
| Retrieves the level of detail index for the given LOD value.
const MeshLodUsage & | getLodLevel (ushort index) const
| Gets details of the numbered level of detail entry.
const String & | getLodStrategyName () const
| Returns the name of the Lod strategy the user lod values have been calibrated for.
unsigned short | getNumAnimations () const override
| Gets the number of morph animations in this mesh.
ushort | getNumLodLevels () const
| Returns the number of levels of detail that this mesh supports.
unsigned | getNumSubMeshes () const
| Gets the number of sub meshes which comprise this mesh.
const SkeletonPtr & | getOldSkeleton () const
| Gets a pointer to any linked Skeleton.
Pose * | getPose (const String &name)
| Retrieve an existing Pose by name.
Pose * | getPose (ushort index)
| Retrieve an existing Pose by index.
size_t | getPoseCount () const
| Get the number of poses.
PoseIterator | getPoseIterator ()
| Get an iterator over all the poses defined.
ConstPoseIterator | getPoseIterator () const
| Get an iterator over all the poses defined.
const PoseList & | getPoseList () const
| Get pose list.
bool | getSharedVertexDataAnimationIncludesNormals () const
| Returns whether animation on shared vertex data includes normals.
virtual VertexAnimationType | getSharedVertexDataAnimationType () const
| Gets the type of vertex animation the shared vertex data of this mesh supports.
const SkeletonDefPtr & | getSkeleton () const
const String & | getSkeletonName () const
| Gets the name of any linked Skeleton.
SubMesh * | getSubMesh (const String &name) const
| Gets a SubMesh by name.
SubMesh * | getSubMesh (unsigned index) const
| Gets a pointer to the submesh indicated by the index.
SubMeshIterator | getSubMeshIterator ()
| Gets an iterator over the available submeshes.
const SubMeshNameMap & | getSubMeshNameMap () const
| Gets a reference to the optional name assignments of the SubMeshes.
HardwareBuffer::Usage | getVertexBufferUsage () const
| Gets the usage setting for this meshes vertex buffers.
VertexData * | getVertexDataByTrackHandle (unsigned short handle)
| Gets a pointer to a vertex data element based on a morph animation track handle.
bool | hasAnimation (const String &name) const override
| Returns whether this mesh contains the named vertex animation.
bool | hasIndependentShadowMappingBuffers () const
| Returns true if the shadow mapping buffers do not just reference the real buffers, but are rather their own separate set of optimized geometry.
bool | hasManualLodLevel () const
| Returns true if this mesh has a manual LOD level.
bool | hasSkeleton () const
| Returns true if this Mesh has a linked Skeleton.
bool | hasValidShadowMappingBuffers () const
| Returns true if the mesh is ready for rendering with valid shadow mapping buffers Otherwise prepareForShadowMapping must be called on this mesh.
bool | hasVertexAnimation () const
| Returns whether or not this mesh has some kind of vertex animation.
void | importV2 (Ogre::Mesh *mesh)
| Converts a v2 mesh back to v1.
bool | isEdgeListBuilt () const
| Returns whether this mesh has an attached edge list.
bool | isIndexBufferShadowed () const
| Gets whether or not this meshes index buffers are shadowed.
bool | isPreparedForShadowVolumes () const
| Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes.
bool | isVertexBufferShadowed () const
| Gets whether or not this meshes vertex buffers are shadowed.
void | mergeAdjacentTexcoords (unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy)
| This method collapses two texcoords into one for all submeshes where this is possible.
void | nameSubMesh (const String &name, unsigned index)
| Gives a name to a SubMesh.
void | prepareForShadowMapping (bool forceSameBuffers)
void | prepareForShadowVolume ()
| This method prepares the mesh for generating a renderable shadow volume.
void | reload (LoadingFlags flags=LF_DEFAULT) override
| Reloads the resource, if it is already loaded.
virtual void | removeAllAnimations ()
| Removes all morph Animations from this mesh.
void | removeAllPoses ()
| Destroy all poses.
void | removeAnimation (const String &name) override
| Removes vertex Animation from this mesh.
void | removeLodLevels ()
| Removes all LOD data from this Mesh.
void | removePose (const String &name)
| Destroy a pose by name.
void | removePose (ushort index)
| Destroy a pose by index.
void | setAutoBuildEdgeLists (bool autobuild)
| Sets whether or not this Mesh should automatically build edge lists when asked for them, or whether it should never build them if they are not already provided.
void | setHardwareBufferManager (HardwareBufferManagerBase *bufferManager)
| Sets the manager for the vertex and index 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.
void | setLodStrategyName (const String &name)
void | setSkeletonName (const String &skelName)
| Sets the name of the skeleton this Mesh uses for animation.
void | setVertexBufferPolicy (HardwareBuffer::Usage usage, bool shadowBuffer=false)
| Sets the policy for the vertex buffers to be used when loading this Mesh.
bool | suggestTangentVectorBuildParams (VertexElementSemantic targetSemantic, unsigned short &outSourceCoordSet, unsigned short &outIndex)
| Ask the mesh to suggest parameters to a future buildTangentVectors call, should you wish to use texture coordinates to store the tangents.
void | unnameSubMesh (const String &name)
| Removes a name from a SubMesh.
void | updateManualLodLevel (ushort index, const String &meshName)
| Changes the alternate mesh to use as a manual LOD at the given index.
void | updateMaterialForAllSubMeshes ()
| Iterates through all submeshes and requests them to apply their texture aliases to the material they use.
Public Member Functions inherited from Ogre::Resource
| Resource (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
| Standard constructor.
virtual | ~Resource ()
| Virtual destructor.
virtual void | _dirtyState ()
| Manually mark the state of this resource as having been changed.
virtual void | _fireLoadingComplete (bool wasBackgroundLoaded)
| Firing of loading complete event.
virtual void | _firePreparingComplete (bool wasBackgroundLoaded)
| Firing of preparing complete event.
virtual void | _fireUnloadingComplete ()
| Firing of unloading complete event.
virtual void | _notifyOrigin (const String &origin)
| Notify this resource of it's origin.
virtual void | addListener (Listener *lis)
| Register a listener on this resource.
virtual void | changeGroupOwnership (const String &newGroup)
| Change the resource group ownership of a Resource.
virtual void | escalateLoading ()
| Escalates the loading of a background loaded resource.
virtual ResourceManager * | getCreator ()
| Gets the manager which created this resource.
virtual const String & | getGroup () const
| Gets the group which this resource is a member of.
virtual ResourceHandle | getHandle () const
virtual LoadingState | getLoadingState () const
| Returns the current loading state.
virtual const String & | getName () const
| Gets resource name.
virtual const String & | getOrigin () const
| Get the origin of this resource, e.g.
virtual size_t | getSize () const
| Retrieves info about the size of the resource.
virtual size_t | getStateCount () const
| Returns the number of times this resource has changed state, which generally means the number of times it has been loaded.
virtual bool | isBackgroundLoaded () const
| Returns whether this Resource has been earmarked for background loading.
virtual bool | isLoaded () const
| Returns true if the Resource has been loaded, false otherwise.
virtual bool | isLoading () const
| Returns whether the resource is currently in the process of background loading.
virtual bool | isManuallyLoaded () const
| Is this resource manually loaded?
virtual bool | isPrepared () const
| Returns true if the Resource has been prepared, false otherwise.
virtual bool | isReloadable () const
| Returns true if the Resource is reloadable, false otherwise.
virtual void | load (bool backgroundThread=false)
| Loads the resource, if it is not already.
bool | markForReload ()
virtual void | prepare (bool backgroundThread=false)
| Prepares the resource for load, if it is not already.
virtual void | removeListener (Listener *lis)
| Remove a listener on this resource.
virtual void | setBackgroundLoaded (bool bl)
| Tells the resource whether it is background loaded or not.
virtual void | setManuallyLoaded (bool isManual)
| Set "Is this resource manually loaded?".
virtual void | setToLoaded ()
| Change the Resource loading state to loaded.
virtual void | touch ()
| 'Touches' the resource to indicate it has been used.
virtual void | unload ()
| Unloads the resource; this is not permanent, the resource can be reloaded later if required.
Public Member Functions inherited from Ogre::StringInterface
| StringInterface ()
virtual | ~StringInterface ()
| Virtual destructor, see Effective C++.
virtual void | copyParametersTo (StringInterface *dest) const
| Method for copying this object's parameters to another object.
ParamDictionary * | getParamDictionary ()
| Retrieves the parameter dictionary for this class.
const ParamDictionary * | getParamDictionary () const
virtual String | getParameter (const String &name) const
| Generic parameter retrieval method.
const ParameterList & | getParameters () const
| Retrieves a list of parameters valid for this object.
virtual bool | setParameter (const String &name, const String &value)
| Generic parameter setting method.
virtual void | setParameterList (const NameValuePairList &paramList)
| Generic multiple parameter setting method.
Public Member Functions inherited from Ogre::v1::AnimationContainer
virtual | ~AnimationContainer ()

## Static Public Member Functions
static void | prepareMatricesForVertexBlend (const Matrix4 **blendMatrices, const Matrix4 *boneMatrices, const IndexMap &indexMap)
| Prepare matrices for software indexed vertex blend.
static void | softwareVertexBlend (const VertexData *sourceVertexData, const VertexData *targetVertexData, const Matrix4 *const *blendMatrices, size_t numMatrices, bool blendNormals)
| Performs a software indexed vertex blend, of the kind used for skeletal animation although it can be used for other purposes.
static void | softwareVertexMorph (Real t, const HardwareVertexBufferSharedPtr &b1, const HardwareVertexBufferSharedPtr &b2, VertexData *targetVertexData)
| Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes.
static void | softwareVertexPoseBlend (Real weight, const map< size_t, Vector3 >::type &vertexOffsetMap, const map< size_t, Vector3 >::type &normalsMap, VertexData *targetVertexData)
| Performs a software vertex pose blend, of the kind used for morph animation although it can be used for other purposes.
Static Public Member Functions inherited from Ogre::StringInterface
static void | cleanupDictionary ()
| Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g.

## Public Attributes
IndexMap | sharedBlendIndexToBoneIndexMap
| Shared index map for translating blend index to bone index.
VertexData * | sharedVertexData [NumVertexPass]
| Shared vertex data.
Public Attributes inherited from Ogre::Resource
| OGRE_AUTO_MUTEX

## Static Public Attributes
static bool | msOptimizeForShadowMapping
| When this bool is false, prepareForShadowMapping will use the same Vaos for both regular and shadow mapping rendering.

## 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 construct, 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.

## Member Typedef Documentation

## ◆ BoneAssignmentIterator

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

## ◆ ConstPoseIterator

typedef ConstVectorIterator<PoseList> Ogre::v1::Mesh::ConstPoseIterator

## ◆ IndexMap

typedef FastArray<unsigned short> Ogre::v1::Mesh::IndexMap

## ◆ LodValueArray

typedef FastArray<Real> Ogre::v1::Mesh::LodValueArray

## ◆ MeshLodUsageList

typedef vector<MeshLodUsage>::type Ogre::v1::Mesh::MeshLodUsageList

## ◆ PoseIterator

typedef VectorIterator<PoseList> Ogre::v1::Mesh::PoseIterator

## ◆ SubMeshIterator

typedef VectorIterator<SubMeshList> Ogre::v1::Mesh::SubMeshIterator

## ◆ SubMeshList

typedef vector<SubMesh*>::type Ogre::v1::Mesh::SubMeshList

## ◆ SubMeshNameMap

typedef unordered_map<String,ushort>::type Ogre::v1::Mesh::SubMeshNameMap

A hashmap used to store optional SubMesh names.

Translates a name into SubMesh index.

## ◆ VertexBoneAssignmentList

typedef multimap<size_t,VertexBoneAssignment>::type Ogre::v1::Mesh::VertexBoneAssignmentList

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

## Constructor & Destructor Documentation

## ◆ Mesh()

Ogre::v1::Mesh::Mesh | ( | ResourceManager * | creator,
|  | const String & | name,
|  | ResourceHandle | handle,
|  | const String & | group,
|  | bool | isManual = false,
|  | ManualResourceLoader * | loader = 0 )

Default constructor - used by MeshManager.

Warning
  Do not call this method directly.

## ◆ ~Mesh()

Ogre::v1::Mesh::~Mesh | ( |  | ) |
| override

## Member Function Documentation

## ◆ _calcBoundsFromVertexBuffer()

void Ogre::v1::Mesh::_calcBoundsFromVertexBuffer | ( | VertexData * | vertexData,
|  | AxisAlignedBox & | outAABB,
|  | Real & | outRadius,
|  | bool | updateOnly = false )

Calculates.

Remarks
  Calling this method is required when building manual meshes. However it is recommended to use _setBounds and _setBoundingSphereRadius instead, because the vertex buffer may not have a shadow copy in the memory. Reading back the buffer from video memory is very slow!

## ◆ _compileBoneAssignments()

void Ogre::v1::Mesh::_compileBoneAssignments | ( |  | ) |

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.

## ◆ _computeBoneBoundingRadius()

void Ogre::v1::Mesh::_computeBoneBoundingRadius | ( |  | ) |

Compute the bone bounding radius by looking at the vertices, vertex-bone-assignments, and skeleton bind pose.

Remarks
  This is automatically called by Entity if necessary. Only does something if the boneBoundingRadius is zero to begin with. Only works if vertex data is readable (i.e. not WRITE_ONLY).

## ◆ _determineAnimationTypes()

void Ogre::v1::Mesh::_determineAnimationTypes | ( |  | ) | const

Internal method which, if animation types have not been determined, scans any vertex animations and determines the type for each set of vertex data (cannot have 2 different types).

## ◆ _getAnimationImpl()

virtual Animation * Ogre::v1::Mesh::_getAnimationImpl | ( | const String & | name | ) | const
| virtual

Internal access to the named vertex Animation object - returns null if it does not exist.

Parameters

  name | The name of the animation.

## ◆ _getAnimationTypesDirty()

bool Ogre::v1::Mesh::_getAnimationTypesDirty | ( |  | ) | const
| inline

Are the derived animation types out of date?

## ◆ _getLodValueArray()

const LodValueArray * Ogre::v1::Mesh::_getLodValueArray | ( |  | ) | const
| inline

## ◆ _getSubMeshIndex()

unsigned Ogre::v1::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.

## ◆ _initAnimationState()

void Ogre::v1::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.

## ◆ _isManualLodLevel()

bool Ogre::v1::Mesh::_isManualLodLevel | ( | unsigned short | level | ) | const

Internal methods for loading LOD, do not use.

## ◆ _notifySkeleton()

void Ogre::v1::Mesh::_notifySkeleton | ( | SkeletonPtr & | 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.

## ◆ _rationaliseBoneAssignments()

unsigned short Ogre::v1::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]

## ◆ _refreshAnimationState()

void Ogre::v1::Mesh::_refreshAnimationState | ( | AnimationStateSet * | animSet | ) |

Refresh an animation set suitable for use with this mesh.

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

## ◆ _setBoneBoundingRadius()

void Ogre::v1::Mesh::_setBoneBoundingRadius | ( | Real | radius | ) |

Manually set the bone bounding radius.

Remarks
  This value is normally computed automatically, however it can be overriden with this method.

## ◆ _setBoundingSphereRadius()

void Ogre::v1::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).

## ◆ _setBounds()

void Ogre::v1::Mesh::_setBounds | ( | const AxisAlignedBox & | bounds,
|  | bool | pad = true )

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).

Parameters

  pad | If true, a certain padding will be added to the bounding box to separate it from the mesh

## ◆ _setLodInfo()

void Ogre::v1::Mesh::_setLodInfo | ( | unsigned short | numLevels | ) |

Internal methods for loading LOD, do not use.

## ◆ _setLodUsage()

void Ogre::v1::Mesh::_setLodUsage | ( | unsigned short | level,
|  | const MeshLodUsage & | usage )

Internal methods for loading LOD, do not use.

## ◆ _setSubMeshLodFaceList()

void Ogre::v1::Mesh::_setSubMeshLodFaceList | ( | unsigned | subIdx,
|  | unsigned short | level,
|  | IndexData * | facedata,
|  | bool | casterPass )

Internal methods for loading LOD, do not use.

## ◆ _updateBoundsFromVertexBuffers()

void Ogre::v1::Mesh::_updateBoundsFromVertexBuffers | ( | bool | pad = false | ) |

Automatically update the bounding radius and bounding box for this Mesh.

Remarks
  Calling this method is required when building manual meshes. However it is recommended to use _setBounds and _setBoundingSphereRadius instead, because the vertex buffer may not have a shadow copy in the memory. Reading back the buffer from video memory is very slow!

Parameters

  pad | If true, a certain padding will be added to the bounding box to separate it from the mesh

## ◆ _updateCompiledBoneAssignments()

void Ogre::v1::Mesh::_updateCompiledBoneAssignments | ( |  | ) |

Internal method, be called once to update the compiled bone assignments.

Remarks
  The OGRE engine calls this method automatically. It updates the compiled bone assignments if requested.

## ◆ addBoneAssignment()

void Ogre::v1::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.

## ◆ arrangeEfficient()

void Ogre::v1::Mesh::arrangeEfficient | ( | bool | halfPos,
|  | bool | halfTexCoords,
|  | bool | qTangents )

Rearranges the buffers in this Mesh so that they are more efficient for rendering with shaders.

It's not recommended to use this option if you plan on using SW skinning or pose/morph animations.

Remarks
  Multiple buffer streams will be merged into one, making an interleaved format. Shared vertices with submeshes will be unshared.

Parameters

  halfPos | True if you want to convert the position data to VET_HALF4 format. Recommended on desktop to reduce memory and bandwidth requirements. Rarely the extra precision is needed.

Unfortuntately on mobile, not all ES2 devices support VET_HALF4. Do NOT use this flag if you intend to run the mesh in GLES2 devices which don't have the GL_OES_VERTEX_HALF_FLOAT extension (many iOS, some Android).

Parameters

  halfTexCoords | True if you want to convert the position data to VET_HALF2 or VET_HALF4 format. Same recommendations as halfPos.
  qTangents | True if you want to generate tangent and reflection information (modifying the original v1 mesh) and convert this data to a QTangent, requiring VET_SHORT4_SNORM (8 bytes vs 28 bytes to store normals, tangents and reflection). Needs much less space, trading for more ALU ops in the vertex shader for decoding the QTangent. Highly recommended on both desktop and mobile if you need tangents (i.e. normal mapping).

## ◆ buildEdgeList()

void Ogre::v1::Mesh::buildEdgeList | ( |  | ) |

Builds an edge list for this mesh, which can be used for generating a shadow volume among other things.

## ◆ buildTangentVectors()

void Ogre::v1::Mesh::buildTangentVectors | ( | VertexElementSemantic | targetSemantic = VES_TANGENT,
|  | unsigned short | sourceTexCoordSet = 0,
|  | unsigned short | index = 0,
|  | bool | splitMirrored = false,
|  | bool | splitRotated = false,
|  | bool | storeParityInW = false )

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

  targetSemantic | The semantic to store the tangents in. Defaults to the explicit tangent binding, but note that this is only usable on more modern hardware (Shader Model 2), so if you need portability with older cards you should change this to a texture coordinate binding instead.
  sourceTexCoordSet | The texture coordinate index which should be used as the source of 2D texture coordinates, with which to calculate the tangents.
  index | The element index, ie the texture coordinate set which should be used to store the 3D coordinates representing a tangent vector per vertex, if targetSemantic is VES_TEXTURE_COORDINATES. If this already exists, it will be overwritten.
  splitMirrored | Sets whether or not to split vertices when a mirrored tangent space transition is detected (matrix parity differs).

See also
  TangentSpaceCalc::setSplitMirrored

Parameters

  splitRotated | Sets whether or not to split vertices when a rotated tangent space is detected.

See also
  TangentSpaceCalc::setSplitRotated

Parameters

  storeParityInW | If `true`, store tangents as a 4-vector and include parity in w.

References Ogre::VES_TANGENT.

## ◆ clearBoneAssignments()

void Ogre::v1::Mesh::clearBoneAssignments | ( |  | ) |

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.

## ◆ clone()

MeshPtr Ogre::v1::Mesh::clone | ( | const String & | newName,
|  | const String & | newGroup = BLANKSTRING )

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.

Parameters

  newName | The name to give the clone.
  newGroup | Optional name of the new group to assign the clone to; if you leave this blank, the clone will be assigned to the same group as this Mesh.

References Ogre::BLANKSTRING.

## ◆ createAnimation()

Animation * Ogre::v1::Mesh::createAnimation | ( | const String & | name,
|  | Real | length )
| overridevirtual

Creates a new Animation object for vertex animating this mesh.

Parameters

  name | The name of this animation.
  length | The length of the animation in seconds.

Implements Ogre::v1::AnimationContainer.

## ◆ createAzdoBuffers()

void Ogre::v1::Mesh::createAzdoBuffers | ( |  | ) |

## ◆ createPose()

Pose * Ogre::v1::Mesh::createPose | ( | ushort | target,
|  | const String & | name = BLANKSTRING )

Create a new Pose for this mesh or one of its submeshes.

Parameters

  target | The target geometry index; 0 is the shared Mesh geometry, 1+ is the dedicated SubMesh geometry belonging to submesh index + 1.
  name | Name to give the pose, which is optional.

Returns
  A new Pose ready for population.

References Ogre::BLANKSTRING.

## ◆ createSubMesh() [1/2]

SubMesh * Ogre::v1::Mesh::createSubMesh | ( |  | ) |

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.

References SubMesh.

## ◆ createSubMesh() [2/2]

SubMesh * Ogre::v1::Mesh::createSubMesh | ( | const String & | name | ) |

Creates a new SubMesh and gives it a name.

Note, only first 65536 submeshes could be named.

References SubMesh.

## ◆ dearrangeToInefficient()

void Ogre::v1::Mesh::dearrangeToInefficient | ( |  | ) |

Reverts the effects from arrangeEfficient by converting all 16-bit half float back to 32-bit float; and QTangents to Normal, Tangent + Reflection representation, which are more compatible for doing certain operations vertex operations in the CPU.

## ◆ destroyShadowMappingGeom()

void Ogre::v1::Mesh::destroyShadowMappingGeom | ( |  | ) |

## ◆ destroySubMesh() [1/2]

void Ogre::v1::Mesh::destroySubMesh | ( | const String & | name | ) |

Destroy a SubMesh with the given name.

Note
  This will invalidate the contents of any existing Entity, or any other object that is referring to the SubMesh list. Entity will detect this and reinitialise, but it is still a disruptive action.

## ◆ destroySubMesh() [2/2]

void Ogre::v1::Mesh::destroySubMesh | ( | unsigned | index | ) |

Destroy a SubMesh with the given index.

Note
  This will invalidate the contents of any existing Entity, or any other object that is referring to the SubMesh list. Entity will detect this and reinitialise, but it is still a disruptive action.

## ◆ freeEdgeList()

void Ogre::v1::Mesh::freeEdgeList | ( |  | ) |

Destroys and frees the edge lists this mesh has built.

## ◆ getAnimation() [1/2]

Animation * Ogre::v1::Mesh::getAnimation | ( | const String & | name | ) | const
| overridevirtual

Returns the named vertex Animation object.

Parameters

  name | The name of the animation.

Implements Ogre::v1::AnimationContainer.

## ◆ getAnimation() [2/2]

Animation * Ogre::v1::Mesh::getAnimation | ( | unsigned short | index | ) | const
| overridevirtual

Gets a single morph animation by index.

Implements Ogre::v1::AnimationContainer.

## ◆ getAutoBuildEdgeLists()

bool Ogre::v1::Mesh::getAutoBuildEdgeLists | ( |  | ) | const
| inline

Sets whether or not this Mesh should automatically build edge lists when asked for them, or whether it should never build them if they are not already provided.

## ◆ getBoneAssignmentIterator()

BoneAssignmentIterator Ogre::v1::Mesh::getBoneAssignmentIterator | ( |  | ) |

Gets an iterator for access all bone assignments.

## ◆ getBoneAssignments()

const VertexBoneAssignmentList & Ogre::v1::Mesh::getBoneAssignments | ( |  | ) | const
| inline

Gets a const reference to the list of bone assignments.

Referenced by Ogre::VerticesRemapInfo::performBoneAssignmentRemap().

## ◆ getBoneBoundingRadius()

Real Ogre::v1::Mesh::getBoneBoundingRadius | ( |  | ) | const

Gets the radius used to inflate the bounding box around the bones.

## ◆ getBoundingSphereRadius()

Real Ogre::v1::Mesh::getBoundingSphereRadius | ( |  | ) | const

Gets the radius of the bounding sphere surrounding this mesh.

## ◆ getBounds()

const AxisAlignedBox & Ogre::v1::Mesh::getBounds | ( |  | ) | const

Get the axis-aligned bounding box for this mesh.

## ◆ getEdgeList() [1/2]

EdgeData * Ogre::v1::Mesh::getEdgeList | ( | unsigned short | lodIndex = 0 | ) |

Return the edge list for this mesh, building it if required.

Remarks
  You must ensure that the Mesh as been prepared for shadow volume rendering if you intend to use this information for that purpose.

Parameters

  lodIndex | The LOD at which to get the edge list, 0 being the highest.

## ◆ getEdgeList() [2/2]

const EdgeData * Ogre::v1::Mesh::getEdgeList | ( | unsigned short | lodIndex = 0 | ) | const

Return the edge list for this mesh, building it if required.

Remarks
  You must ensure that the Mesh as been prepared for shadow volume rendering if you intend to use this information for that purpose.

Parameters

  lodIndex | The LOD at which to get the edge list, 0 being the highest.

## ◆ getHardwareBufferManager()

HardwareBufferManagerBase * Ogre::v1::Mesh::getHardwareBufferManager | ( |  | ) |

## ◆ getHashForCaches()

const uint64 * Ogre::v1::Mesh::getHashForCaches | ( |  | ) | const
| inline

Returns an array of [2] containing a hash for use in caches.

A value of { 0, 0 } should be treated as not initialized.

How this cache is calculated is unknown and could just be a filesystem timestamp rather than a checksum.

When callers see that: getCacheHash()[i] != savedHash[i]

they should treat as if the mesh has changed and the cache entry became stale

## ◆ getIndexBufferUsage()

HardwareBuffer::Usage Ogre::v1::Mesh::getIndexBufferUsage | ( |  | ) | const
| inline

Gets the usage setting for this meshes index buffers.

## ◆ getLodIndex()

ushort Ogre::v1::Mesh::getLodIndex | ( | Real | value | ) | const

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

Note
  The value passed in is the 'transformed' value. If you are dealing with an original source value (e.g. distance), use LodStrategy::transformUserValue to turn this into a lookup value.

## ◆ getLodLevel()

const MeshLodUsage & Ogre::v1::Mesh::getLodLevel | ( | ushort | index | ) | const

Gets details of the numbered level of detail entry.

## ◆ getLodStrategyName()

const String & Ogre::v1::Mesh::getLodStrategyName | ( |  | ) | const
| inline

Returns the name of the Lod strategy the user lod values have been calibrated for.

## ◆ getNumAnimations()

unsigned short Ogre::v1::Mesh::getNumAnimations | ( |  | ) | const
| overridevirtual

Gets the number of morph animations in this mesh.

Implements Ogre::v1::AnimationContainer.

## ◆ getNumLodLevels()

ushort Ogre::v1::Mesh::getNumLodLevels | ( |  | ) | const

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

Remarks
  This number includes the original model.

## ◆ getNumSubMeshes()

unsigned Ogre::v1::Mesh::getNumSubMeshes | ( |  | ) | const

Gets the number of sub meshes which comprise this mesh.

## ◆ getOldSkeleton()

const SkeletonPtr & Ogre::v1::Mesh::getOldSkeleton | ( |  | ) | const

Gets a pointer to any linked Skeleton.

Returns
  Weak reference to the skeleton - copy this if you want to hold a strong pointer.

## ◆ getPose() [1/2]

Pose * Ogre::v1::Mesh::getPose | ( | const String & | name | ) |

Retrieve an existing Pose by name.

## ◆ getPose() [2/2]

Pose * Ogre::v1::Mesh::getPose | ( | ushort | index | ) |

Retrieve an existing Pose by index.

## ◆ getPoseCount()

size_t Ogre::v1::Mesh::getPoseCount | ( |  | ) | const
| inline

Get the number of poses.

## ◆ getPoseIterator() [1/2]

PoseIterator Ogre::v1::Mesh::getPoseIterator | ( |  | ) |

Get an iterator over all the poses defined.

## ◆ getPoseIterator() [2/2]

ConstPoseIterator Ogre::v1::Mesh::getPoseIterator | ( |  | ) | const

Get an iterator over all the poses defined.

## ◆ getPoseList()

const PoseList & Ogre::v1::Mesh::getPoseList | ( |  | ) | const

Get pose list.

## ◆ getSharedVertexDataAnimationIncludesNormals()

bool Ogre::v1::Mesh::getSharedVertexDataAnimationIncludesNormals | ( |  | ) | const
| inline

Returns whether animation on shared vertex data includes normals.

## ◆ getSharedVertexDataAnimationType()

virtual VertexAnimationType Ogre::v1::Mesh::getSharedVertexDataAnimationType | ( |  | ) | const
| virtual

Gets the type of vertex animation the shared vertex data of this mesh supports.

## ◆ getSkeleton()

const SkeletonDefPtr & Ogre::v1::Mesh::getSkeleton | ( |  | ) | const
| inline

## ◆ getSkeletonName()

const String & Ogre::v1::Mesh::getSkeletonName | ( |  | ) | const

Gets the name of any linked Skeleton.

## ◆ getSubMesh() [1/2]

SubMesh * Ogre::v1::Mesh::getSubMesh | ( | const String & | name | ) | const

Gets a SubMesh by name.

References SubMesh.

## ◆ getSubMesh() [2/2]

SubMesh * Ogre::v1::Mesh::getSubMesh | ( | unsigned | index | ) | const

Gets a pointer to the submesh indicated by the index.

References SubMesh.

## ◆ getSubMeshIterator()

SubMeshIterator Ogre::v1::Mesh::getSubMeshIterator | ( |  | ) |
| inline

Gets an iterator over the available submeshes.

## ◆ getSubMeshNameMap()

const SubMeshNameMap & Ogre::v1::Mesh::getSubMeshNameMap | ( |  | ) | const
| inline

Gets a reference to the optional name assignments of the SubMeshes.

## ◆ getVertexBufferUsage()

HardwareBuffer::Usage Ogre::v1::Mesh::getVertexBufferUsage | ( |  | ) | const
| inline

Gets the usage setting for this meshes vertex buffers.

## ◆ getVertexDataByTrackHandle()

VertexData * Ogre::v1::Mesh::getVertexDataByTrackHandle | ( | unsigned short | handle | ) |

Gets a pointer to a vertex data element based on a morph animation track handle.

Remarks
  0 means the shared vertex data, 1+ means a submesh vertex data (index+1)

## ◆ hasAnimation()

bool Ogre::v1::Mesh::hasAnimation | ( | const String & | name | ) | const
| overridevirtual

Returns whether this mesh contains the named vertex animation.

Implements Ogre::v1::AnimationContainer.

## ◆ hasIndependentShadowMappingBuffers()

bool Ogre::v1::Mesh::hasIndependentShadowMappingBuffers | ( |  | ) | const

Returns true if the shadow mapping buffers do not just reference the real buffers, but are rather their own separate set of optimized geometry.

## ◆ hasManualLodLevel()

bool Ogre::v1::Mesh::hasManualLodLevel | ( |  | ) | const
| inline

Returns true if this mesh has a manual LOD level.

Remarks
  A mesh can either use automatically generated LOD, or it can use alternative meshes as provided by an artist.

## ◆ hasSkeleton()

bool Ogre::v1::Mesh::hasSkeleton | ( |  | ) | const

Returns true if this Mesh has a linked Skeleton.

## ◆ hasValidShadowMappingBuffers()

bool Ogre::v1::Mesh::hasValidShadowMappingBuffers | ( |  | ) | const

Returns true if the mesh is ready for rendering with valid shadow mapping buffers Otherwise prepareForShadowMapping must be called on this mesh.

## ◆ hasVertexAnimation()

bool Ogre::v1::Mesh::hasVertexAnimation | ( |  | ) | const

Returns whether or not this mesh has some kind of vertex animation.

## ◆ importV2()

void Ogre::v1::Mesh::importV2 | ( | Ogre::Mesh * | mesh | ) |

Converts a v2 mesh back to v1.

## ◆ isEdgeListBuilt()

bool Ogre::v1::Mesh::isEdgeListBuilt | ( |  | ) | const
| inline

Returns whether this mesh has an attached edge list.

## ◆ isIndexBufferShadowed()

bool Ogre::v1::Mesh::isIndexBufferShadowed | ( |  | ) | const
| inline

Gets whether or not this meshes index buffers are shadowed.

## ◆ isPreparedForShadowVolumes()

bool Ogre::v1::Mesh::isPreparedForShadowVolumes | ( |  | ) | const
| inline

Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes.

## ◆ isVertexBufferShadowed()

bool Ogre::v1::Mesh::isVertexBufferShadowed | ( |  | ) | const
| inline

Gets whether or not this meshes vertex buffers are shadowed.

## ◆ mergeAdjacentTexcoords()

void Ogre::v1::Mesh::mergeAdjacentTexcoords | ( | unsigned short | finalTexCoordSet,
|  | unsigned short | texCoordSetToDestroy )

This method collapses two texcoords into one for all submeshes where this is possible.

Remarks
  Often a submesh can have two tex. coords. (i.e. TEXCOORD0 & TEXCOORD1), being both composed of two floats. There are many practical reasons why it would be more convenient to merge both of them into one TEXCOORD0 of 4 floats. This function does exactly that The finalTexCoordSet must have enough space for the merge, or else the submesh will be skipped. (i.e. you can't merge a tex. coord with 3 floats with one having 2 floats)

finalTexCoordSet & texCoordSetToDestroy must be in the same buffer source, and must be adjacent.

Parameters

  finalTexCoordSet | The tex. coord index to merge to. Should have enough space to actually work.
  texCoordSetToDestroy | The texture coordinate index that will disappear on successful merges.

## ◆ nameSubMesh()

void Ogre::v1::Mesh::nameSubMesh | ( | const String & | name,
|  | unsigned | index )

Gives a name to a SubMesh.

Note, only first 65536 submeshes could be named.

## ◆ prepareForShadowMapping()

void Ogre::v1::Mesh::prepareForShadowMapping | ( | bool | forceSameBuffers | ) |

## ◆ prepareForShadowVolume()

void Ogre::v1::Mesh::prepareForShadowVolume | ( |  | ) |

This method prepares the mesh for generating a renderable shadow volume.

Remarks
  Preparing a mesh to generate a shadow volume involves firstly ensuring that the vertex buffer containing the positions for the mesh is a standalone vertex buffer, with no other components in it. This method will therefore break apart any existing vertex buffers this mesh holds if position is sharing a vertex buffer. Secondly, it will double the size of this vertex buffer so that there are 2 copies of the position data for the mesh. The first half is used for the original, and the second half is used for the 'extruded' version of the mesh. The vertex count of the main VertexData used to render the mesh will remain the same though, so as not to add any overhead to regular rendering of the object. Both copies of the position are required in one buffer because shadow volumes stretch from the original mesh to the extruded version.

  Because shadow volumes are rendered in turn, no additional index buffer space is allocated by this method, a shared index buffer allocated by the shadow rendering algorithm is used for addressing this extended vertex buffer.

## ◆ prepareMatricesForVertexBlend()

static void Ogre::v1::Mesh::prepareMatricesForVertexBlend | ( | const Matrix4 ** | blendMatrices,
|  | const Matrix4 * | boneMatrices,
|  | const IndexMap & | indexMap )
| static

Prepare matrices for software indexed vertex blend.

Remarks
  This function organise bone indexed matrices to blend indexed matrices, so software vertex blending can access to the matrix via blend index directly.

Parameters

  blendMatrices | Pointer to an array of matrix pointers to store prepared results, which indexed by blend index.
  boneMatrices | Pointer to an array of matrices to be used to blend, which indexed by bone index.
  indexMap | The index map used to translate blend index to bone index.

## ◆ reload()

void Ogre::v1::Mesh::reload | ( | LoadingFlags | flags = LF_DEFAULT | ) |
| overridevirtual

Reloads the resource, if it is already loaded.

Remarks
  Calls unload() and then load() again, if the resource is already loaded. If it is not loaded already, then nothing happens.

Reimplemented from Ogre::Resource.

References Ogre::Resource::LF_DEFAULT.

## ◆ removeAllAnimations()

virtual void Ogre::v1::Mesh::removeAllAnimations | ( |  | ) |
| virtual

Removes all morph Animations from this mesh.

## ◆ removeAllPoses()

void Ogre::v1::Mesh::removeAllPoses | ( |  | ) |

Destroy all poses.

## ◆ removeAnimation()

void Ogre::v1::Mesh::removeAnimation | ( | const String & | name | ) |
| overridevirtual

Removes vertex Animation from this mesh.

Implements Ogre::v1::AnimationContainer.

## ◆ removeLodLevels()

void Ogre::v1::Mesh::removeLodLevels | ( |  | ) |

Removes all LOD data from this Mesh.

## ◆ removePose() [1/2]

void Ogre::v1::Mesh::removePose | ( | const String & | name | ) |

Destroy a pose by name.

Note
  This will invalidate any animation tracks referring to this pose or those after it.

## ◆ removePose() [2/2]

void Ogre::v1::Mesh::removePose | ( | ushort | index | ) |

Destroy a pose by index.

Note
  This will invalidate any animation tracks referring to this pose or those after it.

## ◆ setAutoBuildEdgeLists()

void Ogre::v1::Mesh::setAutoBuildEdgeLists | ( | bool | autobuild | ) |
| inline

Sets whether or not this Mesh should automatically build edge lists when asked for them, or whether it should never build them if they are not already provided.

Remarks
  This allows you to create meshes which do not have edge lists calculated, because you never want to use them. This value defaults to 'true' for mesh formats which did not include edge data, and 'false' for newer formats, where edge lists are expected to have been generated in advance.

## ◆ setHardwareBufferManager()

void Ogre::v1::Mesh::setHardwareBufferManager | ( | HardwareBufferManagerBase * | bufferManager | ) |
| inline

Sets the manager for the vertex and 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 and will never use it with GPU, 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

  bufferManager | If set to `DefaultHardwareBufferManager`, the buffers will be created in system memory only, without hardware counterparts. Such mesh could not be rendered, but LODs could be generated for such mesh, it could be cloned, transformed and serialized.

## ◆ setIndexBufferPolicy()

void Ogre::v1::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.

## ◆ setLodStrategyName()

void Ogre::v1::Mesh::setLodStrategyName | ( | const String & | name | ) |
| inline

## ◆ setSkeletonName()

void Ogre::v1::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

## ◆ setVertexBufferPolicy()

void Ogre::v1::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.

## ◆ softwareVertexBlend()

static void Ogre::v1::Mesh::softwareVertexBlend | ( | const VertexData * | sourceVertexData,
|  | const VertexData * | targetVertexData,
|  | const Matrix4 *const * | blendMatrices,
|  | size_t | numMatrices,
|  | bool | blendNormals )
| static

Performs a software indexed vertex blend, of the kind used for skeletal animation although it can be used for other purposes.

Remarks
  This function is supplied to update vertex data with blends done in software, either because no hardware support is available, or that you need the results of the blend for some other CPU operations.

Parameters

  sourceVertexData | VertexData class containing positions, normals, blend indices and blend weights.
  targetVertexData | VertexData class containing target position and normal buffers which will be updated with the blended versions. Note that the layout of the source and target position / normal buffers must be identical, ie they must use the same buffer indexes
  blendMatrices | Pointer to an array of matrix pointers to be used to blend, indexed by blend indices in the sourceVertexData
  numMatrices | Number of matrices in the blendMatrices, it might be used as a hint for optimisation.
  blendNormals | If `true`, normals are blended as well as positions.

## ◆ softwareVertexMorph()

static void Ogre::v1::Mesh::softwareVertexMorph | ( | Real | t,
|  | const HardwareVertexBufferSharedPtr & | b1,
|  | const HardwareVertexBufferSharedPtr & | b2,
|  | VertexData * | targetVertexData )
| static

Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes.

Remarks
  This function will linearly interpolate positions between two source buffers, into a third buffer.

Parameters

  t | Parametric distance between the start and end buffer positions.
  b1 | Vertex buffer containing VET_FLOAT3 entries for the start positions.
  b2 | Vertex buffer containing VET_FLOAT3 entries for the end positions.
  targetVertexData | VertexData destination; assumed to have a separate position buffer already bound, and the number of vertices must agree with the number in start and end

## ◆ softwareVertexPoseBlend()

static void Ogre::v1::Mesh::softwareVertexPoseBlend | ( | Real | weight,
|  | const map< size_t, Vector3 >::type & | vertexOffsetMap,
|  | const map< size_t, Vector3 >::type & | normalsMap,
|  | VertexData * | targetVertexData )
| static

Performs a software vertex pose blend, of the kind used for morph animation although it can be used for other purposes.

Remarks
  This function will apply a weighted offset to the positions in the incoming vertex data (therefore this is a read/write operation, and if you expect to call it more than once with the same data, then you would be best to suppress hardware uploads of the position buffer for the duration).

Parameters

  weight | Parametric weight to scale the offsets by.
  vertexOffsetMap | Potentially sparse map of vertex index -> offset.
  normalsMap | Potentially sparse map of vertex index -> normal.
  targetVertexData | VertexData destination; assumed to have a separate position buffer already bound, and the number of vertices must agree with the number in start and end.

## ◆ suggestTangentVectorBuildParams()

bool Ogre::v1::Mesh::suggestTangentVectorBuildParams | ( | VertexElementSemantic | targetSemantic,
|  | unsigned short & | outSourceCoordSet,
|  | unsigned short & | outIndex )

Ask the mesh to suggest parameters to a future buildTangentVectors call, should you wish to use texture coordinates to store the tangents.

Remarks
  This helper method will suggest source and destination texture coordinate sets for a call to buildTangentVectors. It will detect when there are inappropriate conditions (such as multiple geometry sets which don't agree). Moreover, it will return 'true' if it detects that there are aleady 3D coordinates in the mesh, and therefore tangents may have been prepared already.

Parameters

  targetSemantic | The semantic you intend to use to store the tangents if they are not already present; most likely options are VES_TEXTURE_COORDINATES or VES_TANGENT; you should use texture coordinates if you want compatibility with older, pre-SM2 graphics cards, and the tangent binding otherwise.
  outSourceCoordSet | Reference to a source texture coordinate set which will be populated.
  outIndex | Reference to a destination element index (e.g. texture coord set) which will be populated

## ◆ unnameSubMesh()

void Ogre::v1::Mesh::unnameSubMesh | ( | const String & | name | ) |

Removes a name from a SubMesh.

## ◆ updateManualLodLevel()

void Ogre::v1::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.

## ◆ updateMaterialForAllSubMeshes()

void Ogre::v1::Mesh::updateMaterialForAllSubMeshes | ( |  | ) |

Iterates through all submeshes and requests them to apply their texture aliases to the material they use.

Remarks
  The submesh will only apply texture aliases to the material if matching texture alias names are found in the material. If a match is found, the submesh will automatically clone the original material and then apply its texture to the new material.

  This method is normally called by the protected method loadImpl when a mesh if first loaded.

## Member Data Documentation

## ◆ msOptimizeForShadowMapping

bool Ogre::v1::Mesh::msOptimizeForShadowMapping
| static

When this bool is false, prepareForShadowMapping will use the same Vaos for both regular and shadow mapping rendering.

When it's true, it will calculate an optimized version to speed up shadow map rendering (uses a bit more GPU VRAM). Large meshes can take long to optimize thus it is recommended to perform this offline and save it into the mesh file. It's off by default.

See also
  Ogre::Mesh::msOptimizeForShadowMapping for the v2 version
  Ogre::v1::Mesh::msOptimizeForShadowMapping for the v1 version

## ◆ sharedBlendIndexToBoneIndexMap

IndexMap Ogre::v1::Mesh::sharedBlendIndexToBoneIndexMap

Shared index map for translating blend index to bone index.

Remarks
  This index map can be shared among multiple submeshes. SubMeshes might not have their own IndexMap, they might share this one.

  We collect actually used bones of all bone assignments, and build the blend index in 'packed' form, then the range of the blend index in vertex data VES_BLEND_INDICES element is continuous, with no gaps. Thus, by minimising the world matrix array constants passing to GPU, we can support more bones for a mesh when hardware skinning is used. The hardware skinning support limit is applied to each set of vertex data in the mesh, in other words, the hardware skinning support limit is applied only to the actually used bones of each SubMeshes, not all bones across the entire Mesh.

  Because the blend index is different to the bone index, therefore, we use the index map to translate the blend index to bone index.

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

## ◆ sharedVertexData

VertexData* Ogre::v1::Mesh::sharedVertexData[NumVertexPass]

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.

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

- OgreMesh.h