Describes the mass and inertia properties of a body. Used during body construction only.
More...
#include <MassProperties.h>
Describes the mass and inertia properties of a body. Used during body construction only.
◆ DecomposePrincipalMomentsOfInertia()
| bool MassProperties::DecomposePrincipalMomentsOfInertia |
( |
Mat44 & | outRotation, |
|
|
Vec3 & | outDiagonal ) const |
Using eigendecomposition, decompose the inertia tensor into a diagonal matrix D and a right-handed rotation matrix R so that the inertia tensor is \(R \: D \: R^{-1}\).
- See also
- https://en.wikipedia.org/wiki/Moment_of_inertia section 'Principal axes'
- Parameters
-
| outRotation | The rotation matrix R |
| outDiagonal | The diagonal of the diagonal matrix D |
- Returns
- True if successful, false if failed
◆ operator!=()
◆ operator==()
◆ RestoreBinaryState()
| void MassProperties::RestoreBinaryState |
( |
StreamIn & | inStream | ) |
|
Restore the state of this object from inStream.
◆ Rotate()
| void MassProperties::Rotate |
( |
Mat44Arg | inRotation | ) |
|
Rotate the inertia by 3x3 matrix inRotation.
◆ SaveBinaryState()
| void MassProperties::SaveBinaryState |
( |
StreamOut & | inStream | ) |
const |
Saves the state of this object in binary form to inStream.
◆ Scale()
| void MassProperties::Scale |
( |
Vec3Arg | inScale | ) |
|
Scale the mass and inertia by inScale, note that elements can be < 0 to flip the shape.
◆ ScaleToMass()
| void MassProperties::ScaleToMass |
( |
float | inMass | ) |
|
Set the mass and scale the inertia tensor to match the mass.
◆ SetMassAndInertiaOfSolidBox()
| void MassProperties::SetMassAndInertiaOfSolidBox |
( |
Vec3Arg | inBoxSize, |
|
|
float | inDensity ) |
Set the mass and inertia of a box with edge size inBoxSize and density inDensity.
◆ sGetEquivalentSolidBoxSize()
| Vec3 MassProperties::sGetEquivalentSolidBoxSize |
( |
float | inMass, |
|
|
Vec3Arg | inInertiaDiagonal ) |
|
static |
Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal.
◆ Translate()
| void MassProperties::Translate |
( |
Vec3Arg | inTranslation | ) |
|
Translate the inertia by a vector inTranslation.
◆ mInertia
Inertia tensor of the shape (kg m^2)
◆ mMass
| float MassProperties::mMass = 0.0f |
The documentation for this class was generated from the following files: