Represents one bone in a skeletal animation.
More...
#include <kbone.h>
|
| | kBone (const kString &boneName, int boneID, aiNodeAnim *channel) |
| | Constructs a bone from an Assimp animation channel.
|
| | kBone (const kString &boneName, int boneID, std::vector< kKeyPosition > positions, std::vector< kKeyRotation > rotations, std::vector< kKeyScale > scales) |
| | Constructs a bone from already-decoded keyframe arrays.
|
| void | update (float animationTime) |
| | Interpolates all channels and updates the local transform.
|
| const kMat4 | getLocalTransform () const |
| | Returns the interpolated local transform for the current time.
|
| const kString | getName () const |
| | Returns the bone name.
|
| const int | getID () const |
| | Returns the bone palette index.
|
| int | getPositionIndex (float animationTime) |
| | Finds the index of the position keyframe just before animationTime.
|
| int | getRotationIndex (float animationTime) |
| | Finds the index of the rotation keyframe just before animationTime.
|
| int | getScaleIndex (float animationTime) |
| | Finds the index of the scale keyframe just before animationTime.
|
Represents one bone in a skeletal animation.
Constructed from an Assimp node animation channel. Each frame, call update() with the current animation time to interpolate between keyframes and store the result in the local transform matrix, which is read by kAnimator::calculateBoneTransform().
◆ kBone() [1/2]
| kemena::kBone::kBone |
( |
const kString & | boneName, |
|
|
int | boneID, |
|
|
aiNodeAnim * | channel ) |
Constructs a bone from an Assimp animation channel.
- Parameters
-
| boneName | Human-readable bone name. |
| boneID | Index into the mesh's bone palette. |
| channel | Assimp node animation containing keyframe data. |
◆ kBone() [2/2]
Constructs a bone from already-decoded keyframe arrays.
Library-agnostic — populate the channel vectors from whatever importer (Assimp / tinygltf / custom) sourced them.
◆ getID()
| const int kemena::kBone::getID |
( |
| ) |
const |
Returns the bone palette index.
- Returns
- Zero-based index into the mesh's bone array.
◆ getLocalTransform()
| const kMat4 kemena::kBone::getLocalTransform |
( |
| ) |
const |
Returns the interpolated local transform for the current time.
- Returns
- 4x4 local-space bone transform matrix.
◆ getName()
| const kString kemena::kBone::getName |
( |
| ) |
const |
Returns the bone name.
- Returns
- Bone name as it appears in the asset.
◆ getPositionIndex()
| int kemena::kBone::getPositionIndex |
( |
float | animationTime | ) |
|
Finds the index of the position keyframe just before animationTime.
- Parameters
-
| animationTime | Current playback time in ticks. |
- Returns
- Index of the preceding position keyframe.
◆ getRotationIndex()
| int kemena::kBone::getRotationIndex |
( |
float | animationTime | ) |
|
Finds the index of the rotation keyframe just before animationTime.
- Parameters
-
| animationTime | Current playback time in ticks. |
- Returns
- Index of the preceding rotation keyframe.
◆ getScaleIndex()
| int kemena::kBone::getScaleIndex |
( |
float | animationTime | ) |
|
Finds the index of the scale keyframe just before animationTime.
- Parameters
-
| animationTime | Current playback time in ticks. |
- Returns
- Index of the preceding scale keyframe.
◆ update()
| void kemena::kBone::update |
( |
float | animationTime | ) |
|
Interpolates all channels and updates the local transform.
- Parameters
-
| animationTime | Current playback position in animation ticks. |
The documentation for this class was generated from the following file: