Trait libre_pvz_animation::curve::Curve
source · pub trait Curve: Send + Sync + 'static {
type Component: 'static;
// Required methods
fn frame_count(&self) -> usize;
fn apply_sampled(
&self,
segment: Segment,
frame: f32,
blending: Option<(BlendMethod, f32)>,
output: impl AnyComponent<Self::Component>
) -> Result<(), String>;
}
Expand description
Animation curve.
Required Associated Types§
Required Methods§
sourcefn frame_count(&self) -> usize
fn frame_count(&self) -> usize
Duration of this curve, in number of frames.
Note: This does not necessarily mean there are exactly this many frames stored in this
animation. It merely serves to indicate the maximum frame index for sampling. See also
Curve::apply_sampled
and TypedCurve::sample
.
sourcefn apply_sampled(
&self,
segment: Segment,
frame: f32,
blending: Option<(BlendMethod, f32)>,
output: impl AnyComponent<Self::Component>
) -> Result<(), String>
fn apply_sampled( &self, segment: Segment, frame: f32, blending: Option<(BlendMethod, f32)>, output: impl AnyComponent<Self::Component> ) -> Result<(), String>
Apply the sampled value to the target component as the result.
Object Safety§
This trait is not object safe.