26 progress = std::make_shared<render::matvar_float>(1, 0.0f);
29 material = std::make_shared<render::material>();
31 material->set_variable(
"progress", progress);
55 [
this](
int channel,
float progress)
57 this->progress->set(progress);
64 [
this](
int channel,
float progress)
66 this->progress->set(progress);
78 float initial_state = (reverse) ? 1.0f : 0.0f;
79 float final_state = (reverse) ? 0.0f : 1.0f;
82 channel->remove_keyframes();
83 channel->insert_keyframe({0.0f, initial_state});
84 channel->insert_keyframe({duration, final_state});
89 this->callback = callback;
109 progress->set(initial_state);
void set_end_callback(std::function< void()> callback)
Sets the callback that's executed when a non-looped animation has finished.
void play()
Plays the animation.
void stop()
Stops the animation, rewinds it, and resets the loop count.
void set_interpolator(interpolator_type interpolator)
Sets the frame interpolator function object.
channel * add_channel(int id)
Adds a channel to the animation.
void set_frame_callback(std::function< void(int, const T &)> callback)
Sets the callback that's executed on each frame of animation.
void set_material(std::shared_ptr< render::material > material)
Sets the billboard material.
constexpr void set_layer_mask(std::uint32_t mask) noexcept
Sets the layer mask of the object.
void transition(float duration, bool reverse, animation< float >::interpolator_type interpolator, bool hide=true, const std::function< void()> &callback=nullptr)
void set_visible(bool visible)
@ translucent
Material is translucent.