Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::scene::SAnimatedMesh Class Reference

Simple implementation of the IAnimatedMesh interface. More...

#include <nirtcpp/core/engine/SAnimatedMesh.hpp>

Inheritance diagram for nirt::scene::SAnimatedMesh:
Inheritance graph
Collaboration diagram for nirt::scene::SAnimatedMesh:
Collaboration graph

Public Member Functions

 SAnimatedMesh (scene::IMesh *mesh=0, scene::E_ANIMATED_MESH_TYPE type=scene::EAMT_UNKNOWN)
 constructor
 
virtual ~SAnimatedMesh ()
 destructor
 
virtual u32 getFrameCount () const override
 Gets the frame count of the animated mesh.
 
virtual f32 getAnimationSpeed () const override
 Gets the default animation speed of the animated mesh.
 
virtual void setAnimationSpeed (f32 fps) override
 Gets the frame count of the animated mesh.
 
virtual IMeshgetMesh (s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) override
 Returns the IMesh interface for a frame.
 
void addMesh (IMesh *mesh)
 adds a Mesh
 
virtual const core::aabbox3d< f32 > & getBoundingBox () const override
 Returns an axis aligned bounding box of the mesh.
 
virtual void setBoundingBox (const core::aabbox3df &box) override
 set user axis aligned bounding box
 
void recalculateBoundingBox ()
 Recalculates the bounding box.
 
virtual E_ANIMATED_MESH_TYPE getMeshType () const override
 Returns the type of the animated mesh.
 
virtual u32 getMeshBufferCount () const override
 returns amount of mesh buffers.
 
virtual IMeshBuffergetMeshBuffer (u32 nr) const override
 returns pointer to a mesh buffer
 
virtual IMeshBuffergetMeshBuffer (const video::SMaterial &material) const override
 Returns pointer to a mesh buffer which fits a material.
 
virtual void setMaterialFlag (video::E_MATERIAL_FLAG flag, bool newvalue) override
 Set a material flag for all meshbuffers of this mesh.
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) override
 set the hardware mapping hint, for driver
 
virtual void setDirty (E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) override
 flags the meshbuffer as changed, reloads hardware buffers
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 

Public Attributes

core::array< IMesh * > Meshes
 All meshes defining the animated mesh.
 
core::aabbox3d< f32Box
 The bounding box of this mesh.
 
f32 FramesPerSecond
 Default animation speed of this mesh.
 
E_ANIMATED_MESH_TYPE Type
 The type of the mesh.
 

Additional Inherited Members

- Protected Member Functions inherited from nirt::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.
 

Detailed Description

Simple implementation of the IAnimatedMesh interface.

Member Function Documentation

◆ getAnimationSpeed()

virtual f32 nirt::scene::SAnimatedMesh::getAnimationSpeed ( ) const
inlineoverridevirtual

Gets the default animation speed of the animated mesh.

Returns
Amount of frames per second. If the amount is 0, it is a static, non animated mesh.

Implements nirt::scene::IAnimatedMesh.

◆ getBoundingBox()

virtual const core::aabbox3d< f32 > & nirt::scene::SAnimatedMesh::getBoundingBox ( ) const
inlineoverridevirtual

Returns an axis aligned bounding box of the mesh.

Returns
A bounding box of this mesh is returned.

Implements nirt::scene::IMesh.

◆ getFrameCount()

virtual u32 nirt::scene::SAnimatedMesh::getFrameCount ( ) const
inlineoverridevirtual

Gets the frame count of the animated mesh.

Returns
Amount of frames. If the amount is 1, it is a static, non animated mesh.

Implements nirt::scene::IAnimatedMesh.

◆ getMesh()

virtual IMesh * nirt::scene::SAnimatedMesh::getMesh ( s32  frame,
s32  detailLevel = 255,
s32  startFrameLoop = -1,
s32  endFrameLoop = -1 
)
inlineoverridevirtual

Returns the IMesh interface for a frame.

Parameters
frameFrame number as zero based index. The maximum frame number is getFrameCount() - 1;
detailLevelLevel of detail. 0 is the lowest, 255 the highest level of detail. Most meshes will ignore the detail level.
startFrameLoopstart frame
endFrameLoopend frame
Returns
The animated mesh based on a detail level.

Implements nirt::scene::IAnimatedMesh.

◆ getMeshBuffer() [1/2]

virtual IMeshBuffer * nirt::scene::SAnimatedMesh::getMeshBuffer ( const video::SMaterial material) const
inlineoverridevirtual

Returns pointer to a mesh buffer which fits a material.

Parameters
materialmaterial to search for
Returns
Returns the pointer to the mesh buffer or NULL if there is no such mesh buffer.

Implements nirt::scene::IMesh.

◆ getMeshBuffer() [2/2]

virtual IMeshBuffer * nirt::scene::SAnimatedMesh::getMeshBuffer ( u32  nr) const
inlineoverridevirtual

returns pointer to a mesh buffer

Implements nirt::scene::IMesh.

◆ getMeshBufferCount()

virtual u32 nirt::scene::SAnimatedMesh::getMeshBufferCount ( ) const
inlineoverridevirtual

returns amount of mesh buffers.

Implements nirt::scene::IMesh.

◆ getMeshType()

virtual E_ANIMATED_MESH_TYPE nirt::scene::SAnimatedMesh::getMeshType ( ) const
inlineoverridevirtual

Returns the type of the animated mesh.

Reimplemented from nirt::scene::IAnimatedMesh.

◆ setAnimationSpeed()

virtual void nirt::scene::SAnimatedMesh::setAnimationSpeed ( f32  fps)
inlineoverridevirtual

Gets the frame count of the animated mesh.

Parameters
fpsFrames per second to play the animation with. If the amount is 0, it is not animated. The actual speed is set in the scene node the mesh is instantiated in.

Implements nirt::scene::IAnimatedMesh.

◆ setBoundingBox()

virtual void nirt::scene::SAnimatedMesh::setBoundingBox ( const core::aabbox3df box)
inlineoverridevirtual

set user axis aligned bounding box

Implements nirt::scene::IMesh.

◆ setDirty()

virtual void nirt::scene::SAnimatedMesh::setDirty ( E_BUFFER_TYPE  buffer = EBT_VERTEX_AND_INDEX)
inlineoverridevirtual

flags the meshbuffer as changed, reloads hardware buffers

Implements nirt::scene::IMesh.

◆ setHardwareMappingHint()

virtual void nirt::scene::SAnimatedMesh::setHardwareMappingHint ( E_HARDWARE_MAPPING  newMappingHint,
E_BUFFER_TYPE  buffer = EBT_VERTEX_AND_INDEX 
)
inlineoverridevirtual

set the hardware mapping hint, for driver

Implements nirt::scene::IMesh.

◆ setMaterialFlag()

virtual void nirt::scene::SAnimatedMesh::setMaterialFlag ( video::E_MATERIAL_FLAG  flag,
bool  newvalue 
)
inlineoverridevirtual

Set a material flag for all meshbuffers of this mesh.

Implements nirt::scene::IMesh.


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

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print