[][src]Trait nphysics2d::object::BodyPart

pub trait BodyPart<N: RealField>: Downcast + Send + Sync {
    pub fn center_of_mass(&self) -> Point<N>;
pub fn local_center_of_mass(&self) -> Point<N>;
pub fn position(&self) -> Isometry<N>;
pub fn velocity(&self) -> Velocity<N>;
pub fn inertia(&self) -> Inertia<N>;
pub fn local_inertia(&self) -> Inertia<N>; pub fn is_ground(&self) -> bool { ... }
pub fn safe_position(&self) -> Isometry<N> { ... } }

Trait implemented by each part of a body supported by nphysics.

Required methods

pub fn center_of_mass(&self) -> Point<N>[src]

The center of mass of this body part.

pub fn local_center_of_mass(&self) -> Point<N>[src]

The local center of mass of this body part.

pub fn position(&self) -> Isometry<N>[src]

The position of this body part wrt. the ground.

pub fn velocity(&self) -> Velocity<N>[src]

The velocity of this body part.

pub fn inertia(&self) -> Inertia<N>[src]

The world-space inertia of this body part.

pub fn local_inertia(&self) -> Inertia<N>[src]

The local-space inertia of this body part.

Loading content...

Provided methods

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

Returns true if this body part is the ground.

pub fn safe_position(&self) -> Isometry<N>[src]

If CCD is enabled, this is the last position known to be tunnelling-free.

Loading content...

Implementations

impl<N> dyn BodyPart<N> where
    N: Any + 'static,
    N: RealField
[src]

pub fn is<__T: BodyPart<N>>(&self) -> bool[src]

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: BodyPart<N>>(
    self: Box<Self>
) -> Result<Box<__T>, Box<Self>>
[src]

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_rc<__T: BodyPart<N>>(
    self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>
[src]

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn't.

pub fn downcast_ref<__T: BodyPart<N>>(&self) -> Option<&__T>[src]

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: BodyPart<N>>(&mut self) -> Option<&mut __T>[src]

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

impl<N: RealField> BodyPart<N> for Ground<N>[src]

impl<N: RealField> BodyPart<N> for MultibodyLink<N>[src]

impl<N: RealField> BodyPart<N> for RigidBody<N>[src]

Loading content...