// // Generated by Brutal.Jolt.Generate; do not edit by hand. #nullable enable using Brutal.Interop; using Brutal.Numerics; namespace Brutal.JoltApi { /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:15 ///
/// class MassProperties ///
///
/// /// /// Describes the mass and inertia properties of a body. Used during body construction only. /// /// [InteropHandle] public readonly partial struct MassProperties : IDisposable { public static MassProperties Create() => Jolt.PInvoke.MassProperties_Create(); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:25 ///
/// bool 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 \f$R \: D \: R^{-1}\f$. /// @see https://en.wikipedia.org/wiki/Moment_of_inertia section 'Principal axes' /// @param outRotation The rotation matrix R /// @param outDiagonal The diagonal of the diagonal matrix D /// @return True if successful, false if failed /// /// public bool DecomposePrincipalMomentsOfInertia(out float4x4 rotation, out float3 diagonal) => Jolt.PInvoke.MassProperties_DecomposePrincipalMomentsOfInertia(this, out rotation, out diagonal); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:28 ///
/// void SetMassAndInertiaOfSolidBox(Vec3Arg inBoxSize, float inDensity) ///
///
/// /// /// Set the mass and inertia of a box with edge size inBoxSize and density inDensity /// /// public void SetMassAndInertiaOfSolidBox(float3 boxSize, float density) => Jolt.PInvoke.MassProperties_SetMassAndInertiaOfSolidBox(this, boxSize, density); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:31 ///
/// void ScaleToMass(float inMass) ///
///
/// /// /// Set the mass and scale the inertia tensor to match the mass /// /// public void ScaleToMass(float mass) => Jolt.PInvoke.MassProperties_ScaleToMass(this, mass); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:34 ///
/// static Vec3 sGetEquivalentSolidBoxSize(float inMass, Vec3Arg inInertiaDiagonal) ///
///
/// /// /// Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal /// /// public static float3 sGetEquivalentSolidBoxSize(float mass, float3 inertiaDiagonal) => Jolt.PInvoke.MassProperties_sGetEquivalentSolidBoxSize(mass, inertiaDiagonal); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:37 ///
/// void Rotate(Mat44Arg inRotation) ///
///
/// /// /// Rotate the inertia by 3x3 matrix inRotation /// /// public void Rotate(float4x4 rotation) => Jolt.PInvoke.MassProperties_Rotate(this, rotation); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:40 ///
/// void Translate(Vec3Arg inTranslation) ///
///
/// /// /// Translate the inertia by a vector inTranslation /// /// public void Translate(float3 translation) => Jolt.PInvoke.MassProperties_Translate(this, translation); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:43 ///
/// void Scale(Vec3Arg inScale) ///
///
/// /// /// Scale the mass and inertia by inScale, note that elements can be < 0 to flip the shape /// /// public void Scale(float3 scale) => Jolt.PInvoke.MassProperties_Scale(this, scale); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:46 ///
/// void SaveBinaryState(StreamOut &inStream) const ///
///
/// /// /// Saves the state of this object in binary form to inStream. /// /// public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.MassProperties_SaveBinaryState(this, stream); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:49 ///
/// void RestoreBinaryState(StreamIn &inStream) ///
///
/// /// /// Restore the state of this object from inStream. /// /// public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.MassProperties_RestoreBinaryState(this, stream); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:52 ///
/// float mMass = 0.0f ///
///
/// /// /// Mass of the shape (kg) /// /// public float GetMass() => Jolt.PInvoke.MassProperties_GetMass(this); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:52 ///
/// float mMass = 0.0f ///
///
/// /// /// Mass of the shape (kg) /// /// public void SetMass(float value) => Jolt.PInvoke.MassProperties_SetMass(this, value); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:55 ///
/// Mat44 mInertia = Mat44::sZero() ///
///
/// /// /// Inertia tensor of the shape (kg m^2) /// /// public float4x4 GetInertia() => Jolt.PInvoke.MassProperties_GetInertia(this); /// /// /// C++: /// Jolt/Physics/Body/MassProperties.h:55 ///
/// Mat44 mInertia = Mat44::sZero() ///
///
/// /// /// Inertia tensor of the shape (kg m^2) /// /// public void SetInertia(float4x4 value) => Jolt.PInvoke.MassProperties_SetInertia(this, value); public void Dispose() => Jolt.PInvoke.MassProperties_Destroy(this); } }