Go to the documentation of this file.
122 unsigned short sourceTexCoordSet);
157 unsigned short numBlendWeightsPerVertex,
210 unsigned short texCoordSetToDestroy,
VertexData *vertexData );
641 unsigned short sourceTexCoordSet = 0,
unsigned short index = 0,
642 bool splitMirrored =
false,
bool splitRotated =
false,
bool storeParityInW =
false);
666 unsigned short& outSourceCoordSet,
unsigned short& outIndex);
762 const Matrix4*
const* blendMatrices,
size_t numMatrices,
const String & getSkeletonName(void) const
Gets the name of any linked Skeleton.
vector< unsigned short >::type IndexMap
unsigned long long int ResourceHandle
void updateManualLodLevel(ushort index, const String &meshName)
Changes the alternate mesh to use as a manual LOD at the given index.
const MeshLodUsage & getLodLevel(ushort index) const
Gets details of the numbered level of detail entry.
vector< MeshLodUsage >::type MeshLodUsageList
void setIndexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer=false)
Sets the policy for the index buffers to be used when loading this Mesh.
A way of recording the way each LODs is recorded this Mesh.
void _setLodUsage(unsigned short level, MeshLodUsage &usage)
Internal methods for loading LOD, do not use.
@ VES_TANGENT
Tangent (X axis if normal is Z)
Pose * createPose(ushort target, const String &name=StringUtil::BLANK)
Create a new Pose for this mesh or one of its submeshes.
vector< Real >::type LodValueList
const AxisAlignedBox & getBounds(void) const
Get the axis-aligned bounding box for this mesh.
HardwareBuffer::Usage mIndexBufferUsage
virtual unsigned short getNumAnimations(void) const
Gets the number of morph animations in this mesh.
static void prepareMatricesForVertexBlend(const Matrix4 **blendMatrices, const Matrix4 *boneMatrices, const IndexMap &indexMap)
Prepare matrices for software indexed vertex blend.
void mergeAdjacentTexcoords(unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy)
This method collapses two texcoords into one for all submeshes where this is possible.
void unnameSubMesh(const String &name)
Removes a name from a SubMesh.
bool isVertexBufferShadowed(void) const
Gets whether or not this meshes vertex buffers are shadowed.
void setSkeletonName(const String &skelName)
Sets the name of the skeleton this Mesh uses for animation.
Pose * getPose(ushort index)
Retrieve an existing Pose by index.
EdgeData * getEdgeList(unsigned short lodIndex=0)
Return the edge list for this mesh, building it if required.
virtual Animation * createAnimation(const String &name, Real length)
Creates a new Animation object for vertex animating this mesh.
map< String, Animation * >::type AnimationList
Storage of morph animations, lookup by name.
Class for providing backwards-compatibility for loading version 1.4 of the .mesh format.
void setAutoBuildEdgeLists(bool autobuild)
Sets whether or not this Mesh should automatically build edge lists when asked for them,...
void createManualLodLevel(Real value, const String &meshName, const String &groupName=Ogre::String())
Adds a new manual level-of-detail entry to this Mesh.
virtual VertexAnimationType getSharedVertexDataAnimationType(void) const
Gets the type of vertex animation the shared vertex data of this mesh supports.
VertexAnimationType
Type of vertex animation.
SubMeshIterator getSubMeshIterator(void)
Gets an iterator over the available submeshes.
ushort _getSubMeshIndex(const String &name) const
Gets the index of a submesh with a given name.
void _determineAnimationTypes(void) const
Internal method which, if animation types have not been determined, scans any vertex animations and d...
void setVertexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer=false)
Sets the policy for the vertex buffers to be used when loading this Mesh.
const VertexBoneAssignmentList & getBoneAssignments() const
Gets a const reference to the list of bone assignments.
Class for providing backwards-compatibility for loading version 1.1 of the .mesh format.
void compileBoneAssignments(const VertexBoneAssignmentList &boneAssignments, unsigned short numBlendWeightsPerVertex, IndexMap &blendIndexToBoneIndexMap, VertexData *targetVertexData)
Compile bone assignments into blend index and weight buffers.
Concrete IteratorWrapper for nonconst access to the underlying container.
bool mIndexBufferShadowBuffer
Pose * getPose(const String &name)
Retrieve an existing Pose by name.
void buildIndexMap(const VertexBoneAssignmentList &boneAssignments, IndexMap &boneIndexToBlendIndexMap, IndexMap &blendIndexToBoneIndexMap)
Build the index map between bone index and blend index.
vector< SubMesh * >::type SubMeshList
VectorIterator< PoseList > PoseIterator
virtual void removeAnimation(const String &name)
Removes vertex Animation from this mesh.
SubMeshNameMap mSubMeshNameMap
void _setSubMeshLodFaceList(unsigned short subIdx, unsigned short level, IndexData *facedata)
Internal methods for loading LOD, do not use.
void removeLodLevels(void)
Removes all LOD data from this Mesh.
BoneAssignmentIterator getBoneAssignmentIterator(void)
Gets an iterator for access all bone assignments.
Real userValue
User-supplied values used to determine when th is LOD applies.
void addBoneAssignment(const VertexBoneAssignment &vertBoneAssign)
Assigns a vertex to a bone with a given weight, for skeletal animation.
ConstVectorIterator< PoseList > ConstPoseIterator
Records the assignment of a single vertex to a single bone with the corresponding weight.
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
bool getAutoBuildEdgeLists(void) const
Sets whether or not this Mesh should automatically build edge lists when asked for them,...
void destroySubMesh(const String &name)
Destroy a SubMesh with the given name.
virtual void removeAllAnimations(void)
Removes all morph Animations from this mesh.
const SkeletonPtr & getSkeleton(void) const
Gets a pointer to any linked Skeleton.
bool _getAnimationTypesDirty(void) const
Are the derived animation types out of date?
HardwareBuffer::Usage getIndexBufferUsage(void) const
Gets the usage setting for this meshes index buffers.
void _updateCompiledBoneAssignments(void)
Internal method, be called once to update the compiled bone assignments.
void _initAnimationState(AnimationStateSet *animSet)
Initialise an animation set suitable for use with this mesh.
A pose is a linked set of vertex offsets applying to one set of vertex data.
bool mPosesIncludeNormals
void unprepareImpl(void)
Destroys data cached by prepareImpl.
unsigned short getNumSubMeshes(void) const
Gets the number of sub meshes which comprise this mesh.
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
void _compileBoneAssignments(void)
Internal method, be called once to compile bone assignments into geometry buffer.
Summary class collecting together vertex source information.
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
Strategy for determining level of detail.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
void removeAllPoses(void)
Destroy all poses.
void buildEdgeList(void)
Builds an edge list for this mesh, which can be used for generating a shadow volume among other thing...
vector< Pose * >::type PoseList
SubMesh * createSubMesh(const String &name)
Creates a new SubMesh and gives it a name.
MeshLodUsageList mMeshLodUsageList
HardwareBuffer::Usage getVertexBufferUsage(void) const
Gets the usage setting for this meshes vertex buffers.
bool mSharedVertexDataAnimationIncludesNormals
Whether vertex animation includes normals.
Class encapsulating a standard 4x4 homogeneous matrix.
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...
bool mVertexBufferShadowBuffer
MeshPtr manualMesh
Hard link to mesh to avoid looking up each time.
Shared pointer implementation used to share vertex buffers.
const EdgeData * getEdgeList(unsigned short lodIndex=0) const
Return the edge list for this mesh, building it if required.
Defines a part of a complete mesh.
void removePose(const String &name)
Destroy a pose by name.
IndexMap sharedBlendIndexToBoneIndexMap
Shared index map for translating blend index to bone index.
void removePose(ushort index)
Destroy a pose by index.
bool isLodManual(void) const
Returns true if this mesh is using manual LOD.
virtual Animation * getAnimation(unsigned short index) const
Gets a single morph animation by index.
VertexData * sharedVertexData
Shared vertex data.
AnimationList mAnimationsList
void destroySubMesh(unsigned short index)
Destroy a SubMesh with the given index.
const SubMeshNameMap & getSubMeshNameMap(void) const
Gets a reference to the optional name assignments of the SubMeshes.
bool mBoneAssignmentsOutOfDate
Flag indicating that bone assignments need to be recompiled.
A 3D box aligned with the x/y/z axes.
void updateMaterialForAllSubMeshes(void)
Iterates through all submeshes and requests them to apply their texture aliases to the material they ...
SubMesh * createSubMesh(void)
Creates a new SubMesh.
Defines a generic resource handler.
VertexAnimationType mSharedVertexDataAnimationType
The vertex animation type associated with the shared vertex data.
Mesh(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
Default constructor - used by MeshManager.
void _setBoundingSphereRadius(Real radius)
Manually set the bounding radius.
virtual Animation * getAnimation(const String &name) const
Returns the named vertex Animation object.
EdgeData * edgeData
Edge list for this LOD level (may be derived from manual mesh).
String manualName
Only relevant if mIsLodManual is true, the name of the alternative mesh to use.
const LodStrategy * mLodStrategy
Real value
Value used by to determine when this LOD applies.
bool isEdgeListBuilt(void) const
Returns whether this mesh has an attached edge list.
String mSkeletonName
Optional linked skeleton.
virtual Animation * _getAnimationImpl(const String &name) const
Internal access to the named vertex Animation object - returns null if it does not exist.
MeshPtr clone(const String &newName, const String &newGroup=StringUtil::BLANK)
Makes a copy of this mesh object and gives it a new name.
void _notifySkeleton(SkeletonPtr &pSkel)
Internal notification, used to tell the Mesh which Skeleton to use without loading it.
multimap< size_t, VertexBoneAssignment >::type VertexBoneAssignmentList
Multimap of vertex bone assignments (orders by vertex index).
PoseIterator getPoseIterator(void)
Get an iterator over all the poses defined.
void _refreshAnimationState(AnimationStateSet *animSet)
Refresh an animation set suitable for use with this mesh.
void mergeAdjacentTexcoords(unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy, VertexData *vertexData)
void _setLodInfo(unsigned short numLevels, bool isManual)
Internal methods for loading LOD, do not use.
void prepareForShadowVolume(void)
This method prepares the mesh for generating a renderable shadow volume.
bool mPreparedForShadowVolumes
unsigned short _rationaliseBoneAssignments(size_t vertexCount, VertexBoneAssignmentList &assignments)
Rationalises the passed in bone assignment list.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
SubMesh * getSubMesh(const String &name) const
Gets a SubMesh by name.
Class encapsulating a set of AnimationState objects.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
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...
void nameSubMesh(const String &name, ushort index)
Gives a name to a SubMesh.
Abstract class representing a loadable resource (e.g.
Real mBoundRadius
Local bounding sphere radius (centered on object).
bool hasVertexAnimation(void) const
Returns whether or not this mesh has some kind of vertex animation.
HardwareBuffer::Usage mVertexBufferUsage
void setLodStrategy(LodStrategy *lodStrategy)
Set the LOD strategy used by this mesh.
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.
bool getSharedVertexDataAnimationIncludesNormals() const
Returns whether animation on shared vertex data includes normals.
void freeEdgeList(void)
Destroys and frees the edge lists this mesh has built.
void clearBoneAssignments(void)
Removes all bone assignments for this mesh.
ushort getLodIndex(Real value) const
Retrieves the level of detail index for the given LOD value.
bool hasSkeleton(void) const
Returns true if this Mesh has a linked Skeleton.
MapIterator< VertexBoneAssignmentList > BoneAssignmentIterator
const LodStrategy * getLodStrategy() const
Get LOD strategy used by this mesh.
ushort getNumLodLevels(void) const
Returns the number of levels of detail that this mesh supports.
Usage
Enums describing buffer usage; not mutually exclusive.
SubMeshList mSubMeshList
A list of submeshes which make up this mesh.
Resource holding data about 3D mesh.
bool isPreparedForShadowVolumes(void) const
Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes.
Real getBoundingSphereRadius(void) const
Gets the radius of the bounding sphere surrounding this mesh.
void _setBounds(const AxisAlignedBox &bounds, bool pad=true)
Manually set the bounding box for this Mesh.
float Real
Software floating point type.
size_t getPoseCount(void) const
Get the number of poses.
VertexData * getVertexDataByTrackHandle(unsigned short handle)
Gets a pointer to a vertex data element based on a morph animation track handle.
DataStreamPtr mFreshFromDisk
void _configureMeshLodUsage(const LodConfig &lodConfig)
This class contains the information required to describe the edge connectivity of a given set of vert...
void postLoadImpl(void)
Internal hook to perform actions after the load process, but before the resource has been marked as f...
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.
Internal implementation of Mesh reading / writing for the latest version of the .mesh format.
String manualGroup
Only relevant if mIsLodManual is true, the name of the group of the alternative mesh.
VectorIterator< SubMeshList > SubMeshIterator
SubMesh * getSubMesh(unsigned short index) const
Gets a pointer to the submesh indicated by the index.
void prepareImpl(void)
Loads the mesh from disk.
Interface describing a manual resource loader.
virtual bool hasAnimation(const String &name) const
Returns whether this mesh contains the named vertex animation.
PoseList mPoseList
List of available poses for shared and dedicated geometryPoseList.
bool isIndexBufferShadowed(void) const
Gets whether or not this meshes index buffers are shadowed.
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...
bool mAnimationTypesDirty
Do we need to scan animations for animation types?
Summary class collecting together index data source information.
AxisAlignedBox mAABB
Local bounding box volume.
HashMap< String, ushort > SubMeshNameMap
A hashmap used to store optional SubMesh names.
Concrete IteratorWrapper for const access to the underlying container.
ConstPoseIterator getPoseIterator(void) const
Get an iterator over all the poses defined.
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 ...
const PoseList & getPoseList(void) const
Get pose list.
VertexBoneAssignmentList mBoneAssignments
Class for providing backwards-compatibility for loading version 1.2 of the .mesh format.
An animation container interface, which allows generic access to sibling animations.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.