mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
156 lines
8.3 KiB
C#
156 lines
8.3 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/Constraints/SpringSettings.h#L22">Jolt/Physics/Constraints/SpringSettings.h:22</see>
|
|
/// <br/>
|
|
/// <c>class SpringSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Settings for a linear or angular spring
|
|
/// </para>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct SpringSettings : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L28">Jolt/Physics/Constraints/SpringSettings.h:28</see>
|
|
/// <br/>
|
|
/// <c>SpringSettings() = default</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// </remarks>
|
|
public static SpringSettings Create() => Jolt.PInvoke.SpringSettings_Create();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L31">Jolt/Physics/Constraints/SpringSettings.h:31</see>
|
|
/// <br/>
|
|
/// <c>SpringSettings(ESpringMode inMode, float inFrequencyOrStiffness, float inDamping)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SpringSettings Create(ESpringMode mode, float frequencyOrStiffness, float damping) => Jolt.PInvoke.SpringSettings_Create_2(mode, frequencyOrStiffness, damping);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L34">Jolt/Physics/Constraints/SpringSettings.h:34</see>
|
|
/// <br/>
|
|
/// <c>void SaveBinaryState(StreamOut &inStream) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Saves the contents of the spring settings in binary form to inStream.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.SpringSettings_SaveBinaryState(this, stream);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L37">Jolt/Physics/Constraints/SpringSettings.h:37</see>
|
|
/// <br/>
|
|
/// <c>void RestoreBinaryState(StreamIn &inStream)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Restores contents from the binary stream inStream.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.SpringSettings_RestoreBinaryState(this, stream);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L40">Jolt/Physics/Constraints/SpringSettings.h:40</see>
|
|
/// <br/>
|
|
/// <c>inline bool HasStiffness() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Check if the spring has a valid frequency / stiffness, if not the spring will be hard
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool HasStiffness() => Jolt.PInvoke.SpringSettings_HasStiffness(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L44">Jolt/Physics/Constraints/SpringSettings.h:44</see>
|
|
/// <br/>
|
|
/// <c>ESpringMode mMode = ESpringMode::FrequencyAndDamping</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Selects the way in which the spring is defined
|
|
/// If the mode is StiffnessAndDamping then mFrequency becomes the stiffness (k) and mDamping becomes the damping ratio (c) in the spring equation F = -k * x - c * v. Otherwise the properties are as documented.
|
|
/// </code>
|
|
/// </remarks>
|
|
public ESpringMode GetMode() => Jolt.PInvoke.SpringSettings_GetMode(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L44">Jolt/Physics/Constraints/SpringSettings.h:44</see>
|
|
/// <br/>
|
|
/// <c>ESpringMode mMode = ESpringMode::FrequencyAndDamping</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Selects the way in which the spring is defined
|
|
/// If the mode is StiffnessAndDamping then mFrequency becomes the stiffness (k) and mDamping becomes the damping ratio (c) in the spring equation F = -k * x - c * v. Otherwise the properties are as documented.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetMode(ESpringMode value) => Jolt.PInvoke.SpringSettings_SetMode(this, value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L67">Jolt/Physics/Constraints/SpringSettings.h:67</see>
|
|
/// <br/>
|
|
/// <c>float mDamping = 0.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// When mSpringMode = ESpringMode::FrequencyAndDamping mDamping is the damping ratio (0 = no damping, 1 = critical damping).
|
|
/// When mSpringMode = ESpringMode::StiffnessAndDamping mDamping is the damping (c) in the spring equation F = -k * x - c * v for a linear or T = -k * theta - c * w for an angular spring.
|
|
/// Note that if you set mDamping = 0, you will not get an infinite oscillation. Because we integrate physics using an explicit Euler scheme, there is always energy loss.
|
|
/// This is done to keep the simulation from exploding, because with a damping of 0 and even the slightest rounding error, the oscillation could become bigger and bigger until the simulation explodes.
|
|
/// </code>
|
|
/// </remarks>
|
|
public float GetDamping() => Jolt.PInvoke.SpringSettings_GetDamping(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/SpringSettings.h#L67">Jolt/Physics/Constraints/SpringSettings.h:67</see>
|
|
/// <br/>
|
|
/// <c>float mDamping = 0.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// When mSpringMode = ESpringMode::FrequencyAndDamping mDamping is the damping ratio (0 = no damping, 1 = critical damping).
|
|
/// When mSpringMode = ESpringMode::StiffnessAndDamping mDamping is the damping (c) in the spring equation F = -k * x - c * v for a linear or T = -k * theta - c * w for an angular spring.
|
|
/// Note that if you set mDamping = 0, you will not get an infinite oscillation. Because we integrate physics using an explicit Euler scheme, there is always energy loss.
|
|
/// This is done to keep the simulation from exploding, because with a damping of 0 and even the slightest rounding error, the oscillation could become bigger and bigger until the simulation explodes.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetDamping(float value) => Jolt.PInvoke.SpringSettings_SetDamping(this, value);
|
|
public void Dispose() => Jolt.PInvoke.SpringSettings_Destroy(this);
|
|
}
|
|
}
|