|
sandbox
|
Time-ordered spline for interpolated animation values. More...
#include <spline.hpp>
Public Member Functions | |
| auto | add (const std::float_t timestamp, const Type &value) -> void |
| Add a keyframe to the spline. More... | |
| auto | sample (const std::float_t time) const -> Type |
| Sample the spline at a given time. More... | |
| auto | size () const noexcept -> std::size_t |
| Retrieve the number of keyframes stored. More... | |
Time-ordered spline for interpolated animation values.
| Type | Value type stored in the spline. |
The spline class maintains a sequence of keyframes, each consisting of a timestamp and a corresponding value. Values can be sampled continuously over time using interpolation defined in the implementation.
This class does not enforce a specific interpolation strategy at the interface level; instead, behavior is specialized in the accompanying implementation file.
Typical use cases include animation curves for transforms, scalar parameters, and orientation data.
| auto sbx::animations::spline< Type >::add | ( | const std::float_t | timestamp, |
| const Type & | value | ||
| ) | -> void |
Add a keyframe to the spline.
Inserts a new keyframe into the spline. Implementations are expected to maintain ordering of timestamps and associated values.
| timestamp | Time position of the keyframe. |
| value | Value associated with the timestamp. |
| auto sbx::animations::spline< Type >::sample | ( | const std::float_t | time | ) | const -> Type |
Sample the spline at a given time.
Returns a value interpolated between surrounding keyframes based on the provided time. Behavior when sampling outside the range of stored timestamps is implementation-defined.
| time | Time value to sample. |
|
noexcept |
Retrieve the number of keyframes stored.