pub struct RigidBody { /* private fields */ }
Expand description
The structure that represents physical objects in the gameworld.
Implementations
sourceimpl RigidBody
impl RigidBody
sourcepub fn new(mass: Mass, bbox: BBox, position: Vector, rotation: Rotation) -> Self
pub fn new(mass: Mass, bbox: BBox, position: Vector, rotation: Rotation) -> Self
Create a new RigidBody.
sourcepub fn apply_gravity(&mut self)
pub fn apply_gravity(&mut self)
This method specifically applies the force of gravity to a given
RigidBody
sourcepub fn apply_force(&mut self, force: Vector)
pub fn apply_force(&mut self, force: Vector)
Apply a force vector to this RigidBody
.
sourcepub fn apply_spin(&mut self, spin: Rotation)
pub fn apply_spin(&mut self, spin: Rotation)
Add a spin to this RigidBody
.
sourcepub fn stop_force(&mut self)
pub fn stop_force(&mut self)
Stop forces on this RigidBody
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RigidBody
impl Send for RigidBody
impl Sync for RigidBody
impl Unpin for RigidBody
impl UnwindSafe for RigidBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more