Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/dynamics/rigid_body/mass_properties/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,9 @@ pub struct NoAutoCenterOfMass;

/// Triggers the recomputation of mass properties for rigid bodies when automatic computation is re-enabled.
fn on_remove_no_auto_mass_property(mut world: DeferredWorld, entity: Entity, _id: ComponentId) {
world
.commands()
.entity(entity)
.insert(RecomputeMassProperties);
if let Some(mut entity_commands) = world.commands().get_entity(entity) {
entity_commands.try_insert(RecomputeMassProperties);
}
}

/// A marker component that forces the recomputation of [`ComputedMass`], [`ComputedAngularInertia`]
Expand Down
Loading