diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-12-11 18:38:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-11 18:38:18 +0100 |
| commit | 8fa2a61249a60d6fc6440ef29f66a83f01585e54 (patch) | |
| tree | 8fed8828dcc9337a5fdc65580344f8bf12983ab4 /src/dynamics/rigid_body_components.rs | |
| parent | c600549aacbde1361eba862b34a23f63d806d6a9 (diff) | |
| parent | a1e255dbcdbfde270df32eeda59360493649c73f (diff) | |
| download | rapier-8fa2a61249a60d6fc6440ef29f66a83f01585e54.tar.gz rapier-8fa2a61249a60d6fc6440ef29f66a83f01585e54.tar.bz2 rapier-8fa2a61249a60d6fc6440ef29f66a83f01585e54.zip | |
Merge pull request #427 from dimforge/disable
Add enable/disable, incremental query pipeline, and vehicle character contoller
Diffstat (limited to 'src/dynamics/rigid_body_components.rs')
| -rw-r--r-- | src/dynamics/rigid_body_components.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/dynamics/rigid_body_components.rs b/src/dynamics/rigid_body_components.rs index cabf6ca..eb94c6b 100644 --- a/src/dynamics/rigid_body_components.rs +++ b/src/dynamics/rigid_body_components.rs @@ -112,6 +112,8 @@ bitflags::bitflags! { const DOMINANCE = 1 << 5; /// Flag indicating that the local mass-properties of this rigid-body must be recomputed. const LOCAL_MASS_PROPERTIES = 1 << 6; + /// Flag indicating that the rigid-body was enabled or disabled. + const ENABLED_OR_DISABLED = 1 << 7; } } @@ -329,12 +331,14 @@ impl RigidBodyMassProps { for handle in &attached_colliders.0 { if let Some(co) = colliders.get(*handle) { - if let Some(co_parent) = co.parent { - let to_add = co - .mprops - .mass_properties(&*co.shape) - .transform_by(&co_parent.pos_wrt_parent); - self.local_mprops += to_add; + if co.is_enabled() { + if let Some(co_parent) = co.parent { + let to_add = co + .mprops + .mass_properties(&*co.shape) + .transform_by(&co_parent.pos_wrt_parent); + self.local_mprops += to_add; + } } } } |
