Allow disabling colliders, rigid-bodies and impulse joints
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user