Kemena3D
Loading...
Searching...
No Matches
kskelanimation.h
Go to the documentation of this file.
1
12
13#ifndef KSKELANIMATION_H
14#define KSKELANIMATION_H
15
16#include "kexport.h"
17#include "kdatatype.h"
18#include "kbone.h"
19
20#include <map>
21#include <vector>
22
23namespace kemena
24{
25 class kMesh;
26
38 {
39 public:
40#ifndef KEMENA_NO_ASSIMP
50 kSkeletalAnimation(const kString &animationPath, kMesh *setMesh);
51#endif
52
55
57 kBone *findBone(const kString &name);
58
60 float getTicksPerSecond() const;
61
63 float getDuration() const;
64
66 const kNodeData &getRootNode() const;
67
69 std::vector<kMesh *> getMeshes();
70
72 void setSpeed(float newSpeed);
73
75 float getSpeed() const;
76
77 private:
78 float duration = 0.0f;
79 int ticksPerSecond = 25;
80 std::vector<kBone> bones;
81 kNodeData rootNode;
82 std::vector<kMesh *> meshes;
83 std::map<kString, kBoneInfo> boneInfoMap;
84 float speed = 1.0f;
85 };
86}
87
88#endif // KSKELANIMATION_H
Represents one bone in a skeletal animation.
Definition kbone.h:35
Scene-graph node that holds renderable geometry.
Definition kmesh.h:35
float getDuration() const
Total duration of this animation in ticks.
kSkeletalAnimation()
Default constructor — leaves the clip empty until populated.
void setSpeed(float newSpeed)
Set the playback speed multiplier (1.0 = normal).
float getSpeed() const
Current playback speed multiplier.
kBone * findBone(const kString &name)
Finds the kBone with the given name in this clip.
const kNodeData & getRootNode() const
Root of the bone hierarchy.
std::vector< kMesh * > getMeshes()
All meshes this animation has been bound to.
float getTicksPerSecond() const
Tick rate of this animation (as specified in the asset).
kSkeletalAnimation(const kString &animationPath, kMesh *setMesh)
Loads an animation clip from an asset file (Assimp) and binds it to a mesh.
Single skeletal bone with position, rotation, and scale keyframe channels.
Core type aliases, enumerations, structs, and utility functions used throughout the engine.
Symbol visibility / linkage macro for the Kemena3D library.
#define KEMENA3D_API
Definition kexport.h:35
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
std::string kString
Standard string alias.
Definition kdatatype.h:42
Node in a skeletal-animation hierarchy (one per scene-graph joint).
Definition kdatatype.h:700