Struct oxygengine_physics_2d::prelude::algebra::Inertia2 [−][src]
pub struct Inertia2<N> where
N: RealField, {
pub linear: N,
pub angular: N,
}
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.
Implementations
impl<N> Inertia2<N> where
N: RealField,
[src]
impl<N> Inertia2<N> where
N: RealField,
[src]pub fn new(linear: N, angular: N) -> Inertia2<N>
[src]
Creates an inertia from its linear and angular components.
pub fn new_with_angular_matrix(
linear: N,
angular: Matrix<N, U1, U1, <DefaultAllocator as Allocator<N, U1, U1>>::Buffer>
) -> Inertia2<N>
[src]
linear: N,
angular: Matrix<N, U1, U1, <DefaultAllocator as Allocator<N, U1, U1>>::Buffer>
) -> Inertia2<N>
Creates an inertia from its linear and angular components.
pub fn mass(&self) -> N
[src]
Get the mass.
pub fn inv_mass(&self) -> N
[src]
Get the inverse mass.
Returns 0.0 if the mass is 0.0.
pub fn zero() -> Inertia2<N>
[src]
Create a zero inertia.
pub fn angular_matrix(
&self
) -> &Matrix<N, U1, U1, <DefaultAllocator as Allocator<N, U1, U1>>::Buffer>
[src]
&self
) -> &Matrix<N, U1, U1, <DefaultAllocator as Allocator<N, U1, U1>>::Buffer>
Get the angular inertia tensor.
pub fn to_matrix(
&self
) -> Matrix<N, U3, U3, <DefaultAllocator as Allocator<N, U3, U3>>::Buffer>
[src]
&self
) -> Matrix<N, U3, U3, <DefaultAllocator as Allocator<N, U3, U3>>::Buffer>
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, &Isometry<N, U2, Unit<Complex<N>>>) -> Inertia2<N>
[src]
Compute the inertia on the given coordinate frame.
pub fn inverse(&self) -> Inertia2<N>
[src]
Inverts this inetia matrix.
Sets the angular part to zero if it is not invertible.
Trait Implementations
impl<N> AddAssign<Inertia2<N>> for Inertia2<N> where
N: RealField,
[src]
impl<N> AddAssign<Inertia2<N>> for Inertia2<N> where
N: RealField,
[src]pub fn add_assign(&mut self, rhs: Inertia2<N>)
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for Inertia2<N> where
N: RefUnwindSafe,
impl<N> RefUnwindSafe for Inertia2<N> where
N: RefUnwindSafe,
impl<N> UnwindSafe for Inertia2<N> where
N: UnwindSafe,
impl<N> UnwindSafe for Inertia2<N> where
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,