Skip to content

Commit

Permalink
Initialize modified masses resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Jul 29, 2023
1 parent 86c24a4 commit cb0260a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/plugin/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ where
// Insert all of our required resources. Don’t overwrite
// the `RapierConfiguration` if it already exists.
app.init_resource::<RapierConfiguration>();
app.init_resource::<systems::ModifiedMasses>();

app.insert_resource(SimulationToRenderTime::default())
.insert_resource(RapierContext {
Expand Down
3 changes: 2 additions & 1 deletion src/plugin/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ pub fn writeback_rigid_bodies(
}

/// Entities that likely had their mass properties changed this frame.
#[derive(Resource, Deref, DerefMut)]
#[derive(Resource, Deref, DerefMut, Default, Reflect)]
#[reflect(Resource)]
pub struct ModifiedMasses(pub Vec<Entity>);

/// System responsible for writing updated mass properties back into the [`ReadMassProperties`] component.
Expand Down

0 comments on commit cb0260a

Please sign in to comment.