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

Interface for using some special functions of Skinned meshes. More...

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

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

Classes

class  SJoint
 Joints. More...
 
class  SPositionKey
 Animation keyframe which describes a new position. More...
 
class  SRotationKey
 Animation keyframe which describes a new rotation. More...
 
class  SScaleKey
 Animation keyframe which describes a new scale. More...
 
class  SWeight
 A vertex weight. More...
 

Public Member Functions

virtual dcpp::uint32_kt getJointCount () const =0
 Gets joint count.
 
virtual const dcpp::char_ktgetJointName (dcpp::uint32_kt number) const =0
 Gets the name of a joint.
 
virtual dcpp::int32_kt getJointNumber (const dcpp::char_kt *name) const =0
 Gets a joint number from its name.
 
virtual bool useAnimationFrom (const ISkinnedMesh *mesh)=0
 Use animation from another mesh.
 
virtual void updateNormalsWhenAnimating (bool on)=0
 Update Normals when Animating.
 
virtual void setInterpolationMode (E_INTERPOLATION_MODE mode)=0
 Sets Interpolation Mode.
 
virtual void animateMesh (dcpp::float32_kt frame, dcpp::float32_kt blend)=0
 Animates this mesh's joints based on frame input.
 
virtual void skinMesh ()=0
 Preforms a software skin on this mesh based of joint positions.
 
virtual void convertMeshToTangents ()=0
 converts the vertex type of all meshbuffers to tangents.
 
virtual bool setHardwareSkinning (bool on)=0
 Allows to enable hardware skinning.
 
virtual dcpp::nub::array< SSkinMeshBuffer * > & getMeshBuffers ()=0
 exposed for loaders: to add mesh buffers
 
virtual dcpp::nub::array< SJoint * > & getAllJoints ()=0
 exposed for loaders: joints list
 
virtual const dcpp::nub::array< SJoint * > & getAllJoints () const =0
 exposed for loaders: joints list
 
virtual void finalize ()=0
 loaders should call this after populating the mesh
 
virtual SSkinMeshBufferaddMeshBuffer ()=0
 Adds a new meshbuffer to the mesh, access it as last one.
 
virtual SJointaddJoint (SJoint *parent=0)=0
 Adds a new joint to the mesh, access it as last one.
 
virtual SWeightaddWeight (SJoint *joint)=0
 Adds a new weight to the mesh, access it as last one.
 
virtual SPositionKeyaddPositionKey (SJoint *joint)=0
 Adds a new position key to the mesh, access it as last one.
 
virtual SScaleKeyaddScaleKey (SJoint *joint)=0
 Adds a new scale key to the mesh, access it as last one.
 
virtual SRotationKeyaddRotationKey (SJoint *joint)=0
 Adds a new rotation key to the mesh, access it as last one.
 
virtual bool isStatic ()=0
 Check if the mesh is non-animated.
 
- Public Member Functions inherited from dcpp::scene::IAnimatedMesh
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 using some special functions of Skinned meshes.

Member Function Documentation

◆ convertMeshToTangents()

virtual void dcpp::scene::ISkinnedMesh::convertMeshToTangents ( )
pure virtual

converts the vertex type of all meshbuffers to tangents.

E.g. used for bump mapping.

◆ getJointCount()

virtual dcpp::uint32_kt dcpp::scene::ISkinnedMesh::getJointCount ( ) const
pure virtual

Gets joint count.

Returns
Amount of joints in the skeletal animated mesh.

◆ getJointName()

virtual const dcpp::char_kt * dcpp::scene::ISkinnedMesh::getJointName ( dcpp::uint32_kt  number) const
pure virtual

Gets the name of a joint.

Parameters
numberZero based index of joint. The last joint has the number getJointCount()-1;
Returns
Name of joint and null if an error happened.

◆ getJointNumber()

virtual dcpp::int32_kt dcpp::scene::ISkinnedMesh::getJointNumber ( const dcpp::char_kt name) const
pure virtual

Gets a joint number from its name.

Parameters
nameName of the joint.
Returns
Number of the joint or -1 if not found.

◆ updateNormalsWhenAnimating()

virtual void dcpp::scene::ISkinnedMesh::updateNormalsWhenAnimating ( bool  on)
pure virtual

Update Normals when Animating.

Parameters
onIf false don't animate, which is faster. Else update normals, which allows for proper lighting of animated meshes.

◆ useAnimationFrom()

virtual bool dcpp::scene::ISkinnedMesh::useAnimationFrom ( const ISkinnedMesh mesh)
pure virtual

Use animation from another mesh.

The animation is linked (not copied) based on joint names so make sure they are unique.

Returns
True if all joints in this mesh were matched up (empty names will not be matched, and it's case sensitive). Unmatched joints will not be animated.

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

Duckcpp    @cppfx.xyz