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

Simple implementation of the IAnimatedMesh interface. More...

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

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

Public Member Functions

 SAnimatedMesh (dcpp::scene::IMesh *mesh=0, dcpp::scene::E_ANIMATED_MESH_TYPE type=dcpp::scene::EAMT_UNKNOWN)
 constructor
 
virtual ~SAnimatedMesh ()
 destructor
 
virtual dcpp::uint32_kt getFrameCount () const override
 Gets the frame count of the animated mesh.
 
virtual dcpp::float32_kt getAnimationSpeed () const override
 Gets the default animation speed of the animated mesh.
 
virtual void setAnimationSpeed (dcpp::float32_kt fps) override
 Gets the frame count of the animated mesh.
 
virtual IMeshgetMesh (dcpp::int32_kt frame, dcpp::int32_kt detailLevel=255, dcpp::int32_kt startFrameLoop=-1, dcpp::int32_kt endFrameLoop=-1) override
 Returns the IMesh interface for a frame.
 
void addMesh (IMesh *mesh)
 adds a Mesh
 
virtual const dcpp::nub::aabbox3dfgetBoundingBox () const override
 Returns an axis aligned bounding box of the mesh.
 
virtual void setBoundingBox (const dcpp::nub::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 dcpp::uint32_kt getMeshBufferCount () const override
 returns amount of mesh buffers.
 
virtual IMeshBuffergetMeshBuffer (dcpp::uint32_kt nr) const override
 returns pointer to a mesh buffer
 
virtual IMeshBuffergetMeshBuffer (const dcpp::video::SMaterial &material) const override
 Returns pointer to a mesh buffer which fits a material.
 
virtual void setMaterialFlag (dcpp::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 dcpp::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.
 
dcpp::int32_kt getReferenceCount () const
 Get the reference count.
 
const dcpp::char_ktgetDebugName () const
 Returns the debug name of the object.
 

Public Attributes

dcpp::nub::array< IMesh * > Meshes
 All meshes defining the animated mesh.
 
dcpp::nub::aabbox3df Box
 The bounding box of this mesh.
 
dcpp::float32_kt 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 dcpp::IReferenceCounted
void setDebugName (const dcpp::char_kt *newName)
 Sets the debug name of the object.
 

Detailed Description

Simple implementation of the IAnimatedMesh interface.

Member Function Documentation

◆ getAnimationSpeed()

virtual dcpp::float32_kt dcpp::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 dcpp::scene::IAnimatedMesh.

◆ getBoundingBox()

virtual const dcpp::nub::aabbox3df & dcpp::scene::SAnimatedMesh::getBoundingBox ( ) const
inlineoverridevirtual

Returns an axis aligned bounding box of the mesh.

Returns
A bounding box of this mesh is returned.

Implements dcpp::scene::IMesh.

◆ getFrameCount()

virtual dcpp::uint32_kt dcpp::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 dcpp::scene::IAnimatedMesh.

◆ getMesh()

virtual IMesh * dcpp::scene::SAnimatedMesh::getMesh ( dcpp::int32_kt  frame,
dcpp::int32_kt  detailLevel = 255,
dcpp::int32_kt  startFrameLoop = -1,
dcpp::int32_kt  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 dcpp::scene::IAnimatedMesh.

◆ getMeshBuffer() [1/2]

virtual IMeshBuffer * dcpp::scene::SAnimatedMesh::getMeshBuffer ( const dcpp::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 dcpp::scene::IMesh.

◆ getMeshBuffer() [2/2]

virtual IMeshBuffer * dcpp::scene::SAnimatedMesh::getMeshBuffer ( dcpp::uint32_kt  nr) const
inlineoverridevirtual

returns pointer to a mesh buffer

Implements dcpp::scene::IMesh.

◆ getMeshBufferCount()

virtual dcpp::uint32_kt dcpp::scene::SAnimatedMesh::getMeshBufferCount ( ) const
inlineoverridevirtual

returns amount of mesh buffers.

Implements dcpp::scene::IMesh.

◆ getMeshType()

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

Returns the type of the animated mesh.

Reimplemented from dcpp::scene::IAnimatedMesh.

◆ setAnimationSpeed()

virtual void dcpp::scene::SAnimatedMesh::setAnimationSpeed ( dcpp::float32_kt  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 dcpp::scene::IAnimatedMesh.

◆ setBoundingBox()

virtual void dcpp::scene::SAnimatedMesh::setBoundingBox ( const dcpp::nub::aabbox3df box)
inlineoverridevirtual

set user axis aligned bounding box

Implements dcpp::scene::IMesh.

◆ setDirty()

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

flags the meshbuffer as changed, reloads hardware buffers

Implements dcpp::scene::IMesh.

◆ setHardwareMappingHint()

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

set the hardware mapping hint, for driver

Implements dcpp::scene::IMesh.

◆ setMaterialFlag()

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

Set a material flag for all meshbuffers of this mesh.

Implements dcpp::scene::IMesh.


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

Duckcpp    @cppfx.xyz