Struct spectra::spline::Spline
[−]
[src]
pub struct Spline<T> { /* fields omitted */ }
Spline curve used to provide interpolation between control points (keys).
Methods
impl<T> Spline<T>
[src]
fn from_keys(keys: Vec<Key<T>>) -> Self
Create a new spline out of keys. The keys don’t have to be sorted because they’re sorted by this function.
fn sample(&self, t: Time) -> Option<T> where
T: Interpolate,
T: Interpolate,
Sample a spline at a given time.
Return
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.
fn clamped_sample(&self, t: Time) -> T where
T: Interpolate,
T: Interpolate,
Trait Implementations
impl<T: Debug> Debug for Spline<T>
[src]
impl<T: Clone> Clone for Spline<T>
[src]
fn clone(&self) -> Spline<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T> Load for Spline<T> where
T: SplineDeserializerAdapter,
[src]
T: SplineDeserializerAdapter,
type Args = ()
Arguments passed at loading.
const TY_STR: &'static str
TY_STR: &'static str = "splines"
fn load<P>(path: P, _: &mut ResCache, _: Self::Args) -> Result<Self, LoadError> where
P: AsRef<Path>,
P: AsRef<Path>,