#[repr(C)]pub struct SpatialInertia<S> {
pub mass: S,
pub com: Vec3<S>,
pub inertia: Mat3<S>,
}Expand description
Spatial inertia — compact representation.
Stored as mass + center of mass + rotational inertia (3x3). Converts to 6x6 spatial inertia matrix on demand.
Fields§
§mass: S§com: Vec3<S>§inertia: Mat3<S>Implementations§
Source§impl<S: Scalar> SpatialInertia<S>
impl<S: Scalar> SpatialInertia<S>
pub fn new(mass: S, com: Vec3<S>, inertia: Mat3<S>) -> Self
Sourcepub fn point_mass(mass: S, pos: Vec3<S>) -> Self
pub fn point_mass(mass: S, pos: Vec3<S>) -> Self
Point mass at a given position
Sourcepub fn to_matrix(&self) -> SpatialMat<S>
pub fn to_matrix(&self) -> SpatialMat<S>
Convert to 6x6 spatial inertia matrix (block-structured)
| I + m[c]×[c]×^T m[c]× |
| m[c]×^T mE |Sourcepub fn transform(&self, xform: &SpatialTransform<S>) -> SpatialInertia<S>
pub fn transform(&self, xform: &SpatialTransform<S>) -> SpatialInertia<S>
Transform spatial inertia to a new reference frame
Trait Implementations§
Source§impl<S: Clone> Clone for SpatialInertia<S>
impl<S: Clone> Clone for SpatialInertia<S>
Source§fn clone(&self) -> SpatialInertia<S>
fn clone(&self) -> SpatialInertia<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for SpatialInertia<S>
impl<S: Debug> Debug for SpatialInertia<S>
Source§impl<S: PartialEq> PartialEq for SpatialInertia<S>
impl<S: PartialEq> PartialEq for SpatialInertia<S>
impl<S: Copy> Copy for SpatialInertia<S>
impl<S> StructuralPartialEq for SpatialInertia<S>
Auto Trait Implementations§
impl<S> Freeze for SpatialInertia<S>where
S: Freeze,
impl<S> RefUnwindSafe for SpatialInertia<S>where
S: RefUnwindSafe,
impl<S> Send for SpatialInertia<S>where
S: Send,
impl<S> Sync for SpatialInertia<S>where
S: Sync,
impl<S> Unpin for SpatialInertia<S>where
S: Unpin,
impl<S> UnsafeUnpin for SpatialInertia<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SpatialInertia<S>where
S: UnwindSafe,
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