pub struct MassData { /* private fields */ }Expand description
Mass properties (mass, center, inertia) used by Box2D.
Implementations§
Source§impl MassData
impl MassData
pub fn new(mass: f32, center: Vec2, rotational_inertia: f32) -> Result<Self>
Sourcepub fn from_raw(raw: b2MassData) -> Result<Self>
pub fn from_raw(raw: b2MassData) -> Result<Self>
Construct from a raw Box2D value after validating its invariants.
pub const fn mass(self) -> f32
pub const fn center(self) -> Vec2
pub const fn rotational_inertia(self) -> f32
Sourcepub fn into_raw(self) -> b2MassData
pub fn into_raw(self) -> b2MassData
Convert into the raw Box2D value.
Trait Implementations§
impl Copy for MassData
impl StructuralPartialEq for MassData
Auto Trait Implementations§
impl Freeze for MassData
impl RefUnwindSafe for MassData
impl Send for MassData
impl Sync for MassData
impl Unpin for MassData
impl UnsafeUnpin for MassData
impl UnwindSafe for MassData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more