6#include <hpp/utility.hpp>
12template<
typename Object,
typename T,
typename Setter,
typename Getter>
17 const Setter& setter_func,
18 const Getter& getter_func,
31 ease_func = ease_func,
32 setter_func = setter_func,
33 getter_func = getter_func]()
37 hpp::invoke(setter_func, *
object, begin);
42 auto updater_func = [setter_func, getter_func](Object*
object,
const T& next,
seq_action& self)
mutable
44 hpp::invoke(setter_func, *
object, next);
52 return hpp::invoke(getter_func, *
object);
58 std::move(initialize_func),
59 std::move(updater_func),
69template<
typename Object,
typename T,
typename Setter,
typename Getter>
73 const Setter& setter_func,
74 const Getter& getter_func,
82 ease_func = ease_func,
83 setter_func = setter_func,
84 getter_func = getter_func]()
88 if(sentinel.expired())
96 T out = hpp::invoke(getter_func, *
object);
101 auto updater_func = [setter_func, getter_func](Object*
object,
const T& next,
seq_action& self)
mutable
103 hpp::invoke(setter_func, *
object, next);
111 return hpp::invoke(getter_func, *
object);
117 std::move(initialize_func),
118 std::move(updater_func),
128template<
typename Object,
typename T,
typename Setter,
typename Getter>
132 const Setter& setter_func,
133 const Getter& getter_func,
145 ease_func = ease_func,
146 setter_func = setter_func,
147 getter_func = getter_func]()
157 [setter_func, getter_func, prev = T{}](Object*
object,
const T& next,
seq_action& self)
mutable
159 T current = hpp::invoke(getter_func, *
object);
161 const auto updated = current + (next - prev);
162 hpp::invoke(setter_func, *
object, updated);
172 return hpp::invoke(getter_func, *
object);
178 std::move(initialize_func),
179 std::move(updater_func),
const btCollisionObject * object
void update_begin_value(seq_action &action, const T &begin)
void add_info(seq_action &action, const std::string &updater_type, const Object &object, const T &end_value, const ease_t &ease_func)
void update_action_status(seq_action &action)
Provides a sequence-based action management system for controlling and scheduling actions.
hpp::sentinel sentinel_t
Alias for a sentinel object used for lifecycle management.
seq::seq_action creator(const std::string &type, values_t< T > &values, T &begin, const T &end, seq::duration_t duration)
std::function< float(float)> ease_t
Represents an easing function for interpolation.
seq_action create_to_impl(const std::string &creator_name, Object *object, const T &end, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
seq_action create_by_impl(const std::string &creator_name, Object *object, const T &amount, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
auto create_action_updater(Object *object, const TargetType &end, const sentinel_t &sentinel, InitializeFunc &&initialize_func, UpdateFunc &&update_func, Getter &&getter, const ease_t &ease_func=ease::linear, const interpolate_t< TargetType > &interpolate=lerp< TargetType >)
seq_action create_from_to_impl(const std::string &creator_name, Object *object, const T &begin, const T &end, const Setter &setter_func, const Getter &getter_func, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func)
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Represents an action within the sequence management system. Contains lifecycle events and management ...