Struct oxygengine_physics_2d::prelude::MultibodyLink
source · pub struct MultibodyLink<N>where
N: RealField + Copy,{ /* private fields */ }
Expand description
One link of a multibody.
Implementations§
source§impl<N> MultibodyLink<N>where
N: RealField + Copy,
impl<N> MultibodyLink<N>where N: RealField + Copy,
sourcepub fn new(
internal_id: usize,
assembly_id: usize,
impulse_id: usize,
parent_internal_id: usize,
dof: Box<dyn Joint<N>, Global>,
parent_shift: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
body_shift: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
parent_to_world: Isometry<N, Unit<Complex<N>>, 2>,
local_to_world: Isometry<N, Unit<Complex<N>>, 2>,
local_to_parent: Isometry<N, Unit<Complex<N>>, 2>,
local_inertia: Inertia2<N>,
local_com: OPoint<N, Const<2>>
) -> MultibodyLink<N>
pub fn new( internal_id: usize, assembly_id: usize, impulse_id: usize, parent_internal_id: usize, dof: Box<dyn Joint<N>, Global>, parent_shift: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, body_shift: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, parent_to_world: Isometry<N, Unit<Complex<N>>, 2>, local_to_world: Isometry<N, Unit<Complex<N>>, 2>, local_to_parent: Isometry<N, Unit<Complex<N>>, 2>, local_inertia: Inertia2<N>, local_com: OPoint<N, Const<2>> ) -> MultibodyLink<N>
Creates a new multibody link.
sourcepub fn joint(&self) -> &(dyn Joint<N> + 'static)
pub fn joint(&self) -> &(dyn Joint<N> + 'static)
Reference to the joint attaching this link to its parent.
sourcepub fn joint_mut(&mut self) -> &mut (dyn Joint<N> + 'static)
pub fn joint_mut(&mut self) -> &mut (dyn Joint<N> + 'static)
Mutable reference to the joint attaching this link to its parent.
sourcepub fn parent_shift(
&self
) -> &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>
pub fn parent_shift( &self ) -> &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>
The shift between this link’s parent and this link joint origin.
sourcepub fn body_shift(
&self
) -> &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>
pub fn body_shift( &self ) -> &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>
The shift between this link’s joint origin and this link origin.
Trait Implementations§
source§impl<N> BodyPart<N> for MultibodyLink<N>where
N: RealField + Copy,
impl<N> BodyPart<N> for MultibodyLink<N>where N: RealField + Copy,
source§fn center_of_mass(&self) -> OPoint<N, Const<2>>
fn center_of_mass(&self) -> OPoint<N, Const<2>>
The center of mass of this body part.
source§fn local_center_of_mass(&self) -> OPoint<N, Const<2>>
fn local_center_of_mass(&self) -> OPoint<N, Const<2>>
The local center of mass of this body part.
source§fn position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
fn position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
The position of this body part wrt. the ground.
source§fn local_inertia(&self) -> Inertia2<N>
fn local_inertia(&self) -> Inertia2<N>
The local-space inertia of this body part.
Auto Trait Implementations§
impl<N> !RefUnwindSafe for MultibodyLink<N>
impl<N> Send for MultibodyLink<N>
impl<N> Sync for MultibodyLink<N>
impl<N> Unpin for MultibodyLink<N>where N: Unpin,
impl<N> !UnwindSafe for MultibodyLink<N>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.