Saga3D API Documentation  1.0-RC4
saga::scene::SAnimatedMesh Struct Reference

Simple implementation of the IAnimatedMesh interface. More...

#include <SAnimatedMesh.h>

Inheritance diagram for saga::scene::SAnimatedMesh:
saga::scene::IAnimatedMesh saga::scene::IMesh

Public Member Functions

 SAnimatedMesh (const std::shared_ptr< scene::IMesh > &mesh=nullptr)
 constructor More...
 
virtual ~SAnimatedMesh ()
 destructor More...
 
virtual E_MESH_TYPE getMeshType () const override
 
virtual std::uint32_t getFrameCount () const
 Gets the frame count of the animated mesh. More...
 
virtual float getAnimationSpeed () const
 Gets the default animation speed of the animated mesh. More...
 
virtual void setAnimationSpeed (float fps)
 Gets the frame count of the animated mesh. More...
 
virtual const std::shared_ptr< IMesh > & getMesh (std::int32_t frame, std::int32_t detailLevel=255, std::int32_t startFrameLoop=-1, std::int32_t endFrameLoop=-1)
 Returns the IMesh interface for a frame. More...
 
void addMesh (const std::shared_ptr< IMesh > &mesh)
 adds a Mesh More...
 
virtual const core::aabbox3d< float > & getBoundingBox () const
 Returns an axis aligned bounding box of the mesh. More...
 
virtual void setBoundingBox (const core::aabbox3df &box)
 set user axis aligned bounding box More...
 
void recalculateBoundingBox ()
 Recalculates the bounding box. More...
 
virtual std::uint32_t getMeshBufferCount () const
 returns amount of mesh buffers. More...
 
virtual IMeshBuffergetMeshBuffer (std::uint32_t nr=0) override
 returns pointer to a mesh buffer More...
 
virtual void addMeshBuffer (std::unique_ptr< IMeshBuffer > buf) override
 adds a MeshBuffer More...
 
virtual void setAnimation (const uint32_t index) override
 Set active animation. More...
 
virtual void onAnimate (const float time) override
 Animate the mesh. More...
 
- Public Member Functions inherited from saga::scene::IMesh
void setID (const ID id)
 
ID getID () const
 

Public Attributes

std::vector< std::shared_ptr< IMesh > > Meshes
 All meshes defining the animated mesh. More...
 
core::aabbox3d< float > Box
 The bounding box of this mesh. More...
 
float FramesPerSecond
 Default animation speed of this mesh. More...
 

Additional Inherited Members

- Protected Attributes inherited from saga::scene::IMesh
ID MeshID = INVALID_ID
 ID of this mesh. More...
 

Detailed Description

Simple implementation of the IAnimatedMesh interface.

Definition at line 14 of file SAnimatedMesh.h.

Constructor & Destructor Documentation

◆ SAnimatedMesh()

saga::scene::SAnimatedMesh::SAnimatedMesh ( const std::shared_ptr< scene::IMesh > &  mesh = nullptr)
inline

constructor

Definition at line 17 of file SAnimatedMesh.h.

◆ ~SAnimatedMesh()

virtual saga::scene::SAnimatedMesh::~SAnimatedMesh ( )
inlinevirtual

destructor

Definition at line 24 of file SAnimatedMesh.h.

Member Function Documentation

◆ addMesh()

void saga::scene::SAnimatedMesh::addMesh ( const std::shared_ptr< IMesh > &  mesh)
inline

adds a Mesh

Definition at line 67 of file SAnimatedMesh.h.

◆ addMeshBuffer()

virtual void saga::scene::SAnimatedMesh::addMeshBuffer ( std::unique_ptr< IMeshBuffer buf)
inlineoverridevirtual

adds a MeshBuffer

The bounding box is not updated automatically.

Implements saga::scene::IMesh.

Definition at line 119 of file SAnimatedMesh.h.

◆ getAnimationSpeed()

