Skip to main content

TransformInterpolation

Struct TransformInterpolation 

Source
pub struct TransformInterpolation { /* private fields */ }
Expand description

Per-entity snapshots of the world-space transform before the latest simulation step, consumed by the render path for motion interpolation.

Engine-internal: populated by the data layer’s capture pass for simulated bodies and read by the render projection. Not an ECS component (see the module docs) — it is neither inspectable nor serialized.

Implementations§

Source§

impl TransformInterpolation

Source

pub fn new() -> Self

Creates an empty store.

Source

pub fn previous(&self, entity: EntityId) -> Option<AffineTransform>

The pre-step world-space transform recorded for entity, if the entity is currently simulated. None means “render at the current transform” (static entity, or first frame before any snapshot).

Source

pub fn record(&mut self, entity: EntityId, transform: AffineTransform)

Records entity’s current world-space transform as the pose to interpolate from on the next render.

Source

pub fn retain_live(&mut self, live: &HashSet<EntityId>)

Drops snapshots for entities absent from live — despawned bodies, or entities the simulation no longer moves. Bounds memory and prevents a recycled EntityId from reading a stale generation’s pose.

Source

pub fn len(&self) -> usize

Number of entities with a recorded previous pose.

Source

pub fn is_empty(&self) -> bool

Whether no previous pose is recorded.

Trait Implementations§

Source§

impl Debug for TransformInterpolation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransformInterpolation

Source§

fn default() -> TransformInterpolation

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AppLifecycle for T
where T: ?Sized,

Source§

fn on_start(&mut self, ctx: &mut dyn AppContext)

Called once after the backend is up but before the first update. Apps install their theme / fonts here.
Source§

fn on_exit(&mut self)

Called once when the window is closing. Persist state here.
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the inner value as &dyn Any.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.