//
// 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 used to store the configuration of a constraint. Allows run-time creation of constraints.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:64
///
/// class ConstraintSettings : public SerializableObject, public RefTarget<ConstraintSettings>
///
///
[InteropHandle]
public readonly partial struct ConstraintSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:66
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.ConstraintSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:66
///
///
///
///
public unsafe Ptr CastTo(RTTI rtti) => Jolt.PInvoke.ConstraintSettings_CastTo(this, rtti);
///
///
/// Saves the contents of the constraint settings in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:72
///
/// virtual void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.ConstraintSettings_SaveBinaryState(this, stream);
///
///
/// Creates a constraint of the correct type and restores its contents from the binary stream inStream.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:75
///
/// static ConstraintResult sRestoreFromBinaryState(StreamIn &inStream)
///
///
///
///
/// Throws JoltException with Jolt's error message when the operation fails.
///
///
public static ConstraintSettings RestoreFromBinaryState(StreamIn stream)
{
var _handle = Jolt.PInvoke.ConstraintSettings_RestoreFromBinaryState(stream);
if (_handle.IsNull())
throw JoltException.FromLastError();
return _handle;
}
///
///
/// Views this ConstraintSettings as the SwingTwistConstraintSettings it is, or returns a null handle when
/// it is a different kind - check IsNull(). The same object, not a new reference: never Dispose the result.
///
///
public SwingTwistConstraintSettings AsSwingTwistConstraintSettings() =>
Jolt.PInvoke.ConstraintSettings_AsSwingTwistConstraintSettings(this);
///
///
/// If this constraint is enabled initially. Use Constraint::SetEnabled to toggle after creation.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:78
///
/// bool mEnabled = true
///
///
public bool GetEnabled() => Jolt.PInvoke.ConstraintSettings_GetEnabled(this);
///
///
/// If this constraint is enabled initially. Use Constraint::SetEnabled to toggle after creation.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:78
///
/// bool mEnabled = true
///
///
public void SetEnabled(bool value) => Jolt.PInvoke.ConstraintSettings_SetEnabled(this, value);
///
///
/// Priority of the constraint when solving. Higher numbers are more likely to be solved correctly. Note
/// that if you want a deterministic simulation and you cannot guarantee the order in which constraints are
/// added/removed, you can make the priority for all constraints unique to get a deterministic ordering.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:82
///
/// uint32 mConstraintPriority = 0
///
///
public uint GetConstraintPriority() => Jolt.PInvoke.ConstraintSettings_GetConstraintPriority(this);
///
///
/// Priority of the constraint when solving. Higher numbers are more likely to be solved correctly. Note
/// that if you want a deterministic simulation and you cannot guarantee the order in which constraints are
/// added/removed, you can make the priority for all constraints unique to get a deterministic ordering.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:82
///
/// uint32 mConstraintPriority = 0
///
///
public void SetConstraintPriority(uint value) =>
Jolt.PInvoke.ConstraintSettings_SetConstraintPriority(this, value);
///
///
/// Used only when the constraint is active. Override for the number of solver velocity iterations to run, 0
/// means use the default in PhysicsSettings::mNumVelocitySteps. The number of iterations to use is the max
/// of all contacts and constraints in the island.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:85
///
/// uint mNumVelocityStepsOverride = 0
///
///
public uint GetNumVelocityStepsOverride() => Jolt.PInvoke.ConstraintSettings_GetNumVelocityStepsOverride(this);
///
///
/// Used only when the constraint is active. Override for the number of solver velocity iterations to run, 0
/// means use the default in PhysicsSettings::mNumVelocitySteps. The number of iterations to use is the max
/// of all contacts and constraints in the island.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:85
///
/// uint mNumVelocityStepsOverride = 0
///
///
public void SetNumVelocityStepsOverride(uint value) =>
Jolt.PInvoke.ConstraintSettings_SetNumVelocityStepsOverride(this, value);
///
///
/// Used only when the constraint is active. Override for the number of solver position iterations to run, 0
/// means use the default in PhysicsSettings::mNumPositionSteps. The number of iterations to use is the max
/// of all contacts and constraints in the island.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:88
///
/// uint mNumPositionStepsOverride = 0
///
///
public uint GetNumPositionStepsOverride() => Jolt.PInvoke.ConstraintSettings_GetNumPositionStepsOverride(this);
///
///
/// Used only when the constraint is active. Override for the number of solver position iterations to run, 0
/// means use the default in PhysicsSettings::mNumPositionSteps. The number of iterations to use is the max
/// of all contacts and constraints in the island.
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:88
///
/// uint mNumPositionStepsOverride = 0
///
///
public void SetNumPositionStepsOverride(uint value) =>
Jolt.PInvoke.ConstraintSettings_SetNumPositionStepsOverride(this, value);
///
///
/// Size of constraint when drawing it through the debug renderer
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:91
///
/// float mDrawConstraintSize = 1.0f
///
///
public float GetDrawConstraintSize() => Jolt.PInvoke.ConstraintSettings_GetDrawConstraintSize(this);
///
///
/// Size of constraint when drawing it through the debug renderer
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:91
///
/// float mDrawConstraintSize = 1.0f
///
///
public void SetDrawConstraintSize(float value) =>
Jolt.PInvoke.ConstraintSettings_SetDrawConstraintSize(this, value);
///
///
/// User data value (can be used by application)
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:94
///
/// uint64 mUserData = 0
///
///
public ulong GetUserData() => Jolt.PInvoke.ConstraintSettings_GetUserData(this);
///
///
/// User data value (can be used by application)
///
///
/// C++:
/// Jolt/Physics/Constraints/Constraint.h:94
///
/// uint64 mUserData = 0
///
///
public void SetUserData(ulong value) => Jolt.PInvoke.ConstraintSettings_SetUserData(this, value);
public void AddRef() => Jolt.PInvoke.ConstraintSettings_AddRef(this);
public void Release() => Jolt.PInvoke.ConstraintSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.ConstraintSettings_GetRefCount(this);
public void Dispose()
{
if (IsNull())
return;
Release();
}
}
}