Track the change of effective dominance of a rigid-body.

This commit is contained in:
Sébastien Crozet
2021-10-24 16:40:16 +02:00
committed by Sébastien Crozet
parent 601955b4ee
commit b45d4b5ac2
4 changed files with 36 additions and 6 deletions

View File

@@ -331,7 +331,10 @@ impl RigidBody {
/// The dominance group of this rigid-body.
pub fn set_dominance_group(&mut self, dominance: i8) {
self.rb_dominance.0 = dominance
if self.rb_dominance.0 != dominance {
self.changes.insert(RigidBodyChanges::DOMINANCE);
self.rb_dominance.0 = dominance
}
}
/// Adds a collider to this rigid-body.

View File

@@ -107,6 +107,8 @@ bitflags::bitflags! {
const COLLIDERS = 1 << 3;
/// Flag indicating that the `RigidBodyType` component of this rigid-body has been modified.
const TYPE = 1 << 4;
/// Flag indicating that the `RigidBodyDominance` component of this rigid-body has been modified.
const DOMINANCE = 1 << 5;
}
}