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