Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::animation_component Class Reference

#include <animation_component.h>

Inheritance diagram for unravel::animation_component:
unravel::component_crtp< animation_component > unravel::basic_component

Public Types

enum class  culling_mode : uint8_t { always_animate , renderer_based }
 
- Public Types inherited from unravel::component_crtp< animation_component >
using base
 

Public Member Functions

void set_autoplay (bool on)
 Sets whether the animation should autoplay.
 
auto get_autoplay () const -> bool
 Gets whether the animation is set to autoplay.
 
void set_apply_root_motion (bool on)
 
auto get_apply_root_motion () const -> bool
 
void set_animation (const asset_handle< animation_clip > &animation)
 
auto get_animation () const -> const asset_handle< animation_clip > &
 
void set_culling_mode (const culling_mode &animation)
 
auto get_culling_mode () const -> const culling_mode &
 
void set_speed (float speed)
 Sets the speed for animation playback.
 
auto get_speed () const -> float
 Gets the current speed for animation playback.
 
auto get_player () const -> const animation_player &
 
auto get_player () -> animation_player &
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Additional Inherited Members

- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 
- Static Public Attributes inherited from unravel::component_crtp< animation_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Definition at line 10 of file animation_component.h.

Member Enumeration Documentation

◆ culling_mode

enum class unravel::animation_component::culling_mode : uint8_t
strong
Enumerator
always_animate 
renderer_based 

Definition at line 13 of file animation_component.h.

Member Function Documentation

◆ get_animation()

auto unravel::animation_component::get_animation ( ) const -> const asset_handle<animation_clip>&

Definition at line 10 of file animation_component.cpp.

◆ get_apply_root_motion()

auto unravel::animation_component::get_apply_root_motion ( ) const -> bool

Definition at line 30 of file animation_component.cpp.

◆ get_autoplay()

auto unravel::animation_component::get_autoplay ( ) const -> bool

Gets whether the animation is set to autoplay.

Returns
True if autoplay is enabled, false otherwise.

Definition at line 20 of file animation_component.cpp.

◆ get_culling_mode()

auto unravel::animation_component::get_culling_mode ( ) const -> const culling_mode&

Definition at line 40 of file animation_component.cpp.

◆ get_player() [1/2]

auto unravel::animation_component::get_player ( ) -> animation_player&

Definition at line 59 of file animation_component.cpp.

◆ get_player() [2/2]

auto unravel::animation_component::get_player ( ) const -> const animation_player&

Definition at line 55 of file animation_component.cpp.

◆ get_speed()

auto unravel::animation_component::get_speed ( ) const -> float

Gets the current speed for animation playback.

Returns
The animation speed value.

Definition at line 50 of file animation_component.cpp.

◆ set_animation()

void unravel::animation_component::set_animation ( const asset_handle< animation_clip > & animation)

Definition at line 6 of file animation_component.cpp.

◆ set_apply_root_motion()

void unravel::animation_component::set_apply_root_motion ( bool on)

Definition at line 25 of file animation_component.cpp.

◆ set_autoplay()

void unravel::animation_component::set_autoplay ( bool on)

Sets whether the animation should autoplay.

Parameters
onTrue to autoplay, false otherwise.

Definition at line 15 of file animation_component.cpp.

◆ set_culling_mode()

void unravel::animation_component::set_culling_mode ( const culling_mode & animation)

Definition at line 35 of file animation_component.cpp.

◆ set_speed()

void unravel::animation_component::set_speed ( float speed)

Sets the speed for animation playback.

Parameters
speedThe animation speed (1.0 = normal speed, 2.0 = double speed, 0.5 = half speed).

Definition at line 45 of file animation_component.cpp.


The documentation for this class was generated from the following files: