# [−][src]Struct nphysics2d::algebra::Inertia2

The inertia of a rigid body grouping both its mass and its angular inertia.

## Fields

`linear: N`

The linear part (mass) of the inertia.

`angular: N`

The angular inertia.

## Methods

`impl<N: Real> Inertia2<N>`

[src]

`impl<N: Real> Inertia2<N>`

`pub fn new(linear: N, angular: N) -> Self`

[src]

`pub fn new(linear: N, angular: N) -> Self`

Creates an inertia from its linear and angular components.

`pub fn new_with_angular_matrix(linear: N, angular: Matrix1<N>) -> Self`

[src]

`pub fn new_with_angular_matrix(linear: N, angular: Matrix1<N>) -> Self`

Creates an inertia from its linear and angular components.

`pub fn mass(&self) -> N`

[src]

`pub fn mass(&self) -> N`

Get the mass.

`pub fn zero() -> Self`

[src]

`pub fn zero() -> Self`

Create a zero inertia.

`pub fn angular_matrix(&self) -> &Matrix1<N>`

[src]

`pub fn angular_matrix(&self) -> &Matrix1<N>`

Get the angular inertia tensor.

`pub fn to_matrix(&self) -> Matrix3<N>`

[src]

`pub fn to_matrix(&self) -> Matrix3<N>`

Convert the inertia into a matrix where the mass is represented as a 2x2 diagonal matrix on the upper-left corner, and the angular part as a 1x1 matrix on the lower-rigth corner.

`pub fn transformed(&self, _: &Isometry2<N>) -> Self`

[src]

`pub fn transformed(&self, _: &Isometry2<N>) -> Self`

Compute the inertia on the given coordinate frame.

`pub fn inverse(&self) -> Self`

[src]

`pub fn inverse(&self) -> Self`

Inverts this inetia matrix.

Sets the angular part to zero if it is not invertible.

## Trait Implementations

`impl<N: Copy + Real> Copy for Inertia2<N>`

[src]

`impl<N: Copy + Real> Copy for Inertia2<N>`

`impl<N: Clone + Real> Clone for Inertia2<N>`

[src]

`impl<N: Clone + Real> Clone for Inertia2<N>`

`fn clone(&self) -> Inertia2<N>`

[src]

`fn clone(&self) -> Inertia2<N>`

`fn clone_from(&mut self, source: &Self)`

1.0.0[src]

`fn clone_from(&mut self, source: &Self)`

Performs copy-assignment from `source`

. Read more

`impl<N: Real> Add<Inertia2<N>> for Inertia2<N>`

[src]

`impl<N: Real> Add<Inertia2<N>> for Inertia2<N>`

`type Output = Inertia2<N>`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: Inertia2<N>) -> Inertia2<N>`

[src]

`fn add(self, rhs: Inertia2<N>) -> Inertia2<N>`

`impl<N: Real> Mul<Velocity2<N>> for Inertia2<N>`

[src]

`impl<N: Real> Mul<Velocity2<N>> for Inertia2<N>`

`type Output = Force2<N>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: Velocity2<N>) -> Force2<N>`

[src]

`fn mul(self, rhs: Velocity2<N>) -> Force2<N>`

`impl<N: Real> Mul<Force2<N>> for Inertia2<N>`

[src]

`impl<N: Real> Mul<Force2<N>> for Inertia2<N>`

`type Output = Velocity2<N>`

The resulting type after applying the `*`

operator.

`fn mul(self, rhs: Force2<N>) -> Velocity2<N>`

[src]

`fn mul(self, rhs: Force2<N>) -> Velocity2<N>`

`impl<N: Real> AddAssign<Inertia2<N>> for Inertia2<N>`

[src]

`impl<N: Real> AddAssign<Inertia2<N>> for Inertia2<N>`

`fn add_assign(&mut self, rhs: Inertia2<N>)`

[src]

`fn add_assign(&mut self, rhs: Inertia2<N>)`

`impl<N: Debug + Real> Debug for Inertia2<N>`

[src]

`impl<N: Debug + Real> Debug for Inertia2<N>`

## Auto Trait Implementations

## Blanket Implementations

`impl<T> From for T`

[src]

`impl<T> From for T`

`impl<T, U> Into for T where`

U: From<T>,

[src]

`impl<T, U> Into for T where`

U: From<T>,

`impl<T> ToOwned for T where`

T: Clone,

[src]

`impl<T> ToOwned for T where`

T: Clone,

`impl<T, U> TryFrom for T where`

T: From<U>,

[src]

`impl<T, U> TryFrom for T where`

T: From<U>,

`type Error = !`

`try_from`

)The type returned in the event of a conversion error.

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

`impl<T> Borrow for T where`

T: ?Sized,

[src]

`impl<T> Borrow for T where`

T: ?Sized,

`impl<T> Any for T where`

T: 'static + ?Sized,

[src]

`impl<T> Any for T where`

T: 'static + ?Sized,

`fn get_type_id(&self) -> TypeId`

[src]

`fn get_type_id(&self) -> TypeId`

`impl<T, U> TryInto for T where`

U: TryFrom<T>,

[src]

`impl<T, U> TryInto for T where`

U: TryFrom<T>,

`type Error = <U as TryFrom<T>>::Error`

`try_from`

)The type returned in the event of a conversion error.

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

`impl<T> BorrowMut for T where`

T: ?Sized,

[src]

`impl<T> BorrowMut for T where`

T: ?Sized,

`fn borrow_mut(&mut self) -> &mut T`

[src]

`fn borrow_mut(&mut self) -> &mut T`

`impl<T> Downcast for T where`

T: Any,

`impl<T> Downcast for T where`

T: Any,

`fn into_any(self: Box<T>) -> Box<dyn Any + 'static>`

`fn into_any(self: Box<T>) -> Box<dyn Any + 'static>`

`fn as_any(&self) -> &(dyn Any + 'static)`

`fn as_any(&self) -> &(dyn Any + 'static)`

`fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)`

`fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)`

`impl<T, Right> ClosedAdd for T where`

T: Add<Right, Output = T> + AddAssign<Right>,

`impl<T, Right> ClosedAdd for T where`

T: Add<Right, Output = T> + AddAssign<Right>,

`impl<SS, SP> SupersetOf for SP where`

SS: SubsetOf<SP>,

`impl<SS, SP> SupersetOf for SP where`

SS: SubsetOf<SP>,

`fn to_subset(&self) -> Option<SS>`

`fn to_subset(&self) -> Option<SS>`

`fn is_in_subset(&self) -> bool`

`fn is_in_subset(&self) -> bool`

`unsafe fn to_subset_unchecked(&self) -> SS`

`unsafe fn to_subset_unchecked(&self) -> SS`

`fn from_subset(element: &SS) -> SP`

`fn from_subset(element: &SS) -> SP`

`impl<T> Same for T`

`impl<T> Same for T`

`type Output = T`

Should always be `Self`