OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::v1::PatchMesh Class Reference

Patch specialisation of Mesh. More...

#include <OgrePatchMesh.h>

+ Inheritance diagram for Ogre::v1::PatchMesh:

Public Member Functions

 PatchMesh (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group)
 Constructor. More...
 
void define (void *controlPointBuffer, VertexDeclaration *declaration, size_t width, size_t height, size_t uMaxSubdivisionLevel=(size_t) PatchSurface::AUTO_LEVEL, size_t vMaxSubdivisionLevel=(size_t) PatchSurface::AUTO_LEVEL, PatchSurface::VisibleSide visibleSide=PatchSurface::VS_FRONT, HardwareBuffer::Usage vbUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage ibUsage=HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, bool vbUseShadow=false, bool ibUseShadow=false)
 Define the patch, as defined in MeshManager::createBezierPatch. More...
 
void setSubdivision (Real factor)
 
void update (void *controlPointBuffer, size_t width, size_t height, size_t uMaxSubdivisionLevel, size_t vMaxSubdivisionLevel, PatchSurface::VisibleSide visibleSide)
 Update the mesh with new control points positions. More...
 
- Public Member Functions inherited from 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. 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 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...
 
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...
 
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...
 
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...
 
AnimationcreateAnimation (const String &name, Real length) override
 Creates a new Animation object for vertex animating this mesh. More...
 
void createAzdoBuffers ()
 
PosecreatePose (ushort target, const String &name=BLANKSTRING)
 Create a new Pose for this mesh or one of its submeshes. More...
 
SubMeshcreateSubMesh ()
 Creates a new SubMesh. More...
 
