8auto lerp(
const T&
start,
const T& end,
float progress,
const ease_t& ease_func) -> T
20 auto completion = ease_func(progress);
21 return start * (1.0f - completion) + (end * completion);
24template<
typename InType,
typename OutType>
26 const decltype(in)& in_start,
27 const decltype(in)& in_end,
28 const OutType& out_start,
29 const decltype(out_start)& out_end,
30 const ease_t& ease_func) -> OutType
42 auto progress = in - in_start;
43 auto in_factor =
static_cast<float>(progress) /
static_cast<float>(in_end - in_start);
44 OutType result =
lerp(out_start, out_end, in_factor, ease_func);
Provides a sequence-based action management system for controlling and scheduling actions.
auto start(seq_action action, const seq_scope_policy &scope_policy, hpp::source_location location) -> seq_id_t
Starts a new action.
std::function< float(float)> ease_t
Represents an easing function for interpolation.
auto lerp(const T &start, const T &end, float progress, const ease_t &ease_func=ease::linear) -> T
Linearly interpolates between two values based on progress.
auto range_map(const InType &in, const decltype(in)&in_start, const decltype(in)&in_end, const OutType &out_start, const decltype(out_start)&out_end, const ease_t &ease_func=ease::linear) -> OutType
Maps a value from one range to another range, with optional easing.