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

Simple implementation of the IAnimatedMesh interface. More...

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

Inheritance diagram for jpp::scene::SAnimatedMesh:
Inheritance graph
Collaboration diagram for jpp::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 jpp::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 jpp::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 jpp::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 jpp::scene::IAnimatedMesh.

◆ getBoundingBox()

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

Returns an axis aligned bounding box of the mesh.

Returns
A bounding box of this mesh is returned.

Implements jpp::scene::IMesh.

◆ getFrameCount()

virtual u32 jpp::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 jpp::scene::IAnimatedMesh.

◆ getMesh()

virtual IMesh * jpp::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 jpp::scene::IAnimatedMesh.

◆ getMeshBuffer() [1/2]

virtual IMeshBuffer * jpp::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 jpp::scene::IMesh.

◆ getMeshBuffer() [2/2]

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

returns pointer to a mesh buffer

Implements jpp::scene::IMesh.

◆ getMeshBufferCount()

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

returns amount of mesh buffers.

Implements jpp::scene::IMesh.

◆ getMeshType()

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

Returns the type of the animated mesh.

Reimplemented from jpp::scene::IAnimatedMesh.

◆ setAnimationSpeed()

virtual void jpp::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 jpp::scene::IAnimatedMesh.

◆ setBoundingBox()

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

set user axis aligned bounding box

Implements jpp::scene::IMesh.

◆ setDirty()

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

flags the meshbuffer as changed, reloads hardware buffers

Implements jpp::scene::IMesh.

◆ setHardwareMappingHint()

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

set the hardware mapping hint, for driver

Implements jpp::scene::IMesh.

◆ setMaterialFlag()

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

Set a material flag for all meshbuffers of this mesh.

Implements jpp::scene::IMesh.


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

Jimcpp    @cppfx.xyz

K