inertialization
Generated Rust API reference for byte_engine.
byte_engine / animation / inertialization
Module inertialization
Retained local-pose inertialization for discontinuity-free transitions.
Quick Reference
| Item | Kind | Description |
|---|---|---|
PoseInertializer | struct | The PoseInertializer struct retains per-node offsets and velocities for a smooth pose transition. |
InertializationError | enum | Errors returned when a pose transition cannot be initialized or advanced. |
Structs
PoseInertializer
struct PoseInertializer {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/animation/inertialization.rs:15-20
The PoseInertializer struct retains per-node offsets and velocities for a smooth pose transition.
Allocate it once for a skeleton, call Self::begin when a transition
starts, then call Self::apply with the destination pose each frame.
Implementations
-
fn new(node_count: usize) -> SelfCreates cleared transition state for a fixed node count.
-
fn node_count(&self) -> usizeReturns the node count required for poses passed to
Self::beginandSelf::apply. -
fn is_active(&self) -> boolReturns whether
Self::applyis still smoothing a transition. -
fn begin(&mut self, source_previous: &[LocalTransform], source: &[LocalTransform], destination_previous: &[LocalTransform], destination: &[LocalTransform], sample_delta: MediaTime, duration: MediaTime) -> Result<(), InertializationError>Related:
MediaTime,InertializationErrorCaptures the positional and rotational discontinuity between two moving poses.
sample_deltais the time between each previous/current pose pair. Azero transition duration clears the inertializer so the destination pose
takes effect immediately.
-
fn apply(&mut self, destination: &[LocalTransform], delta: MediaTime, output: &mut [LocalTransform]) -> Result<(), InertializationError>Related:
MediaTime,InertializationErrorAdvances retained offsets and writes an inertialized destination pose.
Once the configured duration elapses, this writes the destination exactly
and marks the transition inactive.
-
fn clear(&mut self)Stops the current transition without changing allocated state.
Trait Implementations
impl ArchivePointee for PoseInertializer
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for PoseInertializer
impl Clone for PoseInertializer
-
fn clone(&self) -> PoseInertializerRelated:
PoseInertializer
impl Debug for PoseInertializer
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for PoseInertializer
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for PoseInertializer
-
fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for PoseInertializer
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Instrument for PoseInertializer
impl LayoutRaw for PoseInertializer
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for PoseInertializer
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for PoseInertializer
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for PoseInertializer
-
type Metadata = ()
impl Read for PoseInertializer
impl WithSubscriber for PoseInertializer
Enums
InertializationError
enum InertializationError {
PoseLength {
expected: usize,
actual: usize,
},
InvalidSampleDelta,
InvalidDuration,
InvalidAdvanceDelta,
}Defined in crates/byte-engine/src/animation/inertialization.rs:191-205
Errors returned when a pose transition cannot be initialized or advanced.
Variants
-
PoseLengthA pose does not match the inertializer's node count.
-
InvalidSampleDeltaThe interval between source samples is zero, negative, or non-finite.
-
InvalidDurationThe requested transition duration is negative or non-finite.
-
InvalidAdvanceDeltaThe frame interval used to advance the transition is negative or non-finite.
Trait Implementations
impl ArchivePointee for InertializationError
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for InertializationError
impl Clone for InertializationError
-
fn clone(&self) -> InertializationErrorRelated:
InertializationError
impl Copy for InertializationError
impl Debug for InertializationError
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Display for InertializationError
-
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
impl Downcast for InertializationError
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for InertializationError
-
fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for InertializationError
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for InertializationError
impl<K> Equivalent for InertializationError
-
fn equivalent(&self, key: &K) -> bool
impl Error for InertializationError
impl Instrument for InertializationError
impl LayoutRaw for InertializationError
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for InertializationError
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for InertializationError
-
fn eq(&self, other: &InertializationError) -> boolRelated:
InertializationError
impl Pointable for InertializationError
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for InertializationError
-
type Metadata = ()
impl Read for InertializationError
impl StructuralPartialEq for InertializationError
impl ToString for InertializationError
-
fn to_string(&self) -> String