pub trait InterpolatableState: Clone {
// Required method
fn interpolate(&self, next: &Self, alpha: f32) -> Self;
}Expand description
Trait for immutable simulation snapshots supporting smooth discontinuity-safe render interpolation.
Required Methods§
Sourcefn interpolate(&self, next: &Self, alpha: f32) -> Self
fn interpolate(&self, next: &Self, alpha: f32) -> Self
Interpolates between self (previous fixed-step snapshot) and next (current fixed-step snapshot) at alpha in [0.0, 1.0].
§Arguments
&Self- Previous immutable simulation snapshot (t - dt).&Self- Current immutable simulation snapshot (t).f32- Render interpolation factor clamped to[0.0, 1.0].
§Returns
Self- Smoothly interpolated state for rendering without interpolating discontinuous events.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl InterpolatableState for SkeletonPoseSnapshot
Discontinuity-safe skeletal joint interpolation for SkeletonPoseSnapshot.
impl InterpolatableState for World2DSnapshot
Discontinuity-safe render-time interpolation for World2DSnapshot.
impl InterpolatableState for World3DSnapshot
Discontinuity-safe render-time interpolation for World3DSnapshot.