#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(class_name)
Definition SerializableObject.h:71
Describes the mass and inertia properties of a body. Used during body construction only.
Definition MassProperties.h:16
static Vec3 sGetEquivalentSolidBoxSize(float inMass, Vec3Arg inInertiaDiagonal)
Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal.
Definition MassProperties.cpp:94
void Rotate(Mat44Arg inRotation)
Rotate the inertia by 3x3 matrix inRotation.
Definition MassProperties.cpp:157
void SaveBinaryState(StreamOut &inStream) const
Saves the state of this object in binary form to inStream.
Definition MassProperties.cpp:173
bool DecomposePrincipalMomentsOfInertia(Mat44 &outRotation, Vec3 &outDiagonal) const
Definition MassProperties.cpp:24
Mat44 mInertia
Inertia tensor of the shape (kg m^2)
Definition MassProperties.h:55
void SetMassAndInertiaOfSolidBox(Vec3Arg inBoxSize, float inDensity)
Set the mass and inertia of a box with edge size inBoxSize and density inDensity.
Definition MassProperties.cpp:62
void Translate(Vec3Arg inTranslation)
Translate the inertia by a vector inTranslation.
Definition MassProperties.cpp:162
void RestoreBinaryState(StreamIn &inStream)
Restore the state of this object from inStream.
Definition MassProperties.cpp:179
void Scale(Vec3Arg inScale)
Scale the mass and inertia by inScale, note that elements can be < 0 to flip the shape.
Definition MassProperties.cpp:103
float mMass
Mass of the shape (kg)
Definition MassProperties.h:52
void ScaleToMass(float inMass)
Set the mass and scale the inertia tensor to match the mass.
Definition MassProperties.cpp:73
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
static JPH_INLINE Mat44 sZero()
Zero matrix.
Definition Mat44.inl:30
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11