Skip to main content

Module movement

Module movement 

Source
Expand description

Trapezoidal velocity-profile movement math.

Exposes braking_distance for consumers writing opportunistic dispatch strategies that need the kinematic answer without constructing a Simulation. Trapezoidal velocity-profile movement physics.

tick_movement is the linear integrator used for shafts, tethers, and any LineKind::Linear topology. tick_movement_cyclic (gated by the loop_lines feature) wraps the same physics in cyclic-position semantics for LineKind::Loop: position is always normalised into [0, circumference), ticks that would jump past the seam wrap correctly, and headway_clamp_target enforces the no-overtake invariant when multiple cars share a loop.

Structs§

MovementResult
Result of one tick of movement physics.

Functions§

braking_distance
Distance required to brake to a stop from a given velocity at a fixed deceleration rate.
headway_clamp_target
Cyclic-aware no-overtake clamp on a trailing car’s intended target.
tick_movement
Advance position/velocity toward a target using a trapezoidal velocity profile.
tick_movement_cyclic
Advance position/velocity along a closed-loop axis using the same trapezoidal profile as tick_movement, with the result wrapped into [0, circumference).