pub struct Body {
pub id: BodyId,
pub transform: Transform,
pub velocity: Vec2,
pub angular_vel: f32,
pub mass: f32,
pub inertia: f32,
pub inv_mass: f32,
pub inv_inertia: f32,
pub shape: Shape,
pub bounds: Bounds,
pub material: Material,
/* private fields */
}Fields§
§id: BodyId§transform: Transform§velocity: Vec2§angular_vel: f32§mass: f32§inertia: f32§inv_mass: f32§inv_inertia: f32§shape: Shape§bounds: Bounds§material: MaterialImplementations§
Source§impl Body
impl Body
pub fn new(shape: Shape, density: f32, material: Material) -> Body
pub fn set_static(&mut self)
pub fn is_static(&self) -> bool
pub fn add_force(&mut self, force: Vec2)
pub fn add_torque(&mut self, torque: f32)
pub fn add_force_at_pos(&mut self, force: Vec2, pos: Vec2)
pub fn add_impulse_at_pos(&mut self, impulse: Vec2, pos: Vec2)
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnwindSafe for Body
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