Ignition Rendering

API Reference

5.0.0

#include <BaseMesh.hh>

Public Member Functions

virtual ~BaseMesh ()
 
virtual void Destroy () override
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
virtual bool HasSkeleton () const override
 Check whether the mesh has skeleton. More...
 
virtual bool HasSubMesh (ConstSubMeshPtr _subMesh) const override
 Determine if has given sub-mesh. More...
 
virtual bool HasSubMeshName (const std::string &_name) const override
 Determine if has sub-mesh with given name. More...
 
virtual MaterialPtr Material () const override
 Get the material of this geometry. More...
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual void SetMaterial (const std::string &_name, bool _unique=true) override
 Set the materials of this Geometry. The specified material will be retrieved from the parent Scene. If no material is registered by the given name, no work will be done. More...
 
virtual void SetMaterial (MaterialPtr _material, bool _unique=true) override
 Set the materials of this Geometry. More...
 
virtual void SetSkeletonAnimationEnabled (const std::string &_name, bool _enabled, bool _loop=true, float _weight=1.0) override
 Set whether a skeleton animation should be enabled or not. More...
 
virtual void SetSkeletonLocalTransforms (const std::map< std::string, math::Matrix4d > &) override
 Set transforms for the skeleton. More...
 
virtual void SetSkeletonWeights (const std::unordered_map< std::string, float > &) override
 Set skeleton node weight. More...
 
virtual bool SkeletonAnimationEnabled (const std::string &_name) const override
 Get whether a skeleton animation is enabled or not. More...
 
virtual std::map< std::string, math::Matrix4dSkeletonLocalTransforms () const override
 Get the skeleton local transforms. More...
 
virtual std::unordered_map< std::string, float > SkeletonWeights () const override
 Get skeleton node weight. More...
 
virtual SubMeshPtr SubMeshByIndex (unsigned int _index) const override
 Get sub-mesh at given index. More...
 
virtual SubMeshPtr SubMeshByName (const std::string &_name) const override
 Get sub-mesh with given name. More...
 
virtual unsigned int SubMeshCount () const override
 Get the sub-mesh count. More...
 
virtual void UpdateSkeletonAnimation (std::chrono::steady_clock::duration _time) override
 Play the active skeleton animation to the specified time. More...
 
- Public Member Functions inherited from Mesh
virtual ~Mesh ()
 Destructor. More...
 
- Public Member Functions inherited from Geometry
virtual ~Geometry ()
 Destructor. More...
 
virtual bool HasParent () const =0
 Determine if this Geometry is attached to a Visual. More...
 
virtual VisualPtr Parent () const =0
 Get the parent Visual. More...
 
virtual void RemoveParent ()=0
 Detach this Geometry from its parent Visual. If this Geometry does not have a parent, no work will be done. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 

Protected Member Functions

 BaseMesh ()
 
virtual SubMeshStorePtr SubMeshes () const =0
 

Protected Attributes

MaterialPtr material
 Pointer to currently assigned material. More...
 
bool ownsMaterial = false
 Flag to indicate whether or not this mesh should be responsible for destroying the material. More...
 

Constructor & Destructor Documentation

◆ BaseMesh()

BaseMesh ( )
protected

◆ ~BaseMesh()

~BaseMesh ( )
virtual

Member Function Documentation

◆ Destroy()

void Destroy ( )
overridevirtual

Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior.

Implements Object.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ HasSkeleton()

bool HasSkeleton ( ) const
overridevirtual

Check whether the mesh has skeleton.

Returns
True if the mesh has skeleton

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ HasSubMesh()

bool HasSubMesh ( ConstSubMeshPtr  _subMesh) const
overridevirtual

Determine if has given sub-mesh.

Parameters
[in]_subMeshSub-mesh in question
Returns
True if has given sub-mesh

Implements Mesh.

◆ HasSubMeshName()

bool HasSubMeshName ( const std::string _name) const
overridevirtual

Determine if has sub-mesh with given name.

Parameters
[in]_nameName of sub-mesh in question
Returns
True if has sub-mesh with given name

Implements Mesh.

◆ Material()

MaterialPtr Material ( ) const
overridevirtual

Get the material of this geometry.

Returns
Material used by this geometry

Implements Geometry.

Referenced by BaseSubMesh< OgreObject >::PreRender().

◆ PreRender()

void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Implements Object.

◆ SetMaterial() [1/2]

void SetMaterial ( const std::string _name,
bool  unique = true 
)
overridevirtual

