[−][src]Trait oxygengine_physics_2d::prelude::object::BodyPart
Trait implemented by each part of a body supported by nphysics.
Required methods
fn center_of_mass(&self) -> Point<N, U2>
The center of mass of this body part.
fn local_center_of_mass(&self) -> Point<N, U2>
The local center of mass of this body part.
fn position(&self) -> Isometry<N, U2, Unit<Complex<N>>>
The position of this body part wrt. the ground.
fn velocity(&self) -> Velocity2<N>
The velocity of this body part.
fn inertia(&self) -> Inertia2<N>
The world-space inertia of this body part.
fn local_inertia(&self) -> Inertia2<N>
The local-space inertia of this body part.
Provided methods
fn is_ground(&self) -> bool
Returns true
if this body part is the ground.
fn safe_position(&self) -> Isometry<N, U2, Unit<Complex<N>>>
If CCD is enabled, this is the last position known to be tunnelling-free.
Implementations
impl<N> dyn BodyPart<N> + 'static where
N: Any + 'static + RealField,
N: Any + 'static + RealField,
pub fn is<__T>(&self) -> bool where
__T: BodyPart<N>,
__T: BodyPart<N>,
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T>(
self: Box<dyn BodyPart<N> + 'static>
) -> Result<Box<__T>, Box<dyn BodyPart<N> + 'static>> where
__T: BodyPart<N>,
self: Box<dyn BodyPart<N> + 'static>
) -> Result<Box<__T>, Box<dyn BodyPart<N> + 'static>> where
__T: BodyPart<N>,
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>(
self: Rc<dyn BodyPart<N> + 'static>
) -> Result<Rc<__T>, Rc<dyn BodyPart<N> + 'static>> where
__T: BodyPart<N>,
self: Rc<dyn BodyPart<N> + 'static>
) -> Result<Rc<__T>, Rc<dyn BodyPart<N> + 'static>> where
__T: BodyPart<N>,
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>(&self) -> Option<&__T> where
__T: BodyPart<N>,
__T: BodyPart<N>,
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>(&mut self) -> Option<&mut __T> where
__T: BodyPart<N>,
__T: BodyPart<N>,
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> BodyPart<N> for Ground<N> where
N: RealField,
[src]
N: RealField,
fn is_ground(&self) -> bool
[src]
fn center_of_mass(&self) -> Point<N, U2>
[src]
fn local_center_of_mass(&self) -> Point<N, U2>
[src]
fn position(&self) -> Isometry<N, U2, Unit<Complex<N>>>
[src]
fn safe_position(&self) -> Isometry<N, U2, Unit<Complex<N>>>
[src]
fn velocity(&self) -> Velocity2<N>
[src]
fn inertia(&self) -> Inertia2<N>
[src]
fn local_inertia(&self) -> Inertia2<N>
[src]
impl<N> BodyPart<N> for MultibodyLink<N> where
N: RealField,
[src]
N: RealField,
fn is_ground(&self) -> bool
[src]
fn center_of_mass(&self) -> Point<N, U2>
[src]
fn local_center_of_mass(&self) -> Point<N, U2>
[src]
fn velocity(&self) -> Velocity2<N>
[src]
fn position(&self) -> Isometry<N, U2, Unit<Complex<N>>>
[src]
fn local_inertia(&self) -> Inertia2<N>
[src]
fn inertia(&self) -> Inertia2<N>
[src]
impl<N> BodyPart<N> for RigidBody<N> where
N: RealField,
[src]
N: RealField,