Properly take initial sleeping state set by the user when creating a rigid-body

This commit is contained in:
Sébastien Crozet
2022-12-11 17:47:16 +01:00
parent cb9350fd80
commit 0207f8cf96
6 changed files with 46 additions and 21 deletions

View File

@@ -86,14 +86,6 @@ pub(crate) fn handle_user_changes_to_rigid_bodies(
ids.active_set_id,
));
}
// Add to the active dynamic set.
activation.wake_up(true);
// Make sure the sleep change flag is set (even if for some
// reasons the rigid-body was already awake) to make
// sure the code handling sleeping change adds the body to
// the active_dynamic_set.
changes.set(RigidBodyChanges::SLEEP, true);
}
RigidBodyType::KinematicVelocityBased
| RigidBodyType::KinematicPositionBased => {
@@ -216,7 +208,6 @@ pub(crate) fn handle_user_changes_to_rigid_bodies(
}
}
rb.changes = RigidBodyChanges::empty();
rb.ids = ids;
rb.activation = activation;
}