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

Interface for an animated mesh. More...

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

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

Public Member Functions

virtual dcpp::uint32_kt getFrameCount () const =0
 Gets the frame count of the animated mesh.
 
virtual dcpp::float32_kt getAnimationSpeed () const =0
 Gets the animation speed of the animated mesh.
 
virtual void setAnimationSpeed (dcpp::float32_kt fps)=0
 Sets the animation speed 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)=0
 Returns the IMesh interface for a frame.
 
virtual E_ANIMATED_MESH_TYPE getMeshType () const override
 Returns the type of the animated mesh.
 
- Public Member Functions inherited from dcpp::scene::IMesh
virtual dcpp::uint32_kt getMeshBufferCount () const =0
 Get the amount of mesh buffers.
 
virtual IMeshBuffergetMeshBuffer (dcpp::uint32_kt nr) const =0
 Get pointer to a mesh buffer.
 
virtual IMeshBuffergetMeshBuffer (const dcpp::video::SMaterial &material) const =0
 Get pointer to a mesh buffer which fits a material.
 
virtual const dcpp::nub::aabbox3dfgetBoundingBox () const =0
 Get an axis aligned bounding box of the mesh.
 
virtual void setBoundingBox (const dcpp::nub::aabbox3df &box)=0
 Set user-defined axis aligned bounding box.
 
virtual void setMaterialFlag (dcpp::video::E_MATERIAL_FLAG flag, bool newvalue)=0
 Sets a flag of all contained materials to a new value.
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
 Set the hardware mapping hint.
 
virtual void setDirty (E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
 Flag 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.
 

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

Interface for an animated mesh.

There are already simple implementations of this interface available so you don't have to implement this interface on your own if you need to: You might want to use dcpp::scene::SAnimatedMesh, dcpp::scene::SMesh, dcpp::scene::SMeshBuffer etc.

Member Function Documentation

◆ getAnimationSpeed()

virtual dcpp::float32_kt dcpp::scene::IAnimatedMesh::getAnimationSpeed ( ) const
pure virtual

Gets the animation speed of the animated mesh.

Returns
The number of frames per second to play the animation with by default. If the amount is 0, it is a static, non animated mesh.

Implemented in dcpp::scene::SAnimatedMesh.

◆ getFrameCount()

virtual dcpp::uint32_kt dcpp::scene::IAnimatedMesh::getFrameCount ( ) const
pure virtual

Gets the frame count of the animated mesh.

Note that the play-time is usually getFrameCount()-1 as it stops as soon as the last frame-key is reached.

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

Implemented in dcpp::scene::SAnimatedMesh.

◆ getMesh()

virtual IMesh * dcpp::scene::IAnimatedMesh::getMesh ( dcpp::int32_kt  frame,
dcpp::int32_kt  detailLevel = 255,
dcpp::int32_kt  startFrameLoop = -1,
dcpp::int32_kt  endFrameLoop = -1 
)
pure virtual

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.
startFrameLoopBecause some animated meshes (.MD2) are blended between 2 static frames, and maybe animated in a loop, the startFrameLoop and the endFrameLoop have to be defined, to prevent the animation to be blended between frames which are outside of this loop. If startFrameLoop and endFrameLoop are both -1, they are ignored.
endFrameLoopsee startFrameLoop.
Returns
Returns the animated mesh based on a detail level.

Implemented in dcpp::scene::SAnimatedMesh.

◆ getMeshType()

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

Returns the type of the animated mesh.

In most cases it is not necessary to use this method. This is useful for making a safe downcast. For example, if getMeshType() returns EAMT_MD2 it's safe to cast the IAnimatedMesh to IAnimatedMeshMD2.

Returns
Type of the mesh.

Reimplemented from dcpp::scene::IMesh.

Reimplemented in dcpp::scene::SAnimatedMesh.

◆ setAnimationSpeed()

virtual void dcpp::scene::IAnimatedMesh::setAnimationSpeed ( dcpp::float32_kt  fps)
pure virtual

Sets the animation speed of the animated mesh.

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

Implemented in dcpp::scene::SAnimatedMesh.


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

Duckcpp    @cppfx.xyz