Unravel Engine C++ Reference
|
Class responsible for playing animations on a skeletal mesh. More...
#include <animation_player.h>
Public Types | |
using | seconds_t = animation_clip::seconds_t |
using | update_callback_t |
Public Member Functions | |
void | blend_to (size_t layer_idx, const asset_handle< animation_clip > &clip, seconds_t duration=seconds_t(0.3), bool loop=true, bool phase_sync=false, const blend_easing_t &easing=math::linearInterpolation< float >) |
Blends to the animation over the specified time with the specified easing. | |
void | clear (size_t layer_idx) |
void | set_blend_space (size_t layer_idx, const std::shared_ptr< blend_space_def > &blend_space, bool loop=true) |
void | set_blend_space_parameters (size_t layer_idx, const std::vector< float > ¶ms) |
auto | play () -> bool |
Starts or resumes the animation playback. | |
void | pause () |
Pauses the animation playback. | |
void | resume () |
Resumes the animation playback. | |
void | stop () |
Stops the animation playback and resets the time. | |
auto | update_time (seconds_t delta_time, bool force=false) -> bool |
Updates the animation player, advancing the animation time and applying transformations. | |
void | update_poses (const animation_pose &ref_pose, const update_callback_t &set_transform_callback) |
auto | is_playing () const -> bool |
Returns whether the animation is currently playing. | |
auto | is_paused () const -> bool |
Returns whether the animation is currently paused. | |
Class responsible for playing animations on a skeletal mesh.
This class handles the playback of animations, interpolating between keyframes and applying the appropriate transformations to the nodes of a skeletal mesh.
Definition at line 83 of file animation_player.h.
Definition at line 86 of file animation_player.h.
Definition at line 87 of file animation_player.h.
void unravel::animation_player::blend_to | ( | size_t | layer_idx, |
const asset_handle< animation_clip > & | clip, | ||
seconds_t | duration = seconds_t(0.3), | ||
bool | loop = true, | ||
bool | phase_sync = false, | ||
const blend_easing_t & | easing = math::linearInterpolation<float> ) |
Blends to the animation over the specified time with the specified easing.
clip | The animation to blend to. |
duration | The duration over which the blending must complete. |
easing | The easing function used. |
Definition at line 84 of file animation_player.cpp.
void unravel::animation_player::clear | ( | size_t | layer_idx | ) |
Definition at line 78 of file animation_player.cpp.
auto unravel::animation_player::is_paused | ( | ) | const -> bool |
Returns whether the animation is currently paused.
Definition at line 537 of file animation_player.cpp.
auto unravel::animation_player::is_playing | ( | ) | const -> bool |
Returns whether the animation is currently playing.
Definition at line 532 of file animation_player.cpp.
void unravel::animation_player::pause | ( | ) |
Pauses the animation playback.
Definition at line 163 of file animation_player.cpp.
auto unravel::animation_player::play | ( | ) | -> bool |
Starts or resumes the animation playback.
Definition at line 151 of file animation_player.cpp.
void unravel::animation_player::resume | ( | ) |
Resumes the animation playback.
Definition at line 168 of file animation_player.cpp.
void unravel::animation_player::set_blend_space | ( | size_t | layer_idx, |
const std::shared_ptr< blend_space_def > & | blend_space, | ||
bool | loop = true ) |
Definition at line 127 of file animation_player.cpp.
void unravel::animation_player::set_blend_space_parameters | ( | size_t | layer_idx, |
const std::vector< float > & | params ) |
Definition at line 145 of file animation_player.cpp.
void unravel::animation_player::stop | ( | ) |
Stops the animation playback and resets the time.
Definition at line 173 of file animation_player.cpp.
void unravel::animation_player::update_poses | ( | const animation_pose & | ref_pose, |
const update_callback_t & | set_transform_callback ) |
Definition at line 236 of file animation_player.cpp.
auto unravel::animation_player::update_time | ( | seconds_t | delta_time, |
bool | force = false ) -> bool |
Updates the animation player, advancing the animation time and applying transformations.
delta_time | The time to advance the animation by. |
set_transform_callback | The callback function to set the transform of a node. |
Definition at line 185 of file animation_player.cpp.