Kemena3D
Loading...
Searching...
No Matches
kemena::kSkeletalAnimation Class Reference

A single skeletal animation clip (bone channels + node hierarchy). More...

#include <kskelanimation.h>

Public Member Functions

 kSkeletalAnimation (const kString &animationPath, kMesh *setMesh)
 Loads an animation clip from an asset file (Assimp) and binds it to a mesh.
 kSkeletalAnimation ()
 Default constructor — leaves the clip empty until populated.
kBonefindBone (const kString &name)
 Finds the kBone with the given name in this clip.
float getTicksPerSecond () const
 Tick rate of this animation (as specified in the asset).
float getDuration () const
 Total duration of this animation in ticks.
const kNodeDatagetRootNode () const
 Root of the bone hierarchy.
std::vector< kMesh * > getMeshes ()
 All meshes this animation has been bound to.
void setSpeed (float newSpeed)
 Set the playback speed multiplier (1.0 = normal).
float getSpeed () const
 Current playback speed multiplier.

Detailed Description

A single skeletal animation clip (bone channels + node hierarchy).

Loaded via kAssetManager::loadAnimation(). The clip stores a list of kBone objects (one per animated joint) and the root of the bone hierarchy (kNodeData) used by kAnimator to propagate transforms.

Playback speed can be scaled with setSpeed(); the kAnimator queries getDuration() and getTicksPerSecond() to advance time correctly.

Constructor & Destructor Documentation

◆ kSkeletalAnimation() [1/2]

kemena::kSkeletalAnimation::kSkeletalAnimation ( const kString & animationPath,
kMesh * setMesh )

Loads an animation clip from an asset file (Assimp) and binds it to a mesh.

Parameters
animationPathPath to the animation asset.
setMeshMesh whose bone map resolves bone indices.

Available only in editor-style builds. Slim runtime builds load glTF animations through the tinygltf path on kAssetManager.

◆ kSkeletalAnimation() [2/2]

kemena::kSkeletalAnimation::kSkeletalAnimation ( )

Default constructor — leaves the clip empty until populated.

Member Function Documentation

◆ findBone()

kBone * kemena::kSkeletalAnimation::findBone ( const kString & name)

Finds the kBone with the given name in this clip.

◆ getDuration()

float kemena::kSkeletalAnimation::getDuration ( ) const

Total duration of this animation in ticks.

◆ getMeshes()

std::vector< kMesh * > kemena::kSkeletalAnimation::getMeshes ( )

All meshes this animation has been bound to.

◆ getRootNode()

const kNodeData & kemena::kSkeletalAnimation::getRootNode ( ) const

Root of the bone hierarchy.

◆ getSpeed()

float kemena::kSkeletalAnimation::getSpeed ( ) const

Current playback speed multiplier.

◆ getTicksPerSecond()

float kemena::kSkeletalAnimation::getTicksPerSecond ( ) const

Tick rate of this animation (as specified in the asset).

◆ setSpeed()

void kemena::kSkeletalAnimation::setSpeed ( float newSpeed)

Set the playback speed multiplier (1.0 = normal).


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