brutal/brutal.jolt/Brutal.Jolt/Generated/Classes/Constraint.gen.cs
2026-10-15 14:12:02 +13:00

374 lines
20 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/Constraint.h#L107">Jolt/Physics/Constraints/Constraint.h:107</see>
/// <br/>
/// <c>class Constraint : public RefTarget&lt;Constraint&gt;, public NonCopyable</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Base class for all physics constraints. A constraint removes one or more degrees of freedom for a rigid
/// body.
/// </para>
/// </remarks>
[InteropHandle]
public readonly partial struct Constraint : IDisposable
{
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L131">Jolt/Physics/Constraints/Constraint.h:131</see>
/// <br/>
/// <c>virtual EConstraintType GetType() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Get the type of a constraint
/// </para>
/// </remarks>
public EConstraintType GetConstraintType() => Jolt.PInvoke.Constraint_GetConstraintType(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L134">Jolt/Physics/Constraints/Constraint.h:134</see>
/// <br/>
/// <c>virtual EConstraintSubType GetSubType() const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Get the sub type of a constraint
/// </para>
/// </remarks>
public EConstraintSubType GetSubType() => Jolt.PInvoke.Constraint_GetSubType(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L138">Jolt/Physics/Constraints/Constraint.h:138</see>
/// <br/>
/// <c>uint32 GetConstraintPriority() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Priority of the constraint when solving. Higher numbers have 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.
/// </code>
/// </remarks>
public uint GetConstraintPriority() => Jolt.PInvoke.Constraint_GetConstraintPriority(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L139">Jolt/Physics/Constraints/Constraint.h:139</see>
/// <br/>
/// <c>void SetConstraintPriority(uint32 inPriority)</c>
/// </para>
/// </summary>
public void SetConstraintPriority(uint priority) => Jolt.PInvoke.Constraint_SetConstraintPriority(this, priority);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L142">Jolt/Physics/Constraints/Constraint.h:142</see>
/// <br/>
/// <c>void SetNumVelocityStepsOverride(uint inN)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// 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.
/// </para>
/// </remarks>
public void SetNumVelocityStepsOverride(uint n) => Jolt.PInvoke.Constraint_SetNumVelocityStepsOverride(this, n);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L143">Jolt/Physics/Constraints/Constraint.h:143</see>
/// <br/>
/// <c>uint GetNumVelocityStepsOverride() const</c>
/// </para>
/// </summary>
public uint GetNumVelocityStepsOverride() => Jolt.PInvoke.Constraint_GetNumVelocityStepsOverride(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L146">Jolt/Physics/Constraints/Constraint.h:146</see>
/// <br/>
/// <c>void SetNumPositionStepsOverride(uint inN)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// 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.
/// </para>
/// </remarks>
public void SetNumPositionStepsOverride(uint n) => Jolt.PInvoke.Constraint_SetNumPositionStepsOverride(this, n);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L147">Jolt/Physics/Constraints/Constraint.h:147</see>
/// <br/>
/// <c>uint GetNumPositionStepsOverride() const</c>
/// </para>
/// </summary>
public uint GetNumPositionStepsOverride() => Jolt.PInvoke.Constraint_GetNumPositionStepsOverride(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L153">Jolt/Physics/Constraints/Constraint.h:153</see>
/// <br/>
/// <c>void SetEnabled(bool inEnabled)</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Enable / disable this constraint. This can e.g. be used to implement a breakable constraint by detecting that the constraint impulse
/// (see e.g. PointConstraint::GetTotalLambdaPosition) went over a certain limit and then disabling the constraint.
/// Note that although a disabled constraint will not affect the simulation in any way anymore, it does incur some processing overhead.
/// Alternatively you can remove a constraint from the constraint manager (which may be more costly if you want to disable the constraint for a short while).
/// </code>
/// </remarks>
public void SetEnabled(bool enabled) => Jolt.PInvoke.Constraint_SetEnabled(this, enabled);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L156">Jolt/Physics/Constraints/Constraint.h:156</see>
/// <br/>
/// <c>bool GetEnabled() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Test if a constraint is enabled.
/// </para>
/// </remarks>
public bool GetEnabled() => Jolt.PInvoke.Constraint_GetEnabled(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L159">Jolt/Physics/Constraints/Constraint.h:159</see>
/// <br/>
/// <c>uint64 GetUserData() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Access to the user data, can be used for anything by the application
/// </para>
/// </remarks>
public ulong GetUserData() => Jolt.PInvoke.Constraint_GetUserData(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L160">Jolt/Physics/Constraints/Constraint.h:160</see>
/// <br/>
/// <c>void SetUserData(uint64 inUserData)</c>
/// </para>
/// </summary>
public void SetUserData(ulong userData) => Jolt.PInvoke.Constraint_SetUserData(this, userData);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L166">Jolt/Physics/Constraints/Constraint.h:166</see>
/// <br/>
/// <c>virtual void NotifyShapeChanged(const BodyID &amp;inBodyID, Vec3Arg inDeltaCOM) = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Notify the constraint that the shape of a body has changed and that its center of mass has moved by inDeltaCOM.
/// Bodies don't know which constraints are connected to them so the user is responsible for notifying the relevant constraints when a body changes.
/// @param inBodyID ID of the body that has changed
/// @param inDeltaCOM The delta of the center of mass of the body (shape-&amp;gt;GetCenterOfMass() - shape_before_change-&amp;gt;GetCenterOfMass())
/// </code>
/// </remarks>
public void NotifyShapeChanged(uint bodyID, float3 deltaCOM) => Jolt.PInvoke.Constraint_NotifyShapeChanged(this, bodyID, deltaCOM);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L172">Jolt/Physics/Constraints/Constraint.h:172</see>
/// <br/>
/// <c>virtual void ResetWarmStart() = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Notify the system that the configuration of the bodies and/or constraint has changed enough so that the warm start impulses should not be applied the next frame.
/// You can use this function for example when repositioning a ragdoll through Ragdoll::SetPose in such a way that the orientation of the bodies completely changes so that
/// the previous frame impulses are no longer a good approximation of what the impulses will be in the next frame. Calling this function when there are no big changes
/// will result in the constraints being much 'softer' than usual so they are more easily violated (e.g. a long chain of bodies might sag a bit if you call this every frame).
/// </code>
/// </remarks>
public void ResetWarmStart() => Jolt.PInvoke.Constraint_ResetWarmStart(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L176">Jolt/Physics/Constraints/Constraint.h:176</see>
/// <br/>
/// <c>virtual bool IsActive() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// @name Solver interface
/// @{
/// </code>
/// </remarks>
public bool IsActive() => Jolt.PInvoke.Constraint_IsActive(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L177">Jolt/Physics/Constraints/Constraint.h:177</see>
/// <br/>
/// <c>virtual void SetupVelocityConstraint(float inDeltaTime) = 0</c>
/// </para>
/// </summary>
public void SetupVelocityConstraint(float deltaTime) => Jolt.PInvoke.Constraint_SetupVelocityConstraint(this, deltaTime);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L178">Jolt/Physics/Constraints/Constraint.h:178</see>
/// <br/>
/// <c>virtual void WarmStartVelocityConstraint(float inWarmStartImpulseRatio) = 0</c>
/// </para>
/// </summary>
public void WarmStartVelocityConstraint(float warmStartImpulseRatio) => Jolt.PInvoke.Constraint_WarmStartVelocityConstraint(this, warmStartImpulseRatio);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L179">Jolt/Physics/Constraints/Constraint.h:179</see>
/// <br/>
/// <c>virtual bool SolveVelocityConstraint(float inDeltaTime) = 0</c>
/// </para>
/// </summary>
public bool SolveVelocityConstraint(float deltaTime) => Jolt.PInvoke.Constraint_SolveVelocityConstraint(this, deltaTime);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L180">Jolt/Physics/Constraints/Constraint.h:180</see>
/// <br/>
/// <c>virtual bool SolvePositionConstraint(float inDeltaTime, float inBaumgarte) = 0</c>
/// </para>
/// </summary>
public bool SolvePositionConstraint(float deltaTime, float baumgarte) => Jolt.PInvoke.Constraint_SolvePositionConstraint(this, deltaTime, baumgarte);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L184">Jolt/Physics/Constraints/Constraint.h:184</see>
/// <br/>
/// <c>virtual void BuildIslands(uint32 inConstraintIndex, IslandBuilder &amp;ioBuilder, BodyManager &amp;inBodyManager) = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Link bodies that are connected by this constraint in the island builder
/// </para>
/// </remarks>
public void BuildIslands(uint constraintIndex, IslandBuilder builder, BodyManager bodyManager) => Jolt.PInvoke.Constraint_BuildIslands(this, constraintIndex, builder, bodyManager);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L187">Jolt/Physics/Constraints/Constraint.h:187</see>
/// <br/>
/// <c>virtual uint BuildIslandSplits(LargeIslandSplitter &amp;ioSplitter) const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Link bodies that are connected by this constraint in the same split. Returns the split index.
/// </para>
/// </remarks>
public uint BuildIslandSplits(LargeIslandSplitter splitter) => Jolt.PInvoke.Constraint_BuildIslandSplits(this, splitter);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L191">Jolt/Physics/Constraints/Constraint.h:191</see>
/// <br/>
/// <c>virtual void DrawConstraint(DebugRenderer *inRenderer) const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Drawing interface
/// </para>
/// </remarks>
public void DrawConstraint(DebugRenderer renderer) => Jolt.PInvoke.Constraint_DrawConstraint(this, renderer);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L192">Jolt/Physics/Constraints/Constraint.h:192</see>
/// <br/>
/// <c>virtual void DrawConstraintLimits(DebugRenderer *inRenderer) const</c>
/// </para>
/// </summary>
public void DrawConstraintLimits(DebugRenderer renderer) => Jolt.PInvoke.Constraint_DrawConstraintLimits(this, renderer);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L193">Jolt/Physics/Constraints/Constraint.h:193</see>
/// <br/>
/// <c>virtual void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const</c>
/// </para>
/// </summary>
public void DrawConstraintReferenceFrame(DebugRenderer renderer) => Jolt.PInvoke.Constraint_DrawConstraintReferenceFrame(this, renderer);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L196">Jolt/Physics/Constraints/Constraint.h:196</see>
/// <br/>
/// <c>float GetDrawConstraintSize() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Size of constraint when drawing it through the debug renderer
/// </para>
/// </remarks>
public float GetDrawConstraintSize() => Jolt.PInvoke.Constraint_GetDrawConstraintSize(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L197">Jolt/Physics/Constraints/Constraint.h:197</see>
/// <br/>
/// <c>void SetDrawConstraintSize(float inSize)</c>
/// </para>
/// </summary>
public void SetDrawConstraintSize(float size) => Jolt.PInvoke.Constraint_SetDrawConstraintSize(this, size);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/Constraint.h#L207">Jolt/Physics/Constraints/Constraint.h:207</see>
/// <br/>
/// <c>virtual Ref&lt;ConstraintSettings&gt; GetConstraintSettings() const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// Debug function to convert a constraint to its settings, note that this will not save to which bodies the
/// constraint is connected to
/// </para>
/// </remarks>
public ConstraintSettings GetConstraintSettings() => Jolt.PInvoke.Constraint_GetConstraintSettings(this);
public void AddRef() => Jolt.PInvoke.Constraint_AddRef(this);
public void Release() => Jolt.PInvoke.Constraint_Release(this);
public uint GetRefCount() => Jolt.PInvoke.Constraint_GetRefCount(this);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}