Spline curve used to provide interpolation between control points (keys).
Create a new spline out of keys. The keys don’t have to be sorted even though it’s recommended
to provide ascending sorted ones (for performance purposes).
Create a new spline by consuming an Iterater<Item = Key<T>>
. They keys don’t have to be
sorted.
It’s valid to use any iterator that implements Iterator<Item = Key<T>>
. However, you should
use Spline::from_vec
if you are passing a Vec<_>
. This will remove dynamic allocations.
Retrieve the keys of a spline.
Sample a spline at a given time.
The current implementation, based on immutability, cannot perform in constant time. This means
that sampling’s processing complexity is currently O(log n). It’s possible to achieve O(1)
performance by using a slightly different spline type. If you are interested by this feature,
an implementation for a dedicated type is foreseen yet not started yet.
None
if you try to sample a value at a time that has no key associated with. That can also
happen if you try to sample between two keys with a specific interpolation mode that make the
sampling impossible. For instance, Interpolate::CatmullRom
requires four keys. If you’re
near the beginning of the spline or its end, ensure you have enough keys around to make the
sampling.
Sample a spline at a given time with clamping.
If you sample before the first key or after the last one, return the first key or the last
one, respectively. Otherwise, behave the same way as Spline::sample
.
This function panics if you have no key.
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
type Item = &'a Key<T>
The type of the elements being iterated over.
Which kind of iterator are we turning this into?