Set the materials of this Geometry. The specified material will be retrieved from the parent Scene. If no material is registered by the given name, no work will be done.

Parameters
[in]_nameName of registered Material
[in]_uniqueTrue if the specified material should be cloned

Implements Geometry.

Referenced by BaseMesh< OgreGeometry >::SetMaterial(), and BaseSubMesh< OgreObject >::SetMaterial().

◆ SetMaterial() [2/2]

void SetMaterial ( MaterialPtr  _material,
bool  unique = true 
)
overridevirtual

Set the materials of this Geometry.

Parameters
[in]_materialNew Material to be assigned
[in]_uniqueTrue if the given material should be cloned

Implements Geometry.

◆ SetSkeletonAnimationEnabled()

void SetSkeletonAnimationEnabled ( const std::string _name,
bool  _enabled,
bool  _loop = true,
float  _weight = 1.0 
)
overridevirtual

Set whether a skeleton animation should be enabled or not.

Parameters
[in]_nameName of animation
[in]_enabledTrue to enable animation, false to disable
[in]_loopTrue to loop animation
[in]_weightWeight of animation

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SetSkeletonLocalTransforms()

void SetSkeletonLocalTransforms ( const std::map< std::string, math::Matrix4d > &  _tfs)
overridevirtual

Set transforms for the skeleton.

Parameters
[in]_tfsMap of skeleton local transformations
  • Map holding:
    • Skeleton node names
    • Local transformations of the skeleton nodes

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SetSkeletonWeights()

void SetSkeletonWeights ( const std::unordered_map< std::string, float > &  _weights)
overridevirtual

Set skeleton node weight.

Parameters
[in]_weightsMap of skeleton node's name to its weight
  • Map holding:
    • Skeleton node names
    • Weight the skeleton nodes

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SkeletonAnimationEnabled()

bool SkeletonAnimationEnabled ( const std::string _name) const
overridevirtual

Get whether a skeleton animation is enabled or not.

Parameters
[in]_nameName of animation
Returns
True is the skeleton animation is enabled, false otherwise

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SkeletonLocalTransforms()

std::map< std::string, math::Matrix4d > SkeletonLocalTransforms ( ) const
overridevirtual

Get the skeleton local transforms.

Returns
Map of skeleton local transformations
  • Map holding:
    • Skeleton node names
    • Local transformations of the skeleton nodes

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SkeletonWeights()

std::unordered_map< std::string, float > SkeletonWeights ( ) const
overridevirtual

Get skeleton node weight.

Returns
Map of skeleton node name to its weight
  • Map holding:
    • Skeleton node names
    • Weight the skeleton nodes

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

◆ SubMeshByIndex()

SubMeshPtr SubMeshByIndex ( unsigned int  _index) const
overridevirtual

Get sub-mesh at given index.

Parameters
[in]_indexIndex of sub-mesh
Returns
The sub-mesh at the given index

Implements Mesh.

Referenced by BaseMesh< OgreGeometry >::Material(), BaseMesh< OgreGeometry >::PreRender(), and BaseMesh< OgreGeometry >::SetMaterial().

◆ SubMeshByName()

SubMeshPtr SubMeshByName ( const std::string _name) const
overridevirtual

Get sub-mesh with given name.

Parameters
[in]_nameName of sub-mesh
Returns
The sub-mesh with the given name

Implements Mesh.

◆ SubMeshCount()

unsigned int SubMeshCount ( ) const
overridevirtual

Get the sub-mesh count.

Returns
The sub-mesh count

Implements Mesh.

Referenced by BaseMesh< OgreGeometry >::Material(), BaseMesh< OgreGeometry >::PreRender(), and BaseMesh< OgreGeometry >::SetMaterial().

◆ SubMeshes()

◆ UpdateSkeletonAnimation()

void UpdateSkeletonAnimation ( std::chrono::steady_clock::duration  _time)
overridevirtual

Play the active skeleton animation to the specified time.

Parameters
[in]_timeTime to set the skeleton animation to

Implements Mesh.

Reimplemented in Ogre2Mesh, and OgreMesh.

Member Data Documentation

◆ material

◆ ownsMaterial

bool ownsMaterial = false
protected

Flag to indicate whether or not this mesh should be responsible for destroying the material.

Referenced by BaseMesh< OgreGeometry >::Destroy(), BaseSubMesh< OgreObject >::Destroy(), BaseMesh< OgreGeometry >::SetMaterial(), and BaseSubMesh< OgreObject >::SetMaterial().


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