Apply accelerations during velocity solver

Closes https://github.com/dimforge/rapier/issues/97

Instead of applying accelerations from gravity and external forces
as a separate step, this PR switches to applying them in the velocity solver.
This commit is contained in:
Emil Ernerfeldt
2021-02-03 18:18:03 +01:00
parent 17ef7e10f9
commit d999e0e8c6
5 changed files with 64 additions and 13 deletions

View File

@@ -154,7 +154,7 @@ impl PhysicsPipeline {
self.counters.stages.update_time.start();
bodies.foreach_active_dynamic_body_mut_internal(|_, b| {
b.update_world_mass_properties();
b.integrate_accelerations(integration_parameters.dt, *gravity)
b.add_gravity(*gravity)
});
self.counters.stages.update_time.pause();