diff options
| author | Sébastien Crozet <developer@crozet.re> | 2021-10-24 16:40:16 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2021-10-26 15:38:54 +0200 |
| commit | b45d4b5ac2b31856c15e802b31e288a58940cbf2 (patch) | |
| tree | e6ed90504637749cb99229dc5d1d6abb02ce7b72 /src/dynamics | |
| parent | 601955b4ee4096db1f387017eb3d85ff727f6d31 (diff) | |
| download | rapier-b45d4b5ac2b31856c15e802b31e288a58940cbf2.tar.gz rapier-b45d4b5ac2b31856c15e802b31e288a58940cbf2.tar.bz2 rapier-b45d4b5ac2b31856c15e802b31e288a58940cbf2.zip | |
Track the change of effective dominance of a rigid-body.
Diffstat (limited to 'src/dynamics')
| -rw-r--r-- | src/dynamics/rigid_body.rs | 5 | ||||
| -rw-r--r-- | src/dynamics/rigid_body_components.rs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/dynamics/rigid_body.rs b/src/dynamics/rigid_body.rs index c0acd5e..de11e15 100644 --- a/src/dynamics/rigid_body.rs +++ b/src/dynamics/rigid_body.rs @@ -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. diff --git a/src/dynamics/rigid_body_components.rs b/src/dynamics/rigid_body_components.rs index 82ecacf..a135a1c 100644 --- a/src/dynamics/rigid_body_components.rs +++ b/src/dynamics/rigid_body_components.rs @@ -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; } } |