SubMeshcreateSubMesh (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...
 
void freeEdgeList ()
 Destroys and frees the edge lists this mesh has built. More...
 
AnimationgetAnimation (const String &name) const override
 Returns the named vertex Animation object. More...
 
AnimationgetAnimation (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 VertexBoneAssignmentListgetBoneAssignments () 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 AxisAlignedBoxgetBounds () const
 Get the axis-aligned bounding box for this mesh. More...
 
EdgeDatagetEdgeList (unsigned short lodIndex=0)
 Return the edge list for this mesh, building it if required. More...
 
const EdgeDatagetEdgeList (unsigned short lodIndex=0) const
 Return the edge list for this mesh, building it if required. More...
 
HardwareBufferManagerBasegetHardwareBufferManager ()
 
const uint64getHashForCaches () 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...
 
ushort getLodIndex (Real value) const
 Retrieves the level of detail index for the given LOD value. More...
 
const MeshLodUsagegetLodLevel (ushort index) const
 Gets details of the numbered level of detail entry. More...
 
const StringgetLodStrategyName () const
 Returns the name of the Lod strategy the user lod values have been calibrated for. 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 SkeletonPtrgetOldSkeleton () const
 Gets a pointer to any linked Skeleton. More...
 
PosegetPose (const String &name)
 Retrieve an existing Pose by name. More...
 
PosegetPose (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 PoseListgetPoseList () 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...
 
const SkeletonDefPtrgetSkeleton () const
 
const StringgetSkeletonName () const
 Gets the name of any linked Skeleton. More...
 
SubMeshgetSubMesh (const String &name) const
 Gets a SubMesh by name. More...
 
SubMeshgetSubMesh (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 SubMeshNameMapgetSubMeshNameMap () 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...
 
VertexDatagetVertexDataByTrackHandle (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...
 
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...
 
bool isPreparedForShadowVolumes () const
 Returns whether this mesh has already had it's geometry prepared for use in rendering shadow volumes. More...
 
bool isVertexBufferShadowed () const
 Gets whether or not this meshes vertex buffers are shadowed. More...
 
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 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...
 
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...
 
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)
 
void setSkeletonName (const String &skelName)
 Sets the name of the skeleton this Mesh uses for animation. 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...
 
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...
 
- Public Member Functions inherited from Ogre::Resource
 Resource (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
 Standard constructor. More...
 
virtual ~Resource ()
 Virtual destructor. 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 void _notifyOrigin (const String &origin)
 Notify this resource of it's origin. More...
 
virtual void addListener (Listener *lis)
 Register a listener on this resource. More...
 
virtual void changeGroupOwnership (const String &newGroup)
 Change the resource group ownership of a Resource. More...
 
virtual void escalateLoading ()
 Escalates the loading of a background loaded resource. More...
 
virtual ResourceManagergetCreator ()
 Gets the manager which created this resource. More...
 
virtual const StringgetGroup () const
 Gets the group which this resource is a member of. More...
 
virtual ResourceHandle getHandle () const
 
virtual LoadingState getLoadingState () const
 Returns the current loading state. More...
 
virtual const StringgetName () const
 Gets resource name. More...
 
virtual const StringgetOrigin () const
 Get the origin of this resource, e.g. More...
 
virtual size_t getSize () const
 Retrieves info about the size of the resource. 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...
 
virtual bool isBackgroundLoaded () const
 Returns whether this Resource has been earmarked for background loading. 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...
 
virtual bool isReloadable () const
 Returns true if the Resource is reloadable, false otherwise. More...
 
virtual void load (bool backgroundThread=false)
 Loads the resource, if it is not already. More...
 
bool markForReload ()
 
virtual void prepare (bool backgroundThread=false)
 Prepares the resource for load, if it is not already. More...
 
virtual void removeListener (Listener *lis)
 Remove a listener on this resource. More...
 
virtual void setBackgroundLoaded (bool bl)
 Tells the resource whether it is background loaded or not. More...
 
virtual void setManuallyLoaded (bool isManual)
 Set "Is this resource manually loaded?". More...
 
virtual void setToLoaded ()
 Change the Resource loading state to loaded. 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...
 
- Public Member Functions inherited from Ogre::StringInterface
 StringInterface ()
 
virtual ~StringInterface ()
 Virtual destructor, see Effective C++. More...
 
virtual void copyParametersTo (StringInterface *dest) const
 Method for copying this object's parameters to another object. More...
 
ParamDictionarygetParamDictionary ()
 Retrieves the parameter dictionary for this class. More...
 
const ParamDictionarygetParamDictionary () const
 
virtual String getParameter (const String &name) const
 Generic parameter retrieval method. More...
 
const ParameterListgetParameters () const
 Retrieves a list of parameters valid for this object. More...
 
virtual bool setParameter (const String &name, const String &value)
 Generic parameter setting method. More...
 
virtual void setParameterList (const NameValuePairList &paramList)
 Generic multiple parameter setting method. More...
 
- Public Member Functions inherited from Ogre::v1::AnimationContainer
virtual ~AnimationContainer ()
 

Additional Inherited Members

- Public Types inherited from Ogre::v1::Mesh
typedef MapIterator< VertexBoneAssignmentListBoneAssignmentIterator
 
typedef ConstVectorIterator< PoseListConstPoseIterator
 
typedef FastArray< unsigned short > IndexMap
 
typedef FastArray< RealLodValueArray
 
typedef vector< MeshLodUsage >::type MeshLodUsageList
 
typedef VectorIterator< PoseListPoseIterator
 
typedef VectorIterator< SubMeshListSubMeshIterator
 
typedef vector< SubMesh * >::type SubMeshList
 
typedef unordered_map< String, ushort >::type SubMeshNameMap
 A hashmap used to store optional SubMesh names. More...
 
typedef multimap< size_t, VertexBoneAssignment >::type VertexBoneAssignmentList
 Multimap of vertex bone assignments (orders by vertex index). More...
 
- Public Types inherited from Ogre::Resource
enum  LoadingFlags {
  LF_DEFAULT = 0 , LF_INCLUDE_NON_RELOADABLE = 1 , LF_ONLY_UNREFERENCED = 2 , LF_ONLY_UNREFERENCED_INCLUDE_NON_RELOADABLE = 3 ,
  LF_PRESERVE_STATE = 4 , LF_MARKED_FOR_RELOAD = 8
}
 Enum that allow to choose subset of unloaded/reloaded resources and to adjust reloading behavior. More...
 
enum  LoadingState {
  LOADSTATE_UNLOADED , LOADSTATE_LOADING , LOADSTATE_LOADED , LOADSTATE_UNLOADING ,
  LOADSTATE_PREPARED , LOADSTATE_PREPARING , LOADSTATE_UNLOADED_MARKED_FOR_RELOAD
}
 Enum identifying the loading state of the resource. More...
 
- Static Public Member Functions inherited from Ogre::v1::Mesh
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...
 
- Static Public Member Functions inherited from Ogre::StringInterface
static void cleanupDictionary ()
 Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. More...
 
- Public Attributes inherited from Ogre::v1::Mesh
IndexMap sharedBlendIndexToBoneIndexMap
 Shared index map for translating blend index to bone index. More...
 
VertexDatasharedVertexData [NumVertexPass]
 Shared vertex data. More...
 
- Public Attributes inherited from Ogre::Resource
 OGRE_AUTO_MUTEX
 
- Static Public Attributes inherited from Ogre::v1::Mesh
static bool msOptimizeForShadowMapping
 When this bool is false, prepareForShadowMapping will use the same Vaos for both regular and shadow mapping rendering. More...
 

Detailed Description

Patch specialisation of Mesh.

Remarks
Instances of this class should be created by calling MeshManager::createBezierPatch.

Constructor & Destructor Documentation

◆ PatchMesh()

Ogre::v1::PatchMesh::PatchMesh ( ResourceManager creator,
const String name,
ResourceHandle  handle,
const String group 
)

Constructor.

Member Function Documentation

◆ define()

void Ogre::v1::PatchMesh::define ( void *  controlPointBuffer,
VertexDeclaration declaration,
size_t  width,
size_t  height,
size_t  uMaxSubdivisionLevel = (size_t) PatchSurface::AUTO_LEVEL,
size_t  vMaxSubdivisionLevel = (size_t) PatchSurface::AUTO_LEVEL,
PatchSurface::VisibleSide  visibleSide = PatchSurface::VS_FRONT,
HardwareBuffer::Usage  vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
HardwareBuffer::Usage  ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
bool  vbUseShadow = false,
bool  ibUseShadow = false 
)

Define the patch, as defined in MeshManager::createBezierPatch.

◆ setSubdivision()

void Ogre::v1::PatchMesh::setSubdivision ( Real  factor)

◆ update()

void Ogre::v1::PatchMesh::update ( void *  controlPointBuffer,
size_t  width,
size_t  height,
size_t  uMaxSubdivisionLevel,
size_t  vMaxSubdivisionLevel,
PatchSurface::VisibleSide  visibleSide 
)

Update the mesh with new control points positions.


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