virtual float saga::scene::SAnimatedMesh::getAnimationSpeed ( ) const
inlinevirtual

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 saga::scene::IAnimatedMesh.

Definition at line 40 of file SAnimatedMesh.h.

◆ getBoundingBox()

virtual const core::aabbox3d<float>& saga::scene::SAnimatedMesh::getBoundingBox ( ) const
inlinevirtual

Returns an axis aligned bounding box of the mesh.

Returns
A bounding box of this mesh is returned.

Implements saga::scene::IMesh.

Definition at line 77 of file SAnimatedMesh.h.

◆ getFrameCount()

virtual std::uint32_t saga::scene::SAnimatedMesh::getFrameCount ( ) const
inlinevirtual

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 saga::scene::IAnimatedMesh.

Definition at line 33 of file SAnimatedMesh.h.

◆ getMesh()

virtual const std::shared_ptr<IMesh>& saga::scene::SAnimatedMesh::getMesh ( std::int32_t  frame,
std::int32_t  detailLevel = 255,
std::int32_t  startFrameLoop = -1,
std::int32_t  endFrameLoop = -1 
)
inlinevirtual

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.

Definition at line 61 of file SAnimatedMesh.h.

◆ getMeshBuffer()

virtual IMeshBuffer& saga::scene::SAnimatedMesh::getMeshBuffer ( std::uint32_t  nr = 0)
inlineoverridevirtual

returns pointer to a mesh buffer

Implements saga::scene::IMesh.

Definition at line 112 of file SAnimatedMesh.h.

◆ getMeshBufferCount()

virtual std::uint32_t saga::scene::SAnimatedMesh::getMeshBufferCount ( ) const
inlinevirtual

returns amount of mesh buffers.

Implements saga::scene::IMesh.

Definition at line 103 of file SAnimatedMesh.h.

◆ getMeshType()

virtual E_MESH_TYPE saga::scene::SAnimatedMesh::getMeshType ( ) const
inlineoverridevirtual

Implements saga::scene::IMesh.

Definition at line 29 of file SAnimatedMesh.h.

◆ onAnimate()

virtual void saga::scene::SAnimatedMesh::onAnimate ( const float  time)
inlineoverridevirtual

Animate the mesh.

Implements saga::scene::IAnimatedMesh.

Definition at line 132 of file SAnimatedMesh.h.

◆ recalculateBoundingBox()

void saga::scene::SAnimatedMesh::recalculateBoundingBox ( )
inline

Recalculates the bounding box.

Definition at line 89 of file SAnimatedMesh.h.

◆ setAnimation()

virtual void saga::scene::SAnimatedMesh::setAnimation ( const uint32_t  index)
inlineoverridevirtual

Set active animation.

Parameters
indexindex of the animation

Implements saga::scene::IAnimatedMesh.

Definition at line 126 of file SAnimatedMesh.h.

◆ setAnimationSpeed()

virtual void saga::scene::SAnimatedMesh::setAnimationSpeed ( float  fps)
inlinevirtual

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 saga::scene::IAnimatedMesh.

Definition at line 48 of file SAnimatedMesh.h.

◆ setBoundingBox()

virtual void saga::scene::SAnimatedMesh::setBoundingBox ( const core::aabbox3df box)
inlinevirtual

set user axis aligned bounding box

Implements saga::scene::IMesh.

Definition at line 83 of file SAnimatedMesh.h.

Member Data Documentation

◆ Box

core::aabbox3d<float> saga::scene::SAnimatedMesh::Box

The bounding box of this mesh.

Definition at line 141 of file SAnimatedMesh.h.

◆ FramesPerSecond

float saga::scene::SAnimatedMesh::FramesPerSecond

Default animation speed of this mesh.

Definition at line 144 of file SAnimatedMesh.h.

◆ Meshes

std::vector<std::shared_ptr<IMesh> > saga::scene::SAnimatedMesh::Meshes

All meshes defining the animated mesh.

Definition at line 138 of file SAnimatedMesh.h.


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