pub enum SampleState {
Empty,
BeforeStart {
first: Sample,
},
AfterEnd {
last: Sample,
},
Exact(Sample),
Interpolated {
sample: Sample,
from_tick: u64,
to_tick: u64,
},
Held {
sample: Sample,
from_tick: u64,
teleport_tick: u64,
},
}Expand description
Placement and presentation pose of a checked ghost query.
Exact keys retain their stored teleport flag. Synthesized poses clear it;
Held explicitly identifies a discontinuous interval instead.
These states describe the requested time, not an event stream: repeating an
exact query returns the same key, including its teleport flag.
See GhostTrack::sample_checked for a complete example.
Variants§
Empty
No recorded poses, including a zero-capacity track.
BeforeStart
Earlier than the first recorded tick; no pose is synthesized.
AfterEnd
Later than the last recorded tick; no pose is synthesized.
Exact(Sample)
Exactly a recorded tick with zero alpha; the stored pose is unchanged.
Interpolated
Continuous motion between two distinct recorded ticks.
Fields
Held
Holding the preceding pose until a marked teleport; neither position nor rotation is blended across the discontinuity.
Implementations§
Source§impl SampleState
impl SampleState
Sourcepub fn sample(self) -> Option<Sample>
pub fn sample(self) -> Option<Sample>
Return an in-range presentation pose without clamping or extrapolation.
use ferravex_play::replay::ghost::{GhostTrack, Sample};
use ferravex_math::{Quat, Vec3};
let mut track = GhostTrack::new(7, 60, 1)?;
track.push(Sample {
tick: 10, position: Vec3::ZERO, rotation: Quat::IDENTITY, teleport: true,
})?;
assert!(track.sample_checked(10, 0.0)?.sample().unwrap().teleport);
assert!(track.sample_checked(10, 0.5)?.sample().is_none());Trait Implementations§
Source§impl Clone for SampleState
impl Clone for SampleState
Source§fn clone(&self) -> SampleState
fn clone(&self) -> SampleState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more