Unravel Engine C++ Reference
Loading...
Searching...
No Matches
animation_component.h
Go to the documentation of this file.
1#pragma once
2
4
6
7namespace unravel
8{
9
10class animation_component : public component_crtp<animation_component>
11{
12public:
13 enum class culling_mode : uint8_t
14 {
17 };
18
23 void set_autoplay(bool on);
24
29 auto get_autoplay() const -> bool;
30
31 void set_apply_root_motion(bool on);
32 auto get_apply_root_motion() const -> bool;
33
34 void set_animation(const asset_handle<animation_clip>& animation);
35 auto get_animation() const -> const asset_handle<animation_clip>&;
36
37 void set_culling_mode(const culling_mode& animation);
38 auto get_culling_mode() const -> const culling_mode&;
39
44 void set_speed(float speed);
45
50 auto get_speed() const -> float;
51
52 auto get_player() const -> const animation_player&;
54
60
66
67private:
68 asset_handle<animation_clip> animation_;
69
70 animation_player player_;
71
74 bool auto_play_ = true;
75 bool apply_root_motion_ = false;
76 float speed_ = 1.0f;
77};
78
79} // namespace unravel
void set_culling_mode(const culling_mode &animation)
auto get_player() const -> const animation_player &
auto get_culling_mode() const -> const culling_mode &
auto get_speed() const -> float
Gets the current speed for animation playback.
void set_speed(float speed)
Sets the speed for animation playback.
void set_retargeting_mode(animation_retargeting_mode mode)
Sets the animation retargeting mode.
auto get_animation() const -> const asset_handle< animation_clip > &
auto get_autoplay() const -> bool
Gets whether the animation is set to autoplay.
auto get_retargeting_mode() const -> animation_retargeting_mode
Gets the animation retargeting mode.
void set_animation(const asset_handle< animation_clip > &animation)
auto get_apply_root_motion() const -> bool
void set_autoplay(bool on)
Sets whether the animation should autoplay.
Class responsible for playing animations on a skeletal mesh.
animation_retargeting_mode
Animation retargeting mode for bone matching.
@ name_based
Flexible, works with different skeletons (uses cached hash map)
Thread-safe handle to an asset.
Struct representing an animation.
Definition animation.h:99
CRTP (Curiously Recurring Template Pattern) base structure for components.