Skip to main content

Module physics

Module physics 

Source
Expand description

PhysicsFlow — read-only projection of the physics domain.

Flow::project publishes a small PhysicsView (statistics) consumed by telemetry and the editor. Per CLAD, a Flow never mutates the World.

The ECS → physics-provider sync (registering RigidBodys / Colliders with the [PhysicsProvider], updating handles, cleaning up orphans) is a maintenance invariant, so it lives in the physics_provider_sync DataSystem below (PreExtract phase, before the physics lane steps), not in the Flow.

Distance-based gameplay gating (detaching a RigidBody when far from the camera) is not done here: it changes the simulation, so it is developer-authored (opt-in), never an automatic engine default. See .agent/rules.mdadapt the HOW, never the WHAT.

The matching physics_world_writeback DataSystem (crate::ecs::systems::physics_world_writeback, Maintenance phase) runs after the lane’s provider.step(dt) and pulls the new transforms, kinematic results, and collision events from the provider back into the World.

Structs§

PhysicsFlow
Read-only physics presentation Flow.
PhysicsStepResult
Slot type written into OutputDeck by StandardPhysicsLane after provider.step(dt) completes.
PhysicsView
View published into the LaneBus by PhysicsFlow. Carries per-frame physics statistics for downstream consumers (telemetry, editor panels).