Struct amethyst_animation::Sampler [−][src]
pub struct Sampler<T> where
T: InterpolationPrimitive, { pub input: Vec<f32>, pub output: Vec<T>, pub function: InterpolationFunction<T>, }
Sampler defines a single animation for a single channel on a single component
Fields
input: Vec<f32>
Time of key frames
A simple example of this for animations that are defined with 4 evenly spaced key frames is
vec![0., 1., 2., 3.]
.
output: Vec<T>
Actual output data to interpolate
For input
of size i
, the output
size differs depending on the interpolation function.
The following list summarizes the size of the output
for each interpolation function. For
more details, please click through to each interpolation function's documentation.
- Linear:
i
—[pos_0, .., pos_n]
- Spherical Linear:
i
—[pos_0, .., pos_n]
- Step:
i
—[pos_0, .., pos_n]
- Catmull Rom Spline:
i + 2
—[in_tangent_0, pos_0, .., pos_n, out_tangent_n]
- Cubic Spline:
3 * i
—[in_tangent_0, pos_0, out_tangent_0, ..]
function: InterpolationFunction<T>
How interpolation should be done
Trait Implementations
impl<T: Debug> Debug for Sampler<T> where
T: InterpolationPrimitive,
[src]
impl<T: Debug> Debug for Sampler<T> where
T: InterpolationPrimitive,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Clone> Clone for Sampler<T> where
T: InterpolationPrimitive,
[src]
impl<T: Clone> Clone for Sampler<T> where
T: InterpolationPrimitive,
fn clone(&self) -> Sampler<T>
[src]
fn clone(&self) -> Sampler<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Asset for Sampler<T> where
T: InterpolationPrimitive + Send + Sync + 'static,
[src]
impl<T> Asset for Sampler<T> where
T: InterpolationPrimitive + Send + Sync + 'static,
const NAME: &'static str
NAME: &'static str = "animation::Sampler"
An identifier for this asset used for debugging.
type Data = Self
The Data
type the asset can be created from.
type HandleStorage = VecStorage<Handle<Self>>
The ECS storage type to be used. You'll want to use VecStorage
in most cases.
impl<T> Into<Result<ProcessingState<Sampler<T>>>> for Sampler<T> where
T: InterpolationPrimitive + Send + Sync + 'static,
[src]
impl<T> Into<Result<ProcessingState<Sampler<T>>>> for Sampler<T> where
T: InterpolationPrimitive + Send + Sync + 'static,
fn into(self) -> Result<ProcessingState<Sampler<T>>>
[src]
fn into(self) -> Result<ProcessingState<Sampler<T>>>
Performs the conversion.