Anim 0.1
Loading...
Searching...
No Matches
motion_clip_player.h
1#ifndef _MOTION_CLIP_PLAYER_H
2#define _MOTION_CLIP_PLAYER_H
3
4#include <animation/skeleton.h>
5
6namespace ClassRoom
7{
9 {
10 public:
12
15 void Init(gef::SkeletonPose const & bind_pose);
16
20 bool Update(float delta_time, gef::SkeletonPose const & bind_pose);
21
22 [[nodiscard]] float const anim_time() const { return anim_time_; }
23 void set_anim_time(float const anim_time) { anim_time_ = anim_time; }
24
25 [[nodiscard]] float const playback_speed() const { return playback_speed_; }
26 void set_playback_speed(float const playback_speed) { playback_speed_ = playback_speed; }
27
28 [[nodiscard]] bool const looping() const { return looping_; }
29 void set_looping(bool const looping) { looping_ = looping; }
30
31 [[nodiscard]] gef::Animation const * clip() const { return clip_; }
32 void set_clip(gef::Animation const * clip) { clip_ = clip; }
33
34 [[nodiscard]] gef::SkeletonPose const & pose() const { return pose_; }
35
36 private:
38 gef::SkeletonPose pose_;
39
41 gef::Animation const * clip_;
42
44 float anim_time_;
45
47 float playback_speed_;
48
50 bool looping_;
51 };
52}
53#endif // _MOTION_CLIP_PLAYER_H
Definition: motion_clip_player.h:9
bool Update(float delta_time, gef::SkeletonPose const &bind_pose)
Update the pose by sampling current animation clip.
Definition: motion_clip_player.cpp:18
void Init(gef::SkeletonPose const &bind_pose)
Initialise the clip player with the bind pose.
Definition: motion_clip_player.cpp:13