mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
211 lines
9.6 KiB
C#
211 lines
9.6 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using System.Runtime.CompilerServices;
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Describes the mass and inertia properties of a body. Used during body construction only.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L15">Jolt/Physics/Body/MassProperties.h:15</see>
|
|
/// <br/>
|
|
/// <c>class MassProperties</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct MassProperties : IDisposable
|
|
{
|
|
public static MassProperties Create() => Jolt.PInvoke.MassProperties_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 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$.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L36">Jolt/Physics/Body/MassProperties.h:36</see>
|
|
/// <br/>
|
|
/// <c>bool DecomposePrincipalMomentsOfInertia(Mat44 &outRotation, Vec3 &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>
|
|
/// Set the mass and inertia of a box with edge size inBoxSize and density inDensity
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L39">Jolt/Physics/Body/MassProperties.h:39</see>
|
|
/// <br/>
|
|
/// <c>void SetMassAndInertiaOfSolidBox(Vec3Arg inBoxSize, float inDensity)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMassAndInertiaOfSolidBox(float3 boxSize, float density) =>
|
|
Jolt.PInvoke.MassProperties_SetMassAndInertiaOfSolidBox(this, boxSize, density);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set the mass and scale the inertia tensor to match the mass
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L42">Jolt/Physics/Body/MassProperties.h:42</see>
|
|
/// <br/>
|
|
/// <c>void ScaleToMass(float inMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void ScaleToMass(float mass) => Jolt.PInvoke.MassProperties_ScaleToMass(this, mass);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L45">Jolt/Physics/Body/MassProperties.h:45</see>
|
|
/// <br/>
|
|
/// <c>static Vec3 sGetEquivalentSolidBoxSize(float inMass, Vec3Arg inInertiaDiagonal)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static float3 GetEquivalentSolidBoxSize(float mass, float3 inertiaDiagonal) =>
|
|
Jolt.PInvoke.MassProperties_GetEquivalentSolidBoxSize(mass, inertiaDiagonal);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Rotate the inertia by 3x3 matrix inRotation
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L48">Jolt/Physics/Body/MassProperties.h:48</see>
|
|
/// <br/>
|
|
/// <c>void Rotate(Mat44Arg inRotation)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Rotate(in float4x4 rotation) => Jolt.PInvoke.MassProperties_Rotate(this, in rotation);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Translate the inertia by a vector inTranslation
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L51">Jolt/Physics/Body/MassProperties.h:51</see>
|
|
/// <br/>
|
|
/// <c>void Translate(Vec3Arg inTranslation)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Translate(float3 translation) => Jolt.PInvoke.MassProperties_Translate(this, translation);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Scale the mass and inertia by inScale, note that elements can be < 0 to flip the shape
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L54">Jolt/Physics/Body/MassProperties.h:54</see>
|
|
/// <br/>
|
|
/// <c>void Scale(Vec3Arg inScale)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Scale(float3 scale) => Jolt.PInvoke.MassProperties_Scale(this, scale);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Saves the state of this object in binary form to inStream.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L57">Jolt/Physics/Body/MassProperties.h:57</see>
|
|
/// <br/>
|
|
/// <c>void SaveBinaryState(StreamOut &inStream) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.MassProperties_SaveBinaryState(this, stream);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Restore the state of this object from inStream.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L60">Jolt/Physics/Body/MassProperties.h:60</see>
|
|
/// <br/>
|
|
/// <c>void RestoreBinaryState(StreamIn &inStream)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.MassProperties_RestoreBinaryState(this, stream);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mass of the shape (kg)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L63">Jolt/Physics/Body/MassProperties.h:63</see>
|
|
/// <br/>
|
|
/// <c>float mMass = 0.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetMass() => Jolt.PInvoke.MassProperties_GetMass(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mass of the shape (kg)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L63">Jolt/Physics/Body/MassProperties.h:63</see>
|
|
/// <br/>
|
|
/// <c>float mMass = 0.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMass(float value) => Jolt.PInvoke.MassProperties_SetMass(this, value);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Inertia tensor of the shape (kg m^2)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L66">Jolt/Physics/Body/MassProperties.h:66</see>
|
|
/// <br/>
|
|
/// <c>Mat44 mInertia = Mat44::sZero()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float4x4 GetInertia() => Jolt.PInvoke.MassProperties_GetInertia(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Inertia tensor of the shape (kg m^2)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Body/MassProperties.h#L66">Jolt/Physics/Body/MassProperties.h:66</see>
|
|
/// <br/>
|
|
/// <c>Mat44 mInertia = Mat44::sZero()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetInertia(in float4x4 value) => Jolt.PInvoke.MassProperties_SetInertia(this, in value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.MassProperties_Destroy(this);
|
|
}
|
|
}
|