Improve the API for initializing/setting mass-properties

This commit is contained in:
Sébastien Crozet
2022-07-05 14:59:14 +02:00
parent b8d46a6b1d
commit ba081fb6f5
7 changed files with 294 additions and 175 deletions

View File

@@ -407,6 +407,9 @@ impl PhysicsPipeline {
hooks: &dyn PhysicsHooks,
events: &dyn EventHandler,
) {
self.counters.reset();
self.counters.step_started();
// Apply some of delayed wake-ups.
for handle in impulse_joints
.to_wake_up
@@ -417,18 +420,15 @@ impl PhysicsPipeline {
}
// Apply modifications.
let modified_bodies = bodies.take_modified();
let mut modified_colliders = colliders.take_modified();
let mut removed_colliders = colliders.take_removed();
self.counters.reset();
self.counters.step_started();
super::user_changes::handle_user_changes_to_colliders(
bodies,
colliders,
&modified_colliders[..],
);
let modified_bodies = bodies.take_modified();
super::user_changes::handle_user_changes_to_rigid_bodies(
Some(islands),
bodies,