[][src]Struct physics2d::Body

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,
    // some fields omitted
}

Fields

id: BodyIdtransform: Transformvelocity: Vec2angular_vel: f32mass: f32inertia: f32inv_mass: f32inv_inertia: f32shape: Shapebounds: Boundsmaterial: Material

Methods

impl Body[src]

pub fn new(shape: Shape, density: f32, material: Material) -> Body[src]

pub fn set_static(&mut self)[src]

pub fn is_static(&self) -> bool[src]

pub fn add_force(&mut self, force: Vec2)[src]

pub fn add_torque(&mut self, torque: f32)[src]

pub fn add_force_at_pos(&mut self, force: Vec2, pos: Vec2)[src]

pub fn add_impulse_at_pos(&mut self, impulse: Vec2, pos: Vec2)[src]

Auto Trait Implementations

impl Sync for Body

impl Send for Body

impl Unpin for Body

impl RefUnwindSafe for Body

impl UnwindSafe for Body

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]