[][src]Struct resphys::Body

pub struct Body {
    pub position: Vec2,
    pub velocity: Vec2,
    pub status: BodyStatus,
    pub self_collide: bool,
    // some fields omitted
}

Describes a body.

It functions as a container for colliders.

Fields

position: Vec2velocity: Vec2

static body CAN have velocity - it just behaves as if it had infinite mass
(this might change with introduction of kinematic body that pushes other objects)
and doesn't collide with other static bodies

status: BodyStatus

Type of body - static or kinematic

self_collide: bool

Whether colliders of the same body should collide

Implementations

impl Body[src]

pub fn new(
    position: Vec2,
    velocity: Vec2,
    status: BodyStatus,
    self_collide: bool
) -> Self
[src]

Trait Implementations

impl Clone for Body[src]

impl Debug for Body[src]

Auto Trait Implementations

impl RefUnwindSafe for Body

impl Send for Body

impl Sync for Body

impl Unpin for Body

impl UnwindSafe for Body

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.