pub struct ViewHistory { /* private fields */ }Expand description
The entities sent to one subscriber over the last ticks, as its interpolator holds them. See the module docs.
Implementations§
Source§impl ViewHistory
impl ViewHistory
Sourcepub fn new(keep_ticks: u64) -> Self
pub fn new(keep_ticks: u64) -> Self
Keep enough to place entities at ticks down to keep_ticks before
the newest frame.
Sourcepub fn keep_ticks(&self) -> u64
pub fn keep_ticks(&self) -> u64
How many ticks back position_at can see.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Forget everything (a new connection, or the subscriber’s baseline was reset).
Sourcepub fn record(
&mut self,
tick: u64,
precision: f32,
full: bool,
spawned: &[Sent],
updated: &[Sent],
despawned: &[EntityId],
)
pub fn record( &mut self, tick: u64, precision: f32, full: bool, spawned: &[Sent], updated: &[Sent], despawned: &[EntityId], )
Record a frame sent for tick. full is a frame that lists every
entity the subscriber has, as spawned. Positions are quantized; the
subscriber places them at q * precision.
Sourcepub fn position_at(&self, id: EntityId, render_tick: f64) -> Option<[f64; 3]>
pub fn position_at(&self, id: EntityId, render_tick: f64) -> Option<[f64; 3]>
Where the subscriber drew id at render_tick (fractional), or None
when the subscriber did not draw it then (not spawned yet, despawned,
or never sent).
Trait Implementations§
Source§impl Clone for ViewHistory
impl Clone for ViewHistory
Auto Trait Implementations§
impl Freeze for ViewHistory
impl RefUnwindSafe for ViewHistory
impl Send for ViewHistory
impl Sync for ViewHistory
impl Unpin for ViewHistory
impl UnsafeUnpin for ViewHistory
impl UnwindSafe for ViewHistory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more