Skip to content

Commit e940a4a

Browse files
committed
[update] substeps
1 parent 68f492b commit e940a4a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/lambda-rs-platform/src/physics/rapier2d.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,14 @@ impl PhysicsBackend2D {
200200
pub fn new(gravity: [f32; 2], timestep_seconds: f32) -> Self {
201201
let gravity_vector = Vector::new(gravity[0], gravity[1]);
202202

203+
// `lambda-rs` exposes substep control at the `PhysicsWorld2D` layer.
204+
// Rapier's default `num_solver_iterations = 4` also subdivides the step
205+
// for integration, which changes free-body motion even when the public
206+
// world is configured with one substep. Keep this at `1` so only
207+
// `PhysicsWorld2D::substeps` controls outer-step subdivision.
203208
let integration_parameters = IntegrationParameters {
204209
dt: timestep_seconds,
210+
num_solver_iterations: 1,
205211
..Default::default()
206212
};
207213

0 commit comments

Comments
 (0)