Add a basic lines-based debug-renderer

This commit is contained in:
Sébastien Crozet
2022-04-22 15:45:53 +02:00
parent 21a31bc102
commit bc2ae4b512
19 changed files with 795 additions and 85 deletions

View File

@@ -541,6 +541,17 @@ impl PhysicsPipeline {
self.clear_modified_colliders(colliders, &mut modified_colliders);
}
// Finally, make sure we update the world mass-properties of the rigid-bodies
// that moved. Otherwise, users may end up applying forces wrt. an outdated
// center of mass.
// TODO: avoid updating the world mass properties twice (here, and
// at the beginning of the next timestep) for bodies that were
// not modified by the user in the mean time.
for handle in islands.active_dynamic_bodies() {
let rb = bodies.index_mut_internal(*handle);
rb.mprops.update_world_mass_properties(&rb.pos.position);
}
self.counters.step_completed();
}
}