mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
242 lines
11 KiB
C#
242 lines
11 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>
|
|
/// Class used in other constraint parts to calculate the required bias factor in the lagrange multiplier for
|
|
/// creating springs
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L15">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:15</see>
|
|
/// <br/>
|
|
/// <c>class SpringPart</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct SpringPart : IDisposable
|
|
{
|
|
public static SpringPart Create() => Jolt.PInvoke.SpringPart_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Turn off the spring and set a bias only
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L21">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:21</see>
|
|
/// <br/>
|
|
/// <c>void CalculateSpringPropertiesWithBias(float inBias)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Turn off the spring and set a bias only
|
|
///
|
|
/// @param inBias Bias term (b) for the constraint impulse: lambda = J v + b
|
|
/// </code>
|
|
/// </remarks>
|
|
public void CalculateSpringPropertiesWithBias(float bias) =>
|
|
Jolt.PInvoke.SpringPart_CalculateSpringPropertiesWithBias(this, bias);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate spring properties with spring Stiffness (k) and damping (c), this is based on the spring
|
|
/// equation: F = -k * x - c * v
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L36">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:36</see>
|
|
/// <br/>
|
|
/// <c>void CalculateSpringPropertiesWithStiffnessAndDamping(float inDeltaTime, float inInvEffectiveMass, float inBias, float inC, float inStiffness, float inDamping, float &outEffectiveMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Calculate spring properties with spring Stiffness (k) and damping (c), this is based on the spring equation: F = -k * x - c * v
|
|
///
|
|
/// @param inDeltaTime Time step
|
|
/// @param inInvEffectiveMass Inverse effective mass K
|
|
/// @param inBias Bias term (b) for the constraint impulse: lambda = J v + b
|
|
/// @param inC Value of the constraint equation (C).
|
|
/// @param inStiffness Spring stiffness k.
|
|
/// @param inDamping Spring damping coefficient c.
|
|
/// @param outEffectiveMass On return, this contains the new effective mass K^-1
|
|
/// </code>
|
|
/// </remarks>
|
|
public void CalculateSpringPropertiesWithStiffnessAndDamping(
|
|
float deltaTime,
|
|
float invEffectiveMass,
|
|
float bias,
|
|
float c,
|
|
float stiffness,
|
|
float damping,
|
|
out float effectiveMass
|
|
) =>
|
|
Jolt.PInvoke.SpringPart_CalculateSpringPropertiesWithStiffnessAndDamping(
|
|
this,
|
|
deltaTime,
|
|
invEffectiveMass,
|
|
bias,
|
|
c,
|
|
stiffness,
|
|
damping,
|
|
out effectiveMass
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate spring properties based on frequency and damping ratio
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L98">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:98</see>
|
|
/// <br/>
|
|
/// <c>void CalculateSpringPropertiesWithFrequencyAndDamping(float inDeltaTime, float inInvEffectiveMass, float inBias, float inC, float inFrequency, float inDamping, float &outEffectiveMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Calculate spring properties based on frequency and damping ratio
|
|
///
|
|
/// @param inDeltaTime Time step
|
|
/// @param inInvEffectiveMass Inverse effective mass K
|
|
/// @param inBias Bias term (b) for the constraint impulse: lambda = J v + b
|
|
/// @param inC Value of the constraint equation (C).
|
|
/// @param inFrequency Oscillation frequency (Hz).
|
|
/// @param inDamping Damping factor (0 = no damping, 1 = critical damping).
|
|
/// @param outEffectiveMass On return, this contains the new effective mass K^-1
|
|
/// </code>
|
|
/// </remarks>
|
|
public void CalculateSpringPropertiesWithFrequencyAndDamping(
|
|
float deltaTime,
|
|
float invEffectiveMass,
|
|
float bias,
|
|
float c,
|
|
float frequency,
|
|
float damping,
|
|
out float effectiveMass
|
|
) =>
|
|
Jolt.PInvoke.SpringPart_CalculateSpringPropertiesWithFrequencyAndDamping(
|
|
this,
|
|
deltaTime,
|
|
invEffectiveMass,
|
|
bias,
|
|
c,
|
|
frequency,
|
|
damping,
|
|
out effectiveMass
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate spring properties with spring stiffness (k) and damping (c) in acceleration mode, this is
|
|
/// based on the spring equation: F = m_eff * (-k * x - c * v) where m_eff is the effective mass of the
|
|
/// constraint
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L123">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:123</see>
|
|
/// <br/>
|
|
/// <c>void CalculateSpringPropertiesWithMassNormalizedStiffnessAndDamping(float inDeltaTime, float inInvEffectiveMass, float inBias, float inC, float inStiffness, float inDamping, float &outEffectiveMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Calculate spring properties with spring stiffness (k) and damping (c) in acceleration mode, this is based on the spring equation: F = m_eff * (-k * x - c * v) where m_eff is the effective mass of the constraint
|
|
///
|
|
/// @param inDeltaTime Time step
|
|
/// @param inInvEffectiveMass Inverse effective mass K
|
|
/// @param inBias Bias term (b) for the constraint impulse: lambda = J v + b
|
|
/// @param inC Value of the constraint equation (C).
|
|
/// @param inStiffness Spring stiffness k.
|
|
/// @param inDamping Spring damping coefficient c.
|
|
/// @param outEffectiveMass On return, this contains the new effective mass K^-1
|
|
/// </code>
|
|
/// </remarks>
|
|
public void CalculateSpringPropertiesWithMassNormalizedStiffnessAndDamping(
|
|
float deltaTime,
|
|
float invEffectiveMass,
|
|
float bias,
|
|
float c,
|
|
float stiffness,
|
|
float damping,
|
|
out float effectiveMass
|
|
) =>
|
|
Jolt.PInvoke.SpringPart_CalculateSpringPropertiesWithMassNormalizedStiffnessAndDamping(
|
|
this,
|
|
deltaTime,
|
|
invEffectiveMass,
|
|
bias,
|
|
c,
|
|
stiffness,
|
|
damping,
|
|
out effectiveMass
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate spring properties based on SpringSettings object. Assumes the spring has either stiffness or
|
|
/// damping.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L130">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:130</see>
|
|
/// <br/>
|
|
/// <c>void CalculateSpringPropertiesWithSettings(float inDeltaTime, float inInvEffectiveMass, float inBias, float inC, const SpringSettings &inSpringSettings, float &outEffectiveMass)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void CalculateSpringPropertiesWithSettings(
|
|
float deltaTime,
|
|
float invEffectiveMass,
|
|
float bias,
|
|
float c,
|
|
SpringSettings springSettings,
|
|
out float effectiveMass
|
|
) =>
|
|
Jolt.PInvoke.SpringPart_CalculateSpringPropertiesWithSettings(
|
|
this,
|
|
deltaTime,
|
|
invEffectiveMass,
|
|
bias,
|
|
c,
|
|
springSettings,
|
|
out effectiveMass
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Returns if this spring is active
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L147">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:147</see>
|
|
/// <br/>
|
|
/// <c>bool IsActive() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool IsActive() => Jolt.PInvoke.SpringPart_IsActive(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get total bias b, including supplied bias and bias for spring: lambda = J v + b
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h#L153">Jolt/Physics/Constraints/ConstraintPart/SpringPart.h:153</see>
|
|
/// <br/>
|
|
/// <c>float GetBias(float inTotalLambda) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetBias(float totalLambda) => Jolt.PInvoke.SpringPart_GetBias(this, totalLambda);
|
|
|
|
public void Dispose() => Jolt.PInvoke.SpringPart_Destroy(this);
|
|
}
|
|
}
|