|
psychic-ui 0.0.0
|
#include <Tween.hpp>
Public Member Functions | |
| Tween (const Channels &value, std::size_t count=4) | |
| void | jump (const Channels &value) |
| void | retarget (const Channels &target, const Timing &timing, std::optional< std::chrono::nanoseconds > start) |
| bool | advance (std::chrono::nanoseconds now) |
| void | finish () |
| const Channels & | value () const |
| const Channels & | target () const |
| const Channels & | velocity () const |
| bool | running () const |
| const Timing & | timing () const |
The motion of up to four channels toward a target, with a timing: along an easing curve for its duration, or pulled by a spring until it settles. Time is a monotonic clock's reading (Window::updateAnimations).
A retarget starts from the current value: a curve takes its whole duration again, a spring keeps its velocity.
| bool psychic_ui::Tween::advance | ( | std::chrono::nanoseconds | now | ) |
Move to where it is at now
| void psychic_ui::Tween::finish | ( | ) |
Go to the target at once
| void psychic_ui::Tween::jump | ( | const Channels & | value | ) |
At rest on a value
| void psychic_ui::Tween::retarget | ( | const Channels & | target, |
| const Timing & | timing, | ||
| std::optional< std::chrono::nanoseconds > | start ) |
Head to target from the current value, starting at start, or at the first advance without one. An instant timing jumps.