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
55private:
56 asset_handle<animation_clip> animation_;
57
58 animation_player player_;
59
61 bool auto_play_ = true;
62 bool apply_root_motion_ = false;
63 float speed_ = 1.0f;
64};
65
66} // 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.
auto get_animation() const -> const asset_handle< animation_clip > &
auto get_autoplay() const -> bool
Gets whether the animation is set to autoplay.
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.
Represents a handle to an asset, providing access and management functions.
Struct representing an animation.
Definition animation.h:99
CRTP (Curiously Recurring Template Pattern) base structure for components.