//
// 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
{
///
///
/// Class that contains the settings for a constraint motor. See the main page of the API documentation for more
/// information on how to configure a motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:39
///
/// class MotorSettings
///
///
[InteropHandle]
public readonly partial struct MotorSettings : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:45
///
/// MotorSettings() = default
///
///
public static MotorSettings Create() => Jolt.PInvoke.MotorSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:48
///
/// MotorSettings(ESpringMode inMode, float inFrequency, float inDamping)
///
///
public static MotorSettings Create(SpringMode mode, float frequency, float damping) =>
Jolt.PInvoke.MotorSettings_Create_2(mode, frequency, damping);
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:49
///
/// MotorSettings(float inFrequency, float inDamping)
///
///
public static MotorSettings Create(float frequency, float damping) =>
Jolt.PInvoke.MotorSettings_Create_3(frequency, damping);
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:50
///
/// MotorSettings(ESpringMode inMode, float inFrequency, float inDamping, float inForceLimit, float inTorqueLimit)
///
///
public static MotorSettings Create(
SpringMode mode,
float frequency,
float damping,
float forceLimit,
float torqueLimit
) => Jolt.PInvoke.MotorSettings_Create_4(mode, frequency, damping, forceLimit, torqueLimit);
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:51
///
/// MotorSettings(float inFrequency, float inDamping, float inForceLimit, float inTorqueLimit)
///
///
public static MotorSettings Create(float frequency, float damping, float forceLimit, float torqueLimit) =>
Jolt.PInvoke.MotorSettings_Create_5(frequency, damping, forceLimit, torqueLimit);
///
///
/// Set asymmetric force limits
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:54
///
/// void SetForceLimits(float inMin, float inMax)
///
///
public void SetForceLimits(float min, float max) => Jolt.PInvoke.MotorSettings_SetForceLimits(this, min, max);
///
///
/// Set asymmetric torque limits
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:57
///
/// void SetTorqueLimits(float inMin, float inMax)
///
///
public void SetTorqueLimits(float min, float max) => Jolt.PInvoke.MotorSettings_SetTorqueLimits(this, min, max);
///
///
/// Set symmetric force limits
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:60
///
/// void SetForceLimit(float inLimit)
///
///
public void SetForceLimit(float limit) => Jolt.PInvoke.MotorSettings_SetForceLimit(this, limit);
///
///
/// Set symmetric torque limits
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:63
///
/// void SetTorqueLimit(float inLimit)
///
///
public void SetTorqueLimit(float limit) => Jolt.PInvoke.MotorSettings_SetTorqueLimit(this, limit);
///
///
/// Check if settings are valid
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:66
///
/// bool IsValid() const
///
///
public bool IsValid() => Jolt.PInvoke.MotorSettings_IsValid(this);
///
///
/// Saves the contents of the motor settings in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:69
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.MotorSettings_SaveBinaryState(this, stream);
///
///
/// Restores contents from the binary stream inStream.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:72
///
/// void RestoreBinaryState(StreamIn &inStream)
///
///
public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.MotorSettings_RestoreBinaryState(this, stream);
///
///
/// Settings for the spring that is used to drive to the position target (not used when motor is a velocity
/// motor).
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:75
///
/// SpringSettings mSpringSettings { ESpringMode::FrequencyAndDamping, 2.0f, 1.0f }
///
///
///
///
/// Settings
///
///
/// The returned handle is an owned copy; Dispose it when you're done with it.
///
///
public SpringSettings GetSpringSettings() => Jolt.PInvoke.MotorSettings_GetSpringSettings(this);
///
///
/// Settings for the spring that is used to drive to the position target (not used when motor is a velocity
/// motor).
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:75
///
/// SpringSettings mSpringSettings { ESpringMode::FrequencyAndDamping, 2.0f, 1.0f }
///
///
///
///
/// Settings
///
///
/// The value is copied into the field; the handle you pass stays yours to Dispose.
///
///
public void SetSpringSettings(SpringSettings value) =>
Jolt.PInvoke.MotorSettings_SetSpringSettings(this, value);
///
///
/// Minimum force to apply in case of a linear constraint (N). Usually this is -mMaxForceLimit unless you
/// want a motor that can e.g. push but not pull. Not used when motor is an angular motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:76
///
/// float mMinForceLimit = -FLT_MAX
///
///
public float GetMinForceLimit() => Jolt.PInvoke.MotorSettings_GetMinForceLimit(this);
///
///
/// Minimum force to apply in case of a linear constraint (N). Usually this is -mMaxForceLimit unless you
/// want a motor that can e.g. push but not pull. Not used when motor is an angular motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:76
///
/// float mMinForceLimit = -FLT_MAX
///
///
public void SetMinForceLimit(float value) => Jolt.PInvoke.MotorSettings_SetMinForceLimit(this, value);
///
///
/// Maximum force to apply in case of a linear constraint (N). Not used when motor is an angular motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:77
///
/// float mMaxForceLimit = FLT_MAX
///
///
public float GetMaxForceLimit() => Jolt.PInvoke.MotorSettings_GetMaxForceLimit(this);
///
///
/// Maximum force to apply in case of a linear constraint (N). Not used when motor is an angular motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:77
///
/// float mMaxForceLimit = FLT_MAX
///
///
public void SetMaxForceLimit(float value) => Jolt.PInvoke.MotorSettings_SetMaxForceLimit(this, value);
///
///
/// Minimum torque to apply in case of a angular constraint (N m). Usually this is -mMaxTorqueLimit unless
/// you want a motor that can e.g. push but not pull. Not used when motor is a linear motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:78
///
/// float mMinTorqueLimit = -FLT_MAX
///
///
public float GetMinTorqueLimit() => Jolt.PInvoke.MotorSettings_GetMinTorqueLimit(this);
///
///
/// Minimum torque to apply in case of a angular constraint (N m). Usually this is -mMaxTorqueLimit unless
/// you want a motor that can e.g. push but not pull. Not used when motor is a linear motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:78
///
/// float mMinTorqueLimit = -FLT_MAX
///
///
public void SetMinTorqueLimit(float value) => Jolt.PInvoke.MotorSettings_SetMinTorqueLimit(this, value);
///
///
/// Maximum torque to apply in case of a angular constraint (N m). Not used when motor is a linear motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:79
///
/// float mMaxTorqueLimit = FLT_MAX
///
///
public float GetMaxTorqueLimit() => Jolt.PInvoke.MotorSettings_GetMaxTorqueLimit(this);
///
///
/// Maximum torque to apply in case of a angular constraint (N m). Not used when motor is a linear motor.
///
///
/// C++:
/// Jolt/Physics/Constraints/MotorSettings.h:79
///
/// float mMaxTorqueLimit = FLT_MAX
///
///
public void SetMaxTorqueLimit(float value) => Jolt.PInvoke.MotorSettings_SetMaxTorqueLimit(this, value);
public void Dispose() => Jolt.PInvoke.MotorSettings_Destroy(this);
}
}