Skip to content

Commit

Permalink
Protect MassProperties behind an immutable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Jul 26, 2023
1 parent af5ac6e commit e2e96a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dynamics/rigid_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ impl Default for AdditionalMassProperties {
/// and the `AdditionalMassProperties` should be modified instead).
#[derive(Copy, Clone, Debug, Default, PartialEq, Component, Reflect)]
#[reflect(Component, PartialEq)]
pub struct ReadMassProperties(pub MassProperties);
pub struct ReadMassProperties(MassProperties);

impl ReadMassProperties {
/// Get the [`MassProperties`] of this rigid-body.
pub fn get(&self) -> &MassProperties {
&self.0
}
}

/// Center-of-mass, mass, and angular inertia.
///
Expand Down

0 comments on commit e2e96a9

Please sign in to comment.