brutal/brutal.jolt/Brutal.Jolt/Generated/Classes/MassProperties.gen.cs
2026-10-15 14:12:02 +13:00

214 lines
9.8 KiB
C#

// <auto-generated/>
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L15">Jolt/Physics/Body/MassProperties.h:15</see>
/// <br/>
/// <c>class MassProperties</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Describes the mass and inertia properties of a body. Used during body construction only.
/// </para>
/// </remarks>
[InteropHandle]
public readonly partial struct MassProperties : IDisposable
{
public static MassProperties Create() => Jolt.PInvoke.MassProperties_Create();
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L25">Jolt/Physics/Body/MassProperties.h:25</see>
/// <br/>
/// <c>bool DecomposePrincipalMomentsOfInertia(Mat44 &amp;outRotation, Vec3 &amp;outDiagonal) const</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// 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
/// </code>
/// </remarks>
public bool DecomposePrincipalMomentsOfInertia(out float4x4 rotation, out float3 diagonal) => Jolt.PInvoke.MassProperties_DecomposePrincipalMomentsOfInertia(this, out rotation, out diagonal);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L28">Jolt/Physics/Body/MassProperties.h:28</see>
/// <br/>
/// <c>void SetMassAndInertiaOfSolidBox(Vec3Arg inBoxSize, float inDensity)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Set the mass and inertia of a box with edge size inBoxSize and density inDensity
/// </para>
/// </remarks>
public void SetMassAndInertiaOfSolidBox(float3 boxSize, float density) => Jolt.PInvoke.MassProperties_SetMassAndInertiaOfSolidBox(this, boxSize, density);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L31">Jolt/Physics/Body/MassProperties.h:31</see>
/// <br/>
/// <c>void ScaleToMass(float inMass)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Set the mass and scale the inertia tensor to match the mass
/// </para>
/// </remarks>
public void ScaleToMass(float mass) => Jolt.PInvoke.MassProperties_ScaleToMass(this, mass);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L34">Jolt/Physics/Body/MassProperties.h:34</see>
/// <br/>
/// <c>static Vec3 sGetEquivalentSolidBoxSize(float inMass, Vec3Arg inInertiaDiagonal)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal
/// </para>
/// </remarks>
public static float3 sGetEquivalentSolidBoxSize(float mass, float3 inertiaDiagonal) => Jolt.PInvoke.MassProperties_sGetEquivalentSolidBoxSize(mass, inertiaDiagonal);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L37">Jolt/Physics/Body/MassProperties.h:37</see>
/// <br/>
/// <c>void Rotate(Mat44Arg inRotation)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Rotate the inertia by 3x3 matrix inRotation
/// </para>
/// </remarks>
public void Rotate(float4x4 rotation) => Jolt.PInvoke.MassProperties_Rotate(this, rotation);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L40">Jolt/Physics/Body/MassProperties.h:40</see>
/// <br/>
/// <c>void Translate(Vec3Arg inTranslation)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Translate the inertia by a vector inTranslation
/// </para>
/// </remarks>
public void Translate(float3 translation) => Jolt.PInvoke.MassProperties_Translate(this, translation);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L43">Jolt/Physics/Body/MassProperties.h:43</see>
/// <br/>
/// <c>void Scale(Vec3Arg inScale)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Scale the mass and inertia by inScale, note that elements can be &lt; 0 to flip the shape
/// </para>
/// </remarks>
public void Scale(float3 scale) => Jolt.PInvoke.MassProperties_Scale(this, scale);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L46">Jolt/Physics/Body/MassProperties.h:46</see>
/// <br/>
/// <c>void SaveBinaryState(StreamOut &amp;inStream) const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Saves the state of this object in binary form to inStream.
/// </para>
/// </remarks>
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.MassProperties_SaveBinaryState(this, stream);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L49">Jolt/Physics/Body/MassProperties.h:49</see>
/// <br/>
/// <c>void RestoreBinaryState(StreamIn &amp;inStream)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Restore the state of this object from inStream.
/// </para>
/// </remarks>
public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.MassProperties_RestoreBinaryState(this, stream);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L52">Jolt/Physics/Body/MassProperties.h:52</see>
/// <br/>
/// <c>float mMass = 0.0f</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Mass of the shape (kg)
/// </para>
/// </remarks>
public float GetMass() => Jolt.PInvoke.MassProperties_GetMass(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L52">Jolt/Physics/Body/MassProperties.h:52</see>
/// <br/>
/// <c>float mMass = 0.0f</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Mass of the shape (kg)
/// </para>
/// </remarks>
public void SetMass(float value) => Jolt.PInvoke.MassProperties_SetMass(this, value);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L55">Jolt/Physics/Body/MassProperties.h:55</see>
/// <br/>
/// <c>Mat44 mInertia = Mat44::sZero()</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Inertia tensor of the shape (kg m^2)
/// </para>
/// </remarks>
public float4x4 GetInertia() => Jolt.PInvoke.MassProperties_GetInertia(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Body/MassProperties.h#L55">Jolt/Physics/Body/MassProperties.h:55</see>
/// <br/>
/// <c>Mat44 mInertia = Mat44::sZero()</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Inertia tensor of the shape (kg m^2)
/// </para>
/// </remarks>
public void SetInertia(float4x4 value) => Jolt.PInvoke.MassProperties_SetInertia(this, value);
public void Dispose() => Jolt.PInvoke.MassProperties_Destroy(this);
}
}