Skip to main content

Module capture_previous_transform

Module capture_previous_transform 

Source
Expand description

Snapshots each simulated body’s world-space transform into the engine’s [TransformInterpolation] store so the render path can interpolate between the prior and current GlobalTransform for smooth motion at any frame rate.

Runs in TickPhase::PostSimulation before transform_propagation (lower order_hint): it captures the still-current GlobalTransform — the value produced by the previous frame’s propagation — before propagation overwrites it with this frame’s simulated pose. Render then blends previous → current by the Time::interpolation_alpha.

The snapshots live in Runtime::resources, NOT in the ECS: interpolation is a render-only representation (“adapt the HOW, never the WHAT”), so it carries no game meaning and must not appear in the editor inspector or scene files. Only simulated entities (those carrying a RigidBody) are snapshotted; everything else renders at its current transform.