OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Resource holding data about 3D mesh. More...
#include <OgreMesh.h>
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. More... | |
~Mesh () override | |
void | _calcBoundsFromVertexBuffer (VertexData *vertexData, AxisAlignedBox &outAABB, Real &outRadius, bool updateOnly=false) |
Calculates. More... | |
void | _compileBoneAssignments () |
Internal method, be called once to compile bone assignments into geometry buffer. More... | |
void | _computeBoneBoundingRadius () |
Compute the bone bounding radius by looking at the vertices, vertex-bone-assignments, and skeleton bind pose. More... | |
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). More... | |
virtual void | _dirtyState () |
Manually mark the state of this resource as having been changed. More... | |
virtual void | _fireLoadingComplete (bool wasBackgroundLoaded) |
Firing of loading complete event. More... | |
virtual void | _firePreparingComplete (bool wasBackgroundLoaded) |
Firing of preparing complete event. More... | |
virtual void | _fireUnloadingComplete () |
Firing of unloading complete event. More... | |
virtual Animation * | _getAnimationImpl (const String &name) const |
Internal access to the named vertex Animation object - returns null if it does not exist. More... | |
bool | _getAnimationTypesDirty () const |
Are the derived animation types out of date? More... | |
const LodValueArray * | _getLodValueArray () const |
unsigned | _getSubMeshIndex (const String &name) const |
Gets the index of a submesh with a given name. More... | |
void | _initAnimationState (AnimationStateSet *animSet) |
Initialise an animation set suitable for use with this mesh. More... | |
bool | _isManualLodLevel (unsigned short level) const |
Internal methods for loading LOD, do not use. More... | |
virtual void | _notifyOrigin (const String &origin) |
Notify this resource of it's origin. More... | |
void | _notifySkeleton (SkeletonPtr &pSkel) |
Internal notification, used to tell the Mesh which Skeleton to use without loading it. More... | |
unsigned short | _rationaliseBoneAssignments (size_t vertexCount, VertexBoneAssignmentList &assignments) |
Rationalises the passed in bone assignment list. More... | |
void | _refreshAnimationState (AnimationStateSet *animSet) |
Refresh an animation set suitable for use with this mesh. More... | |
void | _setBoneBoundingRadius (Real radius) |
Manually set the bone bounding radius. More... | |
void | _setBoundingSphereRadius (Real radius) |
Manually set the bounding radius. More... | |
void | _setBounds (const AxisAlignedBox &bounds, bool pad=true) |
Manually set the bounding box for this Mesh. More... | |
void | _setLodInfo (unsigned short numLevels) |
Internal methods for loading LOD, do not use. More... | |
void | _setLodUsage (unsigned short level, const MeshLodUsage &usage) |
Internal methods for loading LOD, do not use. More... | |
void | _setSubMeshLodFaceList (unsigned subIdx, unsigned short level, IndexData *facedata, bool casterPass) |
Internal methods for loading LOD, do not use. More... | |
void | _updateBoundsFromVertexBuffers (bool pad=false) |
Automatically update the bounding radius and bounding box for this Mesh. More... | |
void | _updateCompiledBoneAssignments () |
Internal method, be called once to update the compiled bone assignments. More... | |
void | addBoneAssignment (const VertexBoneAssignment &vertBoneAssign) |
Assigns a vertex to a bone with a given weight, for skeletal animation. More... | |
virtual void | addListener (Listener *lis) |
Register a listener on this resource. More... | |
void | arrangeEfficient (bool halfPos, bool halfTexCoords, bool qTangents) |
Rearranges the buffers in this Mesh so that they are more efficient for rendering with shaders. More... | |
void | buildEdgeList () |
Builds an edge list for this mesh, which can be used for generating a shadow volume among other things. More... | |
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. More... | |
virtual void | changeGroupOwnership (const String &newGroup) |
Change the resource group ownership of a Resource. More... | |
void | clearBoneAssignments () |
Removes all bone assignments for this mesh. More... | |
MeshPtr | clone (const String &newName, const String &newGroup=BLANKSTRING) |
Makes a copy of this mesh object and gives it a new name. More... | |
virtual void | copyParametersTo (StringInterface *dest) const |
Method for copying this object's parameters to another object. More... | |
Animation * | createAnimation (const String &name, Real length) override |
Creates a new Animation object for vertex animating this mesh. More... | |
void | createAzdoBuffers () |
Pose * | createPose (ushort target, const String &name=BLANKSTRING) |
Create a new Pose for this mesh or one of its submeshes. More... | |
SubMesh * | createSubMesh () |
Creates a new SubMesh. More... | |
SubMesh * | createSubMesh (const String &name) |
Creates a new SubMesh and gives it a name. More... | |
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. More... | |
void | destroyShadowMappingGeom () |
void | destroySubMesh (const String &name) |
Destroy a SubMesh with the given name. More... | |
void | destroySubMesh (unsigned index) |
Destroy a SubMesh with the given index. More... | |
virtual void | escalateLoading () |
Escalates the loading of a background loaded resource. More... | |
void | freeEdgeList () |
Destroys and frees the edge lists this mesh has built. More... | |
Animation * | getAnimation (const String &name) const override |
Returns the named vertex Animation object. More... | |
Animation * | getAnimation (unsigned short index) const override |
Gets a single morph animation by index. More... | |
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. More... | |
BoneAssignmentIterator | getBoneAssignmentIterator () |
Gets an iterator for access all bone assignments. More... | |
const VertexBoneAssignmentList & | getBoneAssignments () const |
Gets a const reference to the list of bone assignments. More... | |
Real | getBoneBoundingRadius () const |
Gets the radius used to inflate the bounding box around the bones. More... | |
Real | getBoundingSphereRadius () const |
Gets the radius of the bounding sphere surrounding this mesh. More... | |
const AxisAlignedBox & | getBounds () const |
Get the axis-aligned bounding box for this mesh. More... | |
virtual ResourceManager * | getCreator () |
Gets the manager which created this resource. More... | |
EdgeData * | getEdgeList (unsigned short lodIndex=0) |
Return the edge list for this mesh, building it if required. More... | |
const EdgeData * | getEdgeList (unsigned short lodIndex=0) const |
Return the edge list for this mesh, building it if required. More... | |
virtual const String & | getGroup () const |
Gets the group which this resource is a member of. More... | |
virtual ResourceHandle | getHandle () const |
HardwareBufferManagerBase * | getHardwareBufferManager () |
const uint64 * | getHashForCaches () const |
Returns an array of [2] containing a hash for use in caches. More... | |
HardwareBuffer::Usage | getIndexBufferUsage () const |
Gets the usage setting for this meshes index buffers. More... | |
virtual LoadingState | getLoadingState () const |
Returns the current loading state. More... | |
ushort | getLodIndex (Real value) const |
Retrieves the level of detail index for the given LOD value. More... | |
const MeshLodUsage & | getLodLevel (ushort index) const |
Gets details of the numbered level of detail entry. More... | |
const String & | getLodStrategyName () const |
Returns the name of the Lod strategy the user lod values have been calibrated for. More... | |
virtual const String & | getName () const |
Gets resource name. More... | |
unsigned short | getNumAnimations () const override |
Gets the number of morph animations in this mesh. More... | |
ushort | getNumLodLevels () const |
Returns the number of levels of detail that this mesh supports. More... | |
unsigned | getNumSubMeshes () const |
Gets the number of sub meshes which comprise this mesh. More... | |
const SkeletonPtr & | getOldSkeleton () const |
Gets a pointer to any linked Skeleton. More... | |
virtual const String & | getOrigin () const |
Get the origin of this resource, e.g. More... | |
ParamDictionary * | getParamDictionary () |
Retrieves the parameter dictionary for this class. More... | |
const ParamDictionary * | getParamDictionary () const |
virtual String | getParameter (const String &name) const |
Generic parameter retrieval method. More... | |
const ParameterList & | getParameters () const |
Retrieves a list of parameters valid for this object. More... | |
Pose * | getPose (const String &name) |
Retrieve an existing Pose by name. More... | |
Pose * | getPose (ushort index) |
Retrieve an existing Pose by index. More... | |
size_t | getPoseCount () const |
Get the number of poses. More... | |
PoseIterator | getPoseIterator () |
Get an iterator over all the poses defined. More... | |
ConstPoseIterator | getPoseIterator () const |
Get an iterator over all the poses defined. More... | |
const PoseList & | getPoseList () const |
Get pose list. More... | |
bool | getSharedVertexDataAnimationIncludesNormals () const |
Returns whether animation on shared vertex data includes normals. More... | |
virtual VertexAnimationType | getSharedVertexDataAnimationType () const |
Gets the type of vertex animation the shared vertex data of this mesh supports. More... | |
virtual size_t | getSize () const |
Retrieves info about the size of the resource. More... | |
const SkeletonDefPtr & | getSkeleton () const |
const String & | getSkeletonName () const |
Gets the name of any linked Skeleton. More... | |
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. More... | |
SubMesh * | getSubMesh (const String &name) const |
Gets a SubMesh by name. More... | |
SubMesh * | getSubMesh (unsigned index) const |
Gets a pointer to the submesh indicated by the index. More... | |
SubMeshIterator | getSubMeshIterator () |
Gets an iterator over the available submeshes. More... | |
const SubMeshNameMap & | getSubMeshNameMap () const |
Gets a reference to the optional name assignments of the SubMeshes. More... | |
HardwareBuffer::Usage | getVertexBufferUsage () const |
Gets the usage setting for this meshes vertex buffers. More... | |
VertexData * | getVertexDataByTrackHandle (unsigned short handle) |
Gets a pointer to a vertex data element based on a morph animation track handle. More... | |
bool | hasAnimation (const String &name) const override |
Returns whether this mesh contains the named vertex animation. More... | |
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. More... | |
bool | hasManualLodLevel () const |
Returns true if this mesh has a manual LOD level. More... | |
bool | hasSkeleton () const |
Returns true if this Mesh has a linked Skeleton. More... | |
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. More... | |
bool | hasVertexAnimation () const |
Returns whether or not this mesh has some kind of vertex animation. More... | |
void | importV2 (Ogre::Mesh *mesh) |
Converts a v2 mesh back to v1. More... | |
virtual bool | isBackgroundLoaded () const |
Returns whether this Resource has been earmarked for background loading. More... | |
bool | isEdgeListBuilt () const |
Returns whether this mesh has an attached edge list. More... | |
bool | isIndexBufferShadowed () const |
Gets whether or not this meshes index buffers are shadowed. More... | |
virtual bool | isLoaded () const |
Returns true if the Resource has been loaded, false otherwise. More... | |
virtual bool | isLoading () const |
Returns whether the resource is currently in the process of background loading. More... | |
virtual bool | isManuallyLoaded () const |
Is this resource manually loaded? More... | |
virtual bool | isPrepared () const |
Returns true if the Resource has been prepared, false otherwise. More... | |
bool | isPreparedForShadowVolumes () const |
Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes. More... | |
virtual bool | isReloadable () const |
Returns true if the Resource is reloadable, false otherwise. More... | |
bool | isVertexBufferShadowed () const |
Gets whether or not this meshes vertex buffers are shadowed. More... | |
virtual void | load (bool backgroundThread=false) |
Loads the resource, if it is not already. More... | |
bool | markForReload () |
void | mergeAdjacentTexcoords (unsigned short finalTexCoordSet, unsigned short texCoordSetToDestroy) |
This method collapses two texcoords into one for all submeshes where this is possible. More... | |
void | nameSubMesh (const String &name, unsigned index) |
Gives a name to a SubMesh. More... | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
virtual void | prepare (bool backgroundThread=false) |
Prepares the resource for load, if it is not already. More... | |
void | prepareForShadowMapping (bool forceSameBuffers) |
void | prepareForShadowVolume () |
This method prepares the mesh for generating a renderable shadow volume. More... | |
void | reload (LoadingFlags flags=LF_DEFAULT) override |
Reloads the resource, if it is already loaded. More... | |
virtual void | removeAllAnimations () |
Removes all morph Animations from this mesh. More... | |
void | removeAllPoses () |
Destroy all poses. More... | |
void | removeAnimation (const String &name) override |
Removes vertex Animation from this mesh. More... | |
virtual void | removeListener (Listener *lis) |
Remove a listener on this resource. More... | |
void | removeLodLevels () |
Removes all LOD data from this Mesh. More... | |
void | removePose (const String &name) |
Destroy a pose by name. More... | |
void | removePose (ushort index) |
Destroy a pose by index. More... | |
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. More... | |
virtual void | setBackgroundLoaded (bool bl) |
Tells the resource whether it is background loaded or not. More... | |
void | setHardwareBufferManager (HardwareBufferManagerBase *bufferManager) |
Sets the manager for the vertex and index buffers to be used when loading this Mesh. More... | |
void | setIndexBufferPolicy (HardwareBuffer::Usage usage, bool shadowBuffer=false) |
Sets the policy for the index buffers to be used when loading this Mesh. More... | |
void | setLodStrategyName (const String &name) |
virtual void | setManuallyLoaded (bool isManual) |
Set "Is this resource manually loaded?". More... | |
virtual bool | setParameter (const String &name, const String &value) |
Generic parameter setting method. More... | |
virtual void | setParameterList (const NameValuePairList ¶mList) |
Generic multiple parameter setting method. More... | |
void | setSkeletonName (const String &skelName) |
Sets the name of the skeleton this Mesh uses for animation. More... | |
virtual void | setToLoaded () |
Change the Resource loading state to loaded. More... | |
void | setVertexBufferPolicy (HardwareBuffer::Usage usage, bool shadowBuffer=false) |
Sets the policy for the vertex buffers to be used when loading this Mesh. More... | |
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. More... | |
virtual void | touch () |
'Touches' the resource to indicate it has been used. More... | |
virtual void | unload () |
Unloads the resource; this is not permanent, the resource can be reloaded later if required. More... | |
void | unnameSubMesh (const String &name) |
Removes a name from a SubMesh. More... | |
void | updateManualLodLevel (ushort index, const String &meshName) |
Changes the alternate mesh to use as a manual LOD at the given index. More... | |
void | updateMaterialForAllSubMeshes () |
Iterates through all submeshes and requests them to apply their texture aliases to the material they use. More... | |
Static Public Member Functions | |
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. More... | |
static void | prepareMatricesForVertexBlend (const Matrix4 **blendMatrices, const Matrix4 *boneMatrices, const IndexMap &indexMap) |
Prepare matrices for software indexed vertex blend. More... | |
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. More... | |
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. More... | |
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. More... | |
Public Attributes | |
OGRE_AUTO_MUTEX | |
IndexMap | sharedBlendIndexToBoneIndexMap |
Shared index map for translating blend index to bone index. More... | |
VertexData * | sharedVertexData [NumVertexPass] |
Shared vertex data. More... | |
Static Public Attributes | |
static bool | msOptimizeForShadowMapping |
Friends | |
class | MeshSerializerImpl |
class | MeshSerializerImpl_v1_1 |
class | MeshSerializerImpl_v1_10 |
class | MeshSerializerImpl_v1_2 |
class | MeshSerializerImpl_v1_3 |
class | MeshSerializerImpl_v1_4 |
class | MeshSerializerImpl_v1_8 |
class | SubMesh |
Resource holding data about 3D mesh.
typedef FastArray<unsigned short> Ogre::v1::Mesh::IndexMap |
typedef FastArray<Real> Ogre::v1::Mesh::LodValueArray |
typedef vector<MeshLodUsage>::type Ogre::v1::Mesh::MeshLodUsageList |
typedef vector<SubMesh*>::type Ogre::v1::Mesh::SubMeshList |
typedef unordered_map<String, ushort>::type Ogre::v1::Mesh::SubMeshNameMap |
typedef multimap<size_t, VertexBoneAssignment>::type Ogre::v1::Mesh::VertexBoneAssignmentList |
Multimap of vertex bone assignments (orders by vertex index).
|
inherited |
Enum that allow to choose subset of unloaded/reloaded resources and to adjust reloading behavior.
|
inherited |
Enum identifying the loading state of the resource.
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.
|
override |
void Ogre::v1::Mesh::_calcBoundsFromVertexBuffer | ( | VertexData * | vertexData, |
AxisAlignedBox & | outAABB, | ||
Real & | outRadius, | ||
bool | updateOnly = false |
||
) |
Calculates.
void Ogre::v1::Mesh::_compileBoneAssignments | ( | ) |
Internal method, be called once to compile bone assignments into geometry buffer.
void Ogre::v1::Mesh::_computeBoneBoundingRadius | ( | ) |
Compute the bone bounding radius by looking at the vertices, vertex-bone-assignments, and skeleton bind pose.
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).
|
virtualinherited |
Manually mark the state of this resource as having been changed.
|
virtualinherited |
Firing of loading complete event.
wasBackgroundLoaded | Whether this was a background loaded event |
|
virtualinherited |
Firing of preparing complete event.
wasBackgroundLoaded | Whether this was a background loaded event |
|
virtualinherited |
Firing of unloading complete event.
Internal access to the named vertex Animation object - returns null if it does not exist.
name | The name of the animation. |
|
inline |
Are the derived animation types out of date?
|
inline |
unsigned Ogre::v1::Mesh::_getSubMeshIndex | ( | const String & | name | ) | const |
Gets the index of a submesh with a given name.
void Ogre::v1::Mesh::_initAnimationState | ( | AnimationStateSet * | animSet | ) |
Initialise an animation set suitable for use with this mesh.
bool Ogre::v1::Mesh::_isManualLodLevel | ( | unsigned short | level | ) | const |
Internal methods for loading LOD, do not use.
|
inlinevirtualinherited |
Notify this resource of it's origin.
void Ogre::v1::Mesh::_notifySkeleton | ( | SkeletonPtr & | pSkel | ) |
unsigned short Ogre::v1::Mesh::_rationaliseBoneAssignments | ( | size_t | vertexCount, |
VertexBoneAssignmentList & | assignments | ||
) |
Rationalises the passed in bone assignment list.
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. |
void Ogre::v1::Mesh::_refreshAnimationState | ( | AnimationStateSet * | animSet | ) |
Refresh an animation set suitable for use with this mesh.
void Ogre::v1::Mesh::_setBoneBoundingRadius | ( | Real | radius | ) |
Manually set the bone bounding radius.
void Ogre::v1::Mesh::_setBoundingSphereRadius | ( | Real | radius | ) |
Manually set the bounding radius.
void Ogre::v1::Mesh::_setBounds | ( | const AxisAlignedBox & | bounds, |
bool | pad = true |
||
) |
Manually set the bounding box for this Mesh.
pad | If true, a certain padding will be added to the bounding box to separate it from the mesh |
void Ogre::v1::Mesh::_setLodInfo | ( | unsigned short | numLevels | ) |
Internal methods for loading LOD, do not use.
void Ogre::v1::Mesh::_setLodUsage | ( | unsigned short | level, |
const MeshLodUsage & | usage | ||
) |
Internal methods for loading LOD, do not use.
void Ogre::v1::Mesh::_setSubMeshLodFaceList | ( | unsigned | subIdx, |
unsigned short | level, | ||
IndexData * | facedata, | ||
bool | casterPass | ||
) |
Internal methods for loading LOD, do not use.
void Ogre::v1::Mesh::_updateBoundsFromVertexBuffers | ( | bool | pad = false | ) |
Automatically update the bounding radius and bounding box for this Mesh.
pad | If true, a certain padding will be added to the bounding box to separate it from the mesh |
void Ogre::v1::Mesh::_updateCompiledBoneAssignments | ( | ) |
Internal method, be called once to update the compiled bone assignments.
void Ogre::v1::Mesh::addBoneAssignment | ( | const VertexBoneAssignment & | vertBoneAssign | ) |
Assigns a vertex to a bone with a given weight, for skeletal animation.
|
virtualinherited |
Register a listener on this resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
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.
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).
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). |
void Ogre::v1::Mesh::buildEdgeList | ( | ) |
Builds an edge list for this mesh, which can be used for generating a shadow volume among other things.
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.
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). |
splitRotated | Sets whether or not to split vertices when a rotated tangent space is detected. |
storeParityInW | If true , store tangents as a 4-vector and include parity in w. |
|
virtualinherited |
Change the resource group ownership of a Resource.
newGroup | Name of the new group |
|
staticinherited |
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.
MaterialManager) initializes.
void Ogre::v1::Mesh::clearBoneAssignments | ( | ) |
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.
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. |
|
inlinevirtualinherited |
Method for copying this object's parameters to another object.
dest | Pointer to object to have it's parameters set the same as this object. |
References Ogre::StringInterface::setParameter().
Creates a new Animation object for vertex animating this mesh.
name | The name of this animation. |
length | The length of the animation in seconds. |
Implements Ogre::v1::AnimationContainer.
void Ogre::v1::Mesh::createAzdoBuffers | ( | ) |
Pose* Ogre::v1::Mesh::createPose | ( | ushort | target, |
const String & | name = BLANKSTRING |
||
) |
SubMesh* Ogre::v1::Mesh::createSubMesh | ( | ) |
Creates a new SubMesh.
Creates a new SubMesh and gives it a name.
Note, only first 65536 submeshes could be named.
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.
void Ogre::v1::Mesh::destroyShadowMappingGeom | ( | ) |
void Ogre::v1::Mesh::destroySubMesh | ( | const String & | name | ) |
void Ogre::v1::Mesh::destroySubMesh | ( | unsigned | index | ) |
|
virtualinherited |
Escalates the loading of a background loaded resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
void Ogre::v1::Mesh::freeEdgeList | ( | ) |
Destroys and frees the edge lists this mesh has built.
Returns the named vertex Animation object.
name | The name of the animation. |
Implements Ogre::v1::AnimationContainer.
|
overridevirtual |
Gets a single morph animation by index.
Implements Ogre::v1::AnimationContainer.
|
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.
BoneAssignmentIterator Ogre::v1::Mesh::getBoneAssignmentIterator | ( | ) |
Gets an iterator for access all bone assignments.
|
inline |
Gets a const reference to the list of bone assignments.
Referenced by Ogre::VerticesRemapInfo::performBoneAssignmentRemap().
Real Ogre::v1::Mesh::getBoneBoundingRadius | ( | ) | const |
Gets the radius used to inflate the bounding box around the bones.
Real Ogre::v1::Mesh::getBoundingSphereRadius | ( | ) | const |
Gets the radius of the bounding sphere surrounding this mesh.
const AxisAlignedBox& Ogre::v1::Mesh::getBounds | ( | ) | const |
Get the axis-aligned bounding box for this mesh.
|
inlinevirtualinherited |
Gets the manager which created this resource.
EdgeData* Ogre::v1::Mesh::getEdgeList | ( | unsigned short | lodIndex = 0 | ) |
Return the edge list for this mesh, building it if required.
lodIndex | The LOD at which to get the edge list, 0 being the highest. |
const EdgeData* Ogre::v1::Mesh::getEdgeList | ( | unsigned short | lodIndex = 0 | ) | const |
Return the edge list for this mesh, building it if required.
lodIndex | The LOD at which to get the edge list, 0 being the highest. |
|
inlinevirtualinherited |
Gets the group which this resource is a member of.
Reimplemented in Ogre::v1::OldSkeletonInstance.
|
inlinevirtualinherited |
Reimplemented in Ogre::v1::OldSkeletonInstance.
HardwareBufferManagerBase* Ogre::v1::Mesh::getHardwareBufferManager | ( | ) |
|
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
|
inline |
Gets the usage setting for this meshes index buffers.
|
inlinevirtualinherited |
Returns the current loading state.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
References Ogre::AtomicScalar< T >::get().
Retrieves the level of detail index for the given LOD value.
const MeshLodUsage& Ogre::v1::Mesh::getLodLevel | ( | ushort | index | ) | const |
Gets details of the numbered level of detail entry.
|
inline |
Returns the name of the Lod strategy the user lod values have been calibrated for.
|
inlinevirtualinherited |
Gets resource name.
Reimplemented in Ogre::v1::OldSkeletonInstance.
Referenced by Ogre::GpuProgramUsage::getProgramName().
|
overridevirtual |
Gets the number of morph animations in this mesh.
Implements Ogre::v1::AnimationContainer.
ushort Ogre::v1::Mesh::getNumLodLevels | ( | ) | const |
Returns the number of levels of detail that this mesh supports.
unsigned Ogre::v1::Mesh::getNumSubMeshes | ( | ) | const |
Gets the number of sub meshes which comprise this mesh.
const SkeletonPtr& Ogre::v1::Mesh::getOldSkeleton | ( | ) | const |
Gets a pointer to any linked Skeleton.
|
inlinevirtualinherited |
Get the origin of this resource, e.g.
a script file name.
|
inlineinherited |
Retrieves the parameter dictionary for this class.
|
inlineinherited |
|
inlinevirtualinherited |
Generic parameter retrieval method.
name | The name of the parameter to get |
References Ogre::ParamCommand::doGet().
|
inherited |
Retrieves a list of parameters valid for this object.
|
inline |
Get the number of poses.
PoseIterator Ogre::v1::Mesh::getPoseIterator | ( | ) |
Get an iterator over all the poses defined.
ConstPoseIterator Ogre::v1::Mesh::getPoseIterator | ( | ) | const |
Get an iterator over all the poses defined.
const PoseList& Ogre::v1::Mesh::getPoseList | ( | ) | const |
Get pose list.
|
inline |
Returns whether animation on shared vertex data includes normals.
|
virtual |
Gets the type of vertex animation the shared vertex data of this mesh supports.
|
inlinevirtualinherited |
Retrieves info about the size of the resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
|
inline |
|
inlinevirtualinherited |
Returns the number of times this resource has changed state, which generally means the number of times it has been loaded.
Objects that build derived data based on the resource can check this value against a copy they kept last time they built this derived data, in order to know whether it needs rebuilding. This is a nice way of monitoring changes without having a tightly-bound callback.
SubMesh* Ogre::v1::Mesh::getSubMesh | ( | unsigned | index | ) | const |
Gets a pointer to the submesh indicated by the index.
|
inline |
Gets an iterator over the available submeshes.
|
inline |
Gets a reference to the optional name assignments of the SubMeshes.
|
inline |
Gets the usage setting for this meshes vertex buffers.
VertexData* Ogre::v1::Mesh::getVertexDataByTrackHandle | ( | unsigned short | handle | ) |
Gets a pointer to a vertex data element based on a morph animation track handle.
|
overridevirtual |
Returns whether this mesh contains the named vertex animation.
Implements Ogre::v1::AnimationContainer.
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.
|
inline |
Returns true if this mesh has a manual LOD level.
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.
bool Ogre::v1::Mesh::hasVertexAnimation | ( | ) | const |
Returns whether or not this mesh has some kind of vertex animation.
void Ogre::v1::Mesh::importV2 | ( | Ogre::Mesh * | mesh | ) |
Converts a v2 mesh back to v1.
|
inlinevirtualinherited |
Returns whether this Resource has been earmarked for background loading.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
|
inline |
Returns whether this mesh has an attached edge list.
|
inline |
Gets whether or not this meshes index buffers are shadowed.
|
inlinevirtualinherited |
Returns true if the Resource has been loaded, false otherwise.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
References Ogre::AtomicScalar< T >::get().
|
inlinevirtualinherited |
Returns whether the resource is currently in the process of background loading.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
References Ogre::AtomicScalar< T >::get().
|
inlinevirtualinherited |
Is this resource manually loaded?
|
inlinevirtualinherited |
Returns true if the Resource has been prepared, false otherwise.
References Ogre::AtomicScalar< T >::get().
|
inline |
Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes.
|
inlinevirtualinherited |
Returns true if the Resource is reloadable, false otherwise.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
|
inline |
Gets whether or not this meshes vertex buffers are shadowed.
|
virtualinherited |
Loads the resource, if it is not already.
backgroundThread | Indicates whether the caller of this method is the background resource loading thread. |
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
|
inlineinherited |
References Ogre::AtomicScalar< T >::cas().
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.
finalTexCoordSet & texCoordSetToDestroy must be in the same buffer source, and must be adjacent.
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. |
void Ogre::v1::Mesh::nameSubMesh | ( | const String & | name, |
unsigned | index | ||
) |
Gives a name to a SubMesh.
Note, only first 65536 submeshes could be named.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
virtualinherited |
Prepares the resource for load, if it is not already.
One can call prepare() before load(), but this is not required as load() will call prepare() itself, if needed. When OGRE_THREAD_SUPPORT==1 both load() and prepare() are thread-safe. When OGRE_THREAD_SUPPORT==2 however, only prepare() is thread-safe. The reason for this function is to allow a background thread to do some of the loading work, without requiring the whole render system to be thread-safe. The background thread would call prepare() while the main render loop would later call load(). So long as prepare() remains thread-safe, subclasses can arbitrarily split the work of loading a resource between load() and prepare(). It is best to try and do as much work in prepare(), however, since this will leave less work for the main render thread to do and thus increase FPS.
backgroundThread | Whether this is occurring in a background thread |
void Ogre::v1::Mesh::prepareForShadowMapping | ( | bool | forceSameBuffers | ) |
void Ogre::v1::Mesh::prepareForShadowVolume | ( | ) |
This method prepares the mesh for generating a renderable shadow volume.
|
static |
Prepare matrices for software indexed vertex blend.
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. |
|
overridevirtual |
Reloads the resource, if it is already loaded.
Reimplemented from Ogre::Resource.
|
virtual |
Removes all morph Animations from this mesh.
void Ogre::v1::Mesh::removeAllPoses | ( | ) |
Destroy all poses.
|
overridevirtual |
Removes vertex Animation from this mesh.
Implements Ogre::v1::AnimationContainer.
|
virtualinherited |
Remove a listener on this resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
void Ogre::v1::Mesh::removeLodLevels | ( | ) |
Removes all LOD data from this Mesh.
void Ogre::v1::Mesh::removePose | ( | const String & | name | ) |
Destroy a pose by name.
void Ogre::v1::Mesh::removePose | ( | ushort | index | ) |
Destroy a pose by index.
|
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.
|
inlinevirtualinherited |
Tells the resource whether it is background loaded or not.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
|
inline |
Sets the manager for the vertex and index buffers to be used when loading this Mesh.
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. |
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.
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. |
|
inline |
|
inlinevirtualinherited |
Set "Is this resource manually loaded?".
|
virtualinherited |
Generic parameter setting method.
name | The name of the parameter to set |
value | String value. Must be in the right format for the type specified in the parameter definition. See the StringConverter class for more information. |
Referenced by Ogre::StringInterface::copyParametersTo().
|
virtualinherited |
Generic multiple parameter setting method.
paramList | Name/value pair list |
void Ogre::v1::Mesh::setSkeletonName | ( | const String & | skelName | ) |
Sets the name of the skeleton this Mesh uses for animation.
skelName | The name of the .skeleton file to use, or an empty string to use no skeleton |
|
inlinevirtualinherited |
Change the Resource loading state to loaded.
References Ogre::AtomicScalar< T >::set().
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.
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. |
|
static |
Performs a software indexed vertex blend, of the kind used for skeletal animation although it can be used for other purposes.
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. |
|
static |
Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes.
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 |
|
static |
Performs a software vertex pose blend, of the kind used for morph animation although it can be used for other purposes.
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. |
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.
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 |
|
virtualinherited |
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram, and Ogre::Material.
Referenced by Ogre::Material::touch().
|
virtualinherited |
Unloads the resource; this is not permanent, the resource can be reloaded later if required.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram.
Changes the alternate mesh to use as a manual LOD at the given index.
index | The index of the level to be changed. |
meshName | The name of the mesh which will be the lower level detail version. |
void Ogre::v1::Mesh::updateMaterialForAllSubMeshes | ( | ) |
Iterates through all submeshes and requests them to apply their texture aliases to the material they use.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
|
inherited |
IndexMap Ogre::v1::Mesh::sharedBlendIndexToBoneIndexMap |
Shared index map for translating blend index to bone index.
VertexData* Ogre::v1::Mesh::sharedVertexData[NumVertexPass] |
Shared vertex data.