OgreMesh.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Mesh_H__
29 #define __Mesh_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 #include "OgreResource.h"
34 #include "OgreVertexIndexData.h"
35 #include "OgreAxisAlignedBox.h"
37 #include "OgreIteratorWrappers.h"
39 #include "OgreSkeleton.h"
40 #include "OgreAnimation.h"
41 #include "OgreAnimationTrack.h"
42 #include "OgrePose.h"
43 #include "OgreDataStream.h"
44 #include "OgreHeaderPrefix.h"
45 
46 
47 namespace Ogre {
48 
49 
57  struct MeshLodUsage;
58  struct LodConfig;
59  class LodStrategy;
60 
94  {
95  friend class SubMesh;
96  friend class MeshSerializerImpl;
100 
101  public:
109 
110  protected:
118 
121  VertexElementSemantic targetSemantic, unsigned short index,
122  unsigned short sourceTexCoordSet);
123 
124  public:
128  typedef HashMap<String, ushort> SubMeshNameMap ;
129 
130 
131  protected:
132 
134 
136 
141 
145 
146 
148 
151 
153  void buildIndexMap(const VertexBoneAssignmentList& boneAssignments,
154  IndexMap& boneIndexToBlendIndexMap, IndexMap& blendIndexToBoneIndexMap);
157  unsigned short numBlendWeightsPerVertex,
158  IndexMap& blendIndexToBoneIndexMap,
159  VertexData* targetVertexData);
160 
165 
170 
171 
175 
184  mutable bool mAnimationTypesDirty;
185 
188  mutable bool mPosesIncludeNormals;
189 
190 
196  void prepareImpl(void);
199  void unprepareImpl(void);
201  void loadImpl(void);
203  void postLoadImpl(void);
205  void unloadImpl(void);
207  size_t calculateSize(void) const;
208 
209  void mergeAdjacentTexcoords( unsigned short finalTexCoordSet,
210  unsigned short texCoordSetToDestroy, VertexData *vertexData );
211 
212 
213  public:
218  Mesh(ResourceManager* creator, const String& name, ResourceHandle handle,
219  const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
220  ~Mesh();
221 
222  // NB All methods below are non-virtual since they will be
223  // called in the rendering loop - speed is of the essence.
224 
232 
235  SubMesh* createSubMesh(const String& name);
236 
239  void nameSubMesh(const String& name, ushort index);
240 
243  void unnameSubMesh(const String& name);
244 
250  ushort _getSubMeshIndex(const String& name) const;
251 
254  unsigned short getNumSubMeshes(void) const;
255 
258  SubMesh* getSubMesh(unsigned short index) const;
259 
262  SubMesh* getSubMesh(const String& name) const ;
263 
270  void destroySubMesh(unsigned short index);
271 
278  void destroySubMesh(const String& name);
279 
283  { return SubMeshIterator(mSubMeshList.begin(), mSubMeshList.end()); }
284 
294 
316 
328  MeshPtr clone(const String& newName, const String& newGroup = StringUtil::BLANK);
329 
332  const AxisAlignedBox& getBounds(void) const;
333 
336 
345  void _setBounds(const AxisAlignedBox& bounds, bool pad = true);
346 
355 
367  void setSkeletonName(const String& skelName);
368 
370  bool hasSkeleton(void) const;
371 
374  bool hasVertexAnimation(void) const;
375 
380  const SkeletonPtr& getSkeleton(void) const;
381 
383  const String& getSkeletonName(void) const;
389 
407  void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
408 
415 
423 
424 
428 
431  const VertexBoneAssignmentList& getBoneAssignments() const { return mBoneAssignments; }
432 
433 
438  ushort getNumLodLevels(void) const;
440  const MeshLodUsage& getLodLevel(ushort index) const;
456  void createManualLodLevel(Real value, const String& meshName, const String& groupName = Ogre::String());
457 
467  void updateManualLodLevel(ushort index, const String& meshName);
468 
475  ushort getLodIndex(Real value) const;
476 
483  bool isLodManual(void) const { return mIsLodManual; }
484 
486  void _setLodInfo(unsigned short numLevels, bool isManual);
488  void _setLodUsage(unsigned short level, MeshLodUsage& usage);
490  void _setSubMeshLodFaceList(unsigned short subIdx, unsigned short level, IndexData* facedata);
491 
493  void removeLodLevels(void);
494 
519  void setVertexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
544  void setIndexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
546  HardwareBuffer::Usage getVertexBufferUsage(void) const { return mVertexBufferUsage; }
548  HardwareBuffer::Usage getIndexBufferUsage(void) const { return mIndexBufferUsage; }
550  bool isVertexBufferShadowed(void) const { return mVertexBufferShadowBuffer; }
552  bool isIndexBufferShadowed(void) const { return mIndexBufferShadowBuffer; }
553 
554 
571  unsigned short _rationaliseBoneAssignments(size_t vertexCount, VertexBoneAssignmentList& assignments);
572 
581 
588 
604  void mergeAdjacentTexcoords( unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy );
605 
606  void _configureMeshLodUsage(const LodConfig& lodConfig);
607 
641  unsigned short sourceTexCoordSet = 0, unsigned short index = 0,
642  bool splitMirrored = false, bool splitRotated = false, bool storeParityInW = false);
643 
666  unsigned short& outSourceCoordSet, unsigned short& outIndex);
667 
671  void buildEdgeList(void);
673  void freeEdgeList(void);
674 
694 
702  EdgeData* getEdgeList(unsigned short lodIndex = 0);
703 
711  const EdgeData* getEdgeList(unsigned short lodIndex = 0) const;
712 
715  bool isPreparedForShadowVolumes(void) const { return mPreparedForShadowVolumes; }
716 
718  bool isEdgeListBuilt(void) const { return mEdgeListsBuilt; }
719 
734  static void prepareMatricesForVertexBlend(const Matrix4** blendMatrices,
735  const Matrix4* boneMatrices, const IndexMap& indexMap);
736 
760  static void softwareVertexBlend(const VertexData* sourceVertexData,
761  const VertexData* targetVertexData,
762  const Matrix4* const* blendMatrices, size_t numMatrices,
763  bool blendNormals);
764 
781  static void softwareVertexMorph(Real t,
784  VertexData* targetVertexData);
785 
805  static void softwareVertexPoseBlend(Real weight,
806  const map<size_t, Vector3>::type& vertexOffsetMap,
807  const map<size_t, Vector3>::type& normalsMap,
808  VertexData* targetVertexData);
810  const SubMeshNameMap& getSubMeshNameMap(void) const { return mSubMeshNameMap; }
811 
822  void setAutoBuildEdgeLists(bool autobuild) { mAutoBuildEdgeLists = autobuild; }
827  bool getAutoBuildEdgeLists(void) const { return mAutoBuildEdgeLists; }
828 
832 
834  bool getSharedVertexDataAnimationIncludesNormals() const { return mSharedVertexDataAnimationIncludesNormals; }
835 
842  virtual Animation* createAnimation(const String& name, Real length);
843 
848  virtual Animation* getAnimation(const String& name) const;
849 
855  virtual Animation* _getAnimationImpl(const String& name) const;
856 
858  virtual bool hasAnimation(const String& name) const;
859 
861  virtual void removeAnimation(const String& name);
862 
864  virtual unsigned short getNumAnimations(void) const;
865 
868  virtual Animation* getAnimation(unsigned short index) const;
869 
871  virtual void removeAllAnimations(void);
877  VertexData* getVertexDataByTrackHandle(unsigned short handle);
890 
895  void _determineAnimationTypes(void) const;
897  bool _getAnimationTypesDirty(void) const { return mAnimationTypesDirty; }
898 
908  Pose* createPose(ushort target, const String& name = StringUtil::BLANK);
910  size_t getPoseCount(void) const { return mPoseList.size(); }
912  Pose* getPose(ushort index);
914  Pose* getPose(const String& name);
919  void removePose(ushort index);
924  void removePose(const String& name);
926  void removeAllPoses(void);
927 
930 
936  const PoseList& getPoseList(void) const;
937 
939  const LodStrategy *getLodStrategy() const;
941  void setLodStrategy(LodStrategy *lodStrategy);
942 
943  };
944 
947  {
953 
960 
968  mutable EdgeData* edgeData;
969 
970  MeshLodUsage() : userValue(0.0), value(0.0), edgeData(0) {}
971  };
972 
977 } // namespace Ogre
978 
979 #include "OgreHeaderSuffix.h"
980 
981 #endif // __Mesh_H__
OgreHeaderSuffix.h
Ogre::Mesh::getSkeletonName
const String & getSkeletonName(void) const
Gets the name of any linked Skeleton.
Ogre::Mesh::IndexMap
vector< unsigned short >::type IndexMap
Definition: OgreMesh.h:108
Ogre::ResourceHandle
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
Ogre::Mesh::updateManualLodLevel
void updateManualLodLevel(ushort index, const String &meshName)
Changes the alternate mesh to use as a manual LOD at the given index.
Ogre::Mesh::getLodLevel
const MeshLodUsage & getLodLevel(ushort index) const
Gets details of the numbered level of detail entry.
Ogre::Mesh::MeshLodUsageList
vector< MeshLodUsage >::type MeshLodUsageList
Definition: OgreMesh.h:103
Ogre::Mesh::setIndexBufferPolicy
void setIndexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer=false)
Sets the policy for the index buffers to be used when loading this Mesh.
Ogre::MeshLodUsage
A way of recording the way each LODs is recorded this Mesh.
Definition: OgreMesh.h:947
Ogre::Mesh::_setLodUsage
void _setLodUsage(unsigned short level, MeshLodUsage &usage)
Internal methods for loading LOD, do not use.
Ogre::VES_TANGENT
@ VES_TANGENT
Tangent (X axis if normal is Z)
Definition: OgreHardwareVertexBuffer.h:117
Ogre::Mesh::createPose
Pose * createPose(ushort target, const String &name=StringUtil::BLANK)
Create a new Pose for this mesh or one of its submeshes.
Ogre::Mesh::LodValueList
vector< Real >::type LodValueList
Definition: OgreMesh.h:102
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::Mesh::getBounds
const AxisAlignedBox & getBounds(void) const
Get the axis-aligned bounding box for this mesh.
Ogre::Mesh::mIndexBufferUsage
HardwareBuffer::Usage mIndexBufferUsage
Definition: OgreMesh.h:167
Ogre::Mesh::getNumAnimations
virtual unsigned short getNumAnimations(void) const
Gets the number of morph animations in this mesh.
Ogre::Mesh::prepareMatricesForVertexBlend
static void prepareMatricesForVertexBlend(const Matrix4 **blendMatrices, const Matrix4 *boneMatrices, const IndexMap &indexMap)
Prepare matrices for software indexed vertex blend.
Ogre::Mesh::mergeAdjacentTexcoords
void mergeAdjacentTexcoords(unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy)
This method collapses two texcoords into one for all submeshes where this is possible.
Ogre::map
Definition: OgrePrerequisites.h:534
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::Mesh::unnameSubMesh
void unnameSubMesh(const String &name)
Removes a name from a SubMesh.
Ogre::Mesh::isVertexBufferShadowed
bool isVertexBufferShadowed(void) const
Gets whether or not this meshes vertex buffers are shadowed.
Definition: OgreMesh.h:550
Ogre::Mesh::setSkeletonName
void setSkeletonName(const String &skelName)
Sets the name of the skeleton this Mesh uses for animation.
Ogre::Mesh::getPose
Pose * getPose(ushort index)
Retrieve an existing Pose by index.
Ogre::Mesh::getEdgeList
EdgeData * getEdgeList(unsigned short lodIndex=0)
Return the edge list for this mesh, building it if required.
Ogre::Mesh::createAnimation
virtual Animation * createAnimation(const String &name, Real length)
Creates a new Animation object for vertex animating this mesh.
Ogre::Mesh::AnimationList
map< String, Animation * >::type AnimationList
Storage of morph animations, lookup by name.
Definition: OgreMesh.h:177
Ogre::MeshSerializerImpl_v1_4
Class for providing backwards-compatibility for loading version 1.4 of the .mesh format.
Definition: OgreMeshSerializerImpl.h:205
Ogre::Mesh::setAutoBuildEdgeLists
void setAutoBuildEdgeLists(bool autobuild)
Sets whether or not this Mesh should automatically build edge lists when asked for them,...
Definition: OgreMesh.h:822
Ogre::Mesh::createManualLodLevel
void createManualLodLevel(Real value, const String &meshName, const String &groupName=Ogre::String())
Adds a new manual level-of-detail entry to this Mesh.
Ogre::Mesh::getSharedVertexDataAnimationType
virtual VertexAnimationType getSharedVertexDataAnimationType(void) const
Gets the type of vertex animation the shared vertex data of this mesh supports.
Ogre::VertexAnimationType
VertexAnimationType
Type of vertex animation.
Definition: OgreAnimationTrack.h:468
Ogre::Mesh::getSubMeshIterator
SubMeshIterator getSubMeshIterator(void)
Gets an iterator over the available submeshes.
Definition: OgreMesh.h:282
Ogre::Mesh::_getSubMeshIndex
ushort _getSubMeshIndex(const String &name) const
Gets the index of a submesh with a given name.
Ogre::Mesh::_determineAnimationTypes
void _determineAnimationTypes(void) const
Internal method which, if animation types have not been determined, scans any vertex animations and d...
Ogre::Mesh::setVertexBufferPolicy
void setVertexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer=false)
Sets the policy for the vertex buffers to be used when loading this Mesh.
Ogre::Mesh::mEdgeListsBuilt
bool mEdgeListsBuilt
Definition: OgreMesh.h:173
Ogre::Mesh::getBoneAssignments
const VertexBoneAssignmentList & getBoneAssignments() const
Gets a const reference to the list of bone assignments.
Definition: OgreMesh.h:431
Ogre::MeshSerializerImpl_v1_1
Class for providing backwards-compatibility for loading version 1.1 of the .mesh format.
Definition: OgreMeshSerializerImpl.h:260
Ogre::Mesh::compileBoneAssignments
void compileBoneAssignments(const VertexBoneAssignmentList &boneAssignments, unsigned short numBlendWeightsPerVertex, IndexMap &blendIndexToBoneIndexMap, VertexData *targetVertexData)
Compile bone assignments into blend index and weight buffers.
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
Ogre::Mesh::mIndexBufferShadowBuffer
bool mIndexBufferShadowBuffer
Definition: OgreMesh.h:169
Ogre::Mesh::getPose
Pose * getPose(const String &name)
Retrieve an existing Pose by name.
Ogre::Mesh::buildIndexMap
void buildIndexMap(const VertexBoneAssignmentList &boneAssignments, IndexMap &boneIndexToBlendIndexMap, IndexMap &blendIndexToBoneIndexMap)
Build the index map between bone index and blend index.
Ogre::Mesh::SubMeshList
vector< SubMesh * >::type SubMeshList
Definition: OgreMesh.h:107
Ogre::Mesh::PoseIterator
VectorIterator< PoseList > PoseIterator
Definition: OgreMesh.h:928
Ogre::Mesh::removeAnimation
virtual void removeAnimation(const String &name)
Removes vertex Animation from this mesh.
Ogre::Mesh::mSubMeshNameMap
SubMeshNameMap mSubMeshNameMap
Definition: OgreMesh.h:135
Ogre::Mesh::_setSubMeshLodFaceList
void _setSubMeshLodFaceList(unsigned short subIdx, unsigned short level, IndexData *facedata)
Internal methods for loading LOD, do not use.
Ogre::Mesh::mIsLodManual
bool mIsLodManual
Definition: OgreMesh.h:162
Ogre::Mesh::removeLodLevels
void removeLodLevels(void)
Removes all LOD data from this Mesh.
Ogre::Mesh::getBoneAssignmentIterator
BoneAssignmentIterator getBoneAssignmentIterator(void)
Gets an iterator for access all bone assignments.
Ogre::MeshLodUsage::userValue
Real userValue
User-supplied values used to determine when th is LOD applies.
Definition: OgreMesh.h:952
Ogre::Mesh::addBoneAssignment
void addBoneAssignment(const VertexBoneAssignment &vertBoneAssign)
Assigns a vertex to a bone with a given weight, for skeletal animation.
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Mesh::ConstPoseIterator
ConstVectorIterator< PoseList > ConstPoseIterator
Definition: OgreMesh.h:929
Ogre::VertexBoneAssignment_s
Records the assignment of a single vertex to a single bone with the corresponding weight.
Definition: OgreVertexBoneAssignment.h:51
Ogre::Mesh::loadImpl
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
Ogre::Mesh::getAutoBuildEdgeLists
bool getAutoBuildEdgeLists(void) const
Sets whether or not this Mesh should automatically build edge lists when asked for them,...
Definition: OgreMesh.h:827
Ogre::Mesh::destroySubMesh
void destroySubMesh(const String &name)
Destroy a SubMesh with the given name.
Ogre::Mesh::removeAllAnimations
virtual void removeAllAnimations(void)
Removes all morph Animations from this mesh.
Ogre::Mesh::getSkeleton
const SkeletonPtr & getSkeleton(void) const
Gets a pointer to any linked Skeleton.
Ogre::Mesh::_getAnimationTypesDirty
bool _getAnimationTypesDirty(void) const
Are the derived animation types out of date?
Definition: OgreMesh.h:897
Ogre::Mesh::getIndexBufferUsage
HardwareBuffer::Usage getIndexBufferUsage(void) const
Gets the usage setting for this meshes index buffers.
Definition: OgreMesh.h:548
Ogre::Mesh::_updateCompiledBoneAssignments
void _updateCompiledBoneAssignments(void)
Internal method, be called once to update the compiled bone assignments.
Ogre::Mesh::_initAnimationState
void _initAnimationState(AnimationStateSet *animSet)
Initialise an animation set suitable for use with this mesh.
Ogre::Pose
A pose is a linked set of vertex offsets applying to one set of vertex data.
Definition: OgrePose.h:56
Ogre::Mesh::mPosesIncludeNormals
bool mPosesIncludeNormals
Definition: OgreMesh.h:188
Ogre::Mesh::unprepareImpl
void unprepareImpl(void)
Destroys data cached by prepareImpl.
Ogre::Mesh::getNumSubMeshes
unsigned short getNumSubMeshes(void) const
Gets the number of sub meshes which comprise this mesh.
Ogre::Mesh::unloadImpl
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
Ogre::Mesh::_compileBoneAssignments
void _compileBoneAssignments(void)
Internal method, be called once to compile bone assignments into geometry buffer.
Ogre::VertexData
Summary class collecting together vertex source information.
Definition: OgreVertexIndexData.h:50
Ogre::VertexElementSemantic
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Definition: OgreHardwareVertexBuffer.h:99
Ogre::LodStrategy
Strategy for determining level of detail.
Definition: OgreLodStrategy.h:55
Ogre::StringUtil::BLANK
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Ogre::Mesh::removeAllPoses
void removeAllPoses(void)
Destroy all poses.
Ogre::Mesh::buildEdgeList
void buildEdgeList(void)
Builds an edge list for this mesh, which can be used for generating a shadow volume among other thing...
Ogre::PoseList
vector< Pose * >::type PoseList
Definition: OgrePose.h:135
Ogre::Mesh::createSubMesh
SubMesh * createSubMesh(const String &name)
Creates a new SubMesh and gives it a name.
Ogre::Mesh::mMeshLodUsageList
MeshLodUsageList mMeshLodUsageList
Definition: OgreMesh.h:164
Ogre::Mesh::getVertexBufferUsage
HardwareBuffer::Usage getVertexBufferUsage(void) const
Gets the usage setting for this meshes vertex buffers.
Definition: OgreMesh.h:546
Ogre::Mesh::mSharedVertexDataAnimationIncludesNormals
bool mSharedVertexDataAnimationIncludesNormals
Whether vertex animation includes normals.
Definition: OgreMesh.h:182
OgreHeaderPrefix.h
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
Ogre::Mesh::softwareVertexMorph
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 ot...
OgreAnimation.h
Ogre::Mesh::mVertexBufferShadowBuffer
bool mVertexBufferShadowBuffer
Definition: OgreMesh.h:168
OgrePrerequisites.h
Ogre::MeshLodUsage::manualMesh
MeshPtr manualMesh
Hard link to mesh to avoid looking up each time.
Definition: OgreMesh.h:966
Ogre::HardwareVertexBufferSharedPtr
Shared pointer implementation used to share vertex buffers.
Definition: OgreHardwareVertexBuffer.h:87
Ogre::Mesh::getEdgeList
const EdgeData * getEdgeList(unsigned short lodIndex=0) const
Return the edge list for this mesh, building it if required.
Ogre::SubMesh
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:63
Ogre::Mesh::removePose
void removePose(const String &name)
Destroy a pose by name.
Ogre::Mesh::sharedBlendIndexToBoneIndexMap
IndexMap sharedBlendIndexToBoneIndexMap
Shared index map for translating blend index to bone index.
Definition: OgreMesh.h:315
Ogre::Mesh::removePose
void removePose(ushort index)
Destroy a pose by index.
Ogre::Mesh::isLodManual
bool isLodManual(void) const
Returns true if this mesh is using manual LOD.
Definition: OgreMesh.h:483
Ogre::Mesh::getAnimation
virtual Animation * getAnimation(unsigned short index) const
Gets a single morph animation by index.
Ogre::Mesh::sharedVertexData
VertexData * sharedVertexData
Shared vertex data.
Definition: OgreMesh.h:293
Ogre::Mesh::mAnimationsList
AnimationList mAnimationsList
Definition: OgreMesh.h:178
Ogre::Mesh::destroySubMesh
void destroySubMesh(unsigned short index)
Destroy a SubMesh with the given index.
Ogre::Mesh::getSubMeshNameMap
const SubMeshNameMap & getSubMeshNameMap(void) const
Gets a reference to the optional name assignments of the SubMeshes.
Definition: OgreMesh.h:810
Ogre::Mesh::mBoneAssignmentsOutOfDate
bool mBoneAssignmentsOutOfDate
Flag indicating that bone assignments need to be recompiled.
Definition: OgreMesh.h:150
Ogre::AxisAlignedBox
A 3D box aligned with the x/y/z axes.
Definition: OgreAxisAlignedBox.h:55
Ogre::Mesh::updateMaterialForAllSubMeshes
void updateMaterialForAllSubMeshes(void)
Iterates through all submeshes and requests them to apply their texture aliases to the material they ...
OgreResource.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Mesh::createSubMesh
SubMesh * createSubMesh(void)
Creates a new SubMesh.
Ogre::ResourceManager
Defines a generic resource handler.
Definition: OgreResourceManager.h:123
Ogre::Mesh::mSharedVertexDataAnimationType
VertexAnimationType mSharedVertexDataAnimationType
The vertex animation type associated with the shared vertex data.
Definition: OgreMesh.h:180
Ogre::Mesh::Mesh
Mesh(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
Default constructor - used by MeshManager.
Ogre::Mesh::_setBoundingSphereRadius
void _setBoundingSphereRadius(Real radius)
Manually set the bounding radius.
Ogre::Mesh::getAnimation
virtual Animation * getAnimation(const String &name) const
Returns the named vertex Animation object.
Ogre::MeshLodUsage::edgeData
EdgeData * edgeData
Edge list for this LOD level (may be derived from manual mesh).
Definition: OgreMesh.h:968
Ogre::MeshLodUsage::manualName
String manualName
Only relevant if mIsLodManual is true, the name of the alternative mesh to use.
Definition: OgreMesh.h:962
Ogre::Mesh::mLodStrategy
const LodStrategy * mLodStrategy
Definition: OgreMesh.h:161
Ogre::MeshLodUsage::value
Real value
Value used by to determine when this LOD applies.
Definition: OgreMesh.h:959
Ogre::Mesh::isEdgeListBuilt
bool isEdgeListBuilt(void) const
Returns whether this mesh has an attached edge list.
Definition: OgreMesh.h:718
Ogre::Mesh::mSkeletonName
String mSkeletonName
Optional linked skeleton.
Definition: OgreMesh.h:143
Ogre::Animation
An animation sequence.
Definition: OgreAnimation.h:93
OgreAnimationTrack.h
Ogre::Mesh::_getAnimationImpl
virtual Animation * _getAnimationImpl(const String &name) const
Internal access to the named vertex Animation object - returns null if it does not exist.
Ogre::Mesh::clone
MeshPtr clone(const String &newName, const String &newGroup=StringUtil::BLANK)
Makes a copy of this mesh object and gives it a new name.
Ogre::Mesh::_notifySkeleton
void _notifySkeleton(SkeletonPtr &pSkel)
Internal notification, used to tell the Mesh which Skeleton to use without loading it.
Ogre::Mesh::VertexBoneAssignmentList
multimap< size_t, VertexBoneAssignment >::type VertexBoneAssignmentList
Multimap of vertex bone assignments (orders by vertex index).
Definition: OgreMesh.h:105
Ogre::Mesh::getPoseIterator
PoseIterator getPoseIterator(void)
Get an iterator over all the poses defined.
Ogre::Mesh::_refreshAnimationState
void _refreshAnimationState(AnimationStateSet *animSet)
Refresh an animation set suitable for use with this mesh.
Ogre::Mesh::mergeAdjacentTexcoords
void mergeAdjacentTexcoords(unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy, VertexData *vertexData)
Ogre::Mesh::_setLodInfo
void _setLodInfo(unsigned short numLevels, bool isManual)
Internal methods for loading LOD, do not use.
Ogre::multimap
Definition: OgrePrerequisites.h:548
Ogre::Mesh::prepareForShadowVolume
void prepareForShadowVolume(void)
This method prepares the mesh for generating a renderable shadow volume.
Ogre::MeshLodUsage::MeshLodUsage
MeshLodUsage()
Definition: OgreMesh.h:970
Ogre::SharedPtr< DataStream >
Ogre::Mesh::mPreparedForShadowVolumes
bool mPreparedForShadowVolumes
Definition: OgreMesh.h:172
Ogre::Mesh::_rationaliseBoneAssignments
unsigned short _rationaliseBoneAssignments(size_t vertexCount, VertexBoneAssignmentList &assignments)
Rationalises the passed in bone assignment list.
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::Mesh::mNumLods
ushort mNumLods
Definition: OgreMesh.h:163
Ogre::Mesh::getSubMesh
SubMesh * getSubMesh(const String &name) const
Gets a SubMesh by name.
Ogre::AnimationStateSet
Class encapsulating a set of AnimationState objects.
Definition: OgreAnimationState.h:197
OgreIteratorWrappers.h
Ogre::Mesh::calculateSize
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
OgreHardwareVertexBuffer.h
Ogre::Mesh::suggestTangentVectorBuildParams
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 textu...
Ogre::Mesh::nameSubMesh
void nameSubMesh(const String &name, ushort index)
Gives a name to a SubMesh.
Ogre::Resource
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:80
Ogre::Mesh::mBoundRadius
Real mBoundRadius
Local bounding sphere radius (centered on object).
Definition: OgreMesh.h:140
Ogre::Mesh::hasVertexAnimation
bool hasVertexAnimation(void) const
Returns whether or not this mesh has some kind of vertex animation.
Ogre::Mesh::mSkeleton
SkeletonPtr mSkeleton
Definition: OgreMesh.h:144
Ogre::Mesh::mVertexBufferUsage
HardwareBuffer::Usage mVertexBufferUsage
Definition: OgreMesh.h:166
Ogre::Mesh::setLodStrategy
void setLodStrategy(LodStrategy *lodStrategy)
Set the LOD strategy used by this mesh.
Ogre::Mesh::organiseTangentsBuffer
void organiseTangentsBuffer(VertexData *vertexData, VertexElementSemantic targetSemantic, unsigned short index, unsigned short sourceTexCoordSet)
Internal method for making the space for a vertex element to hold tangents.
OgreVertexIndexData.h
Ogre::LodConfig
Definition: OgreLodConfig.h:104
Ogre::Mesh::getSharedVertexDataAnimationIncludesNormals
bool getSharedVertexDataAnimationIncludesNormals() const
Returns whether animation on shared vertex data includes normals.
Definition: OgreMesh.h:834
Ogre::Mesh::freeEdgeList
void freeEdgeList(void)
Destroys and frees the edge lists this mesh has built.
Ogre::Mesh::~Mesh
~Mesh()
Ogre::Mesh::clearBoneAssignments
void clearBoneAssignments(void)
Removes all bone assignments for this mesh.
Ogre::Mesh::getLodIndex
ushort getLodIndex(Real value) const
Retrieves the level of detail index for the given LOD value.
Ogre::Mesh::hasSkeleton
bool hasSkeleton(void) const
Returns true if this Mesh has a linked Skeleton.
Ogre::Mesh::BoneAssignmentIterator
MapIterator< VertexBoneAssignmentList > BoneAssignmentIterator
Definition: OgreMesh.h:106
Ogre::Mesh::getLodStrategy
const LodStrategy * getLodStrategy() const
Get LOD strategy used by this mesh.
OgrePose.h
Ogre::Mesh::getNumLodLevels
ushort getNumLodLevels(void) const
Returns the number of levels of detail that this mesh supports.
Ogre::HardwareBuffer::Usage
Usage
Enums describing buffer usage; not mutually exclusive.
Definition: OgreHardwareBuffer.h:80
Ogre::Mesh::mSubMeshList
SubMeshList mSubMeshList
A list of submeshes which make up this mesh.
Definition: OgreMesh.h:117
Ogre::Mesh
Resource holding data about 3D mesh.
Definition: OgreMesh.h:94
Ogre::Mesh::isPreparedForShadowVolumes
bool isPreparedForShadowVolumes(void) const
Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes.
Definition: OgreMesh.h:715
Ogre::Mesh::getBoundingSphereRadius
Real getBoundingSphereRadius(void) const
Gets the radius of the bounding sphere surrounding this mesh.
Ogre::Mesh::_setBounds
void _setBounds(const AxisAlignedBox &bounds, bool pad=true)
Manually set the bounding box for this Mesh.
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Mesh::getPoseCount
size_t getPoseCount(void) const
Get the number of poses.
Definition: OgreMesh.h:910
Ogre::Mesh::getVertexDataByTrackHandle
VertexData * getVertexDataByTrackHandle(unsigned short handle)
Gets a pointer to a vertex data element based on a morph animation track handle.
Ogre::Mesh::mFreshFromDisk
DataStreamPtr mFreshFromDisk
Definition: OgreMesh.h:133
Ogre::Mesh::_configureMeshLodUsage
void _configureMeshLodUsage(const LodConfig &lodConfig)
Ogre::EdgeData
This class contains the information required to describe the edge connectivity of a given set of vert...
Definition: OgreEdgeListBuilder.h:53
Ogre::Mesh::postLoadImpl
void postLoadImpl(void)
Internal hook to perform actions after the load process, but before the resource has been marked as f...
OgreAxisAlignedBox.h
Ogre::Mesh::buildTangentVectors
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.
Ogre::MeshSerializerImpl
Internal implementation of Mesh reading / writing for the latest version of the .mesh format.
Definition: OgreMeshSerializerImpl.h:62
Ogre::MeshLodUsage::manualGroup
String manualGroup
Only relevant if mIsLodManual is true, the name of the group of the alternative mesh.
Definition: OgreMesh.h:964
Ogre::Mesh::SubMeshIterator
VectorIterator< SubMeshList > SubMeshIterator
Definition: OgreMesh.h:280
Ogre::Mesh::getSubMesh
SubMesh * getSubMesh(unsigned short index) const
Gets a pointer to the submesh indicated by the index.
Ogre::Mesh::prepareImpl
void prepareImpl(void)
Loads the mesh from disk.
Ogre::vector
Definition: OgrePrerequisites.h:492
Ogre::ManualResourceLoader
Interface describing a manual resource loader.
Definition: OgreResource.h:515
OgreSkeleton.h
Ogre::Mesh::hasAnimation
virtual bool hasAnimation(const String &name) const
Returns whether this mesh contains the named vertex animation.
Ogre::Mesh::mPoseList
PoseList mPoseList
List of available poses for shared and dedicated geometryPoseList.
Definition: OgreMesh.h:187
OgreVertexBoneAssignment.h
Ogre::Mesh::isIndexBufferShadowed
bool isIndexBufferShadowed(void) const
Gets whether or not this meshes index buffers are shadowed.
Definition: OgreMesh.h:552
Ogre::Mesh::softwareVertexPoseBlend
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 f...
Ogre::Mesh::mAnimationTypesDirty
bool mAnimationTypesDirty
Do we need to scan animations for animation types?
Definition: OgreMesh.h:184
OgreDataStream.h
Ogre::IndexData
Summary class collecting together index data source information.
Definition: OgreVertexIndexData.h:243
Ogre::Mesh::mAABB
AxisAlignedBox mAABB
Local bounding box volume.
Definition: OgreMesh.h:138
Ogre::Mesh::SubMeshNameMap
HashMap< String, ushort > SubMeshNameMap
A hashmap used to store optional SubMesh names.
Definition: OgreMesh.h:128
Ogre::ConstVectorIterator
Concrete IteratorWrapper for const access to the underlying container.
Definition: OgreIteratorWrapper.h:217
Ogre::Mesh::getPoseIterator
ConstPoseIterator getPoseIterator(void) const
Get an iterator over all the poses defined.
Ogre::Mesh::softwareVertexBlend
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 ...
Ogre::Mesh::getPoseList
const PoseList & getPoseList(void) const
Get pose list.
Ogre::Mesh::mAutoBuildEdgeLists
bool mAutoBuildEdgeLists
Definition: OgreMesh.h:174
Ogre::Mesh::mBoneAssignments
VertexBoneAssignmentList mBoneAssignments
Definition: OgreMesh.h:147
Ogre::MeshSerializerImpl_v1_2
Class for providing backwards-compatibility for loading version 1.2 of the .mesh format.
Definition: OgreMeshSerializerImpl.h:239
Ogre::AnimationContainer
An animation container interface, which allows generic access to sibling animations.
Definition: OgreAnimation.h:59

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.