mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
333 lines
15 KiB
C#
333 lines
15 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>
|
|
/// A constraint manager manages all constraints of the same type
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L27">Jolt/Physics/Constraints/ConstraintManager.h:27</see>
|
|
/// <br/>
|
|
/// <c>class ConstraintManager : public NonCopyable</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// A constraint manager manages all constraints of the same type
|
|
///
|
|
/// WARNING: This class is an internal part of PhysicsSystem, it has no functions that can be called by users of the library.
|
|
/// Its functionality is exposed through PhysicsSystem and BodyInterface.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct ConstraintManager
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Add a new constraint. This is thread safe.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L38">Jolt/Physics/Constraints/ConstraintManager.h:38</see>
|
|
/// <br/>
|
|
/// <c>void Add(Constraint **inConstraints, int inNumber)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// constraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe void Add(Ptr<Constraint> constraints, int number) =>
|
|
Jolt.PInvoke.ConstraintManager_Add(this, constraints, number);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Remove a constraint. This is thread safe.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L41">Jolt/Physics/Constraints/ConstraintManager.h:41</see>
|
|
/// <br/>
|
|
/// <c>void Remove(Constraint **inConstraint, int inNumber)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// constraint is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe void Remove(Ptr<Constraint> constraint, int number) =>
|
|
Jolt.PInvoke.ConstraintManager_Remove(this, constraint, number);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get a list of all constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L44">Jolt/Physics/Constraints/ConstraintManager.h:44</see>
|
|
/// <br/>
|
|
/// <c>Constraints GetConstraints() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Returns an owned native buffer - read it through AsSpan() and Dispose it when you are done with it. The
|
|
/// handles in it are borrowed views into the buffer: they stay valid until Dispose and must not be disposed
|
|
/// themselves.
|
|
/// </para>
|
|
/// </remarks>
|
|
public NativeArray<Constraint> GetConstraints() =>
|
|
new NativeArray<Constraint>(Jolt.PInvoke.ConstraintManager_GetConstraints(this));
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get total number of constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L47">Jolt/Physics/Constraints/ConstraintManager.h:47</see>
|
|
/// <br/>
|
|
/// <c>inline uint32 GetNumConstraints() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetNumConstraints() => Jolt.PInvoke.ConstraintManager_GetNumConstraints(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Determine the active constraints of a subset of the constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L50">Jolt/Physics/Constraints/ConstraintManager.h:50</see>
|
|
/// <br/>
|
|
/// <c>void GetActiveConstraints(uint32 inStartConstraintIdx, uint32 inEndConstraintIdx, Constraint **outActiveConstraints, uint32 &outNumActiveConstraints) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size; the handles the call writes
|
|
/// into it are borrowed from their owner - don't Dispose them.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe void GetActiveConstraints(
|
|
uint startConstraintIdx,
|
|
uint endConstraintIdx,
|
|
Ptr<Constraint> activeConstraints,
|
|
out uint numActiveConstraints
|
|
) =>
|
|
Jolt.PInvoke.ConstraintManager_GetActiveConstraints(
|
|
this,
|
|
startConstraintIdx,
|
|
endConstraintIdx,
|
|
activeConstraints,
|
|
out numActiveConstraints
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Link bodies to form islands
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L53">Jolt/Physics/Constraints/ConstraintManager.h:53</see>
|
|
/// <br/>
|
|
/// <c>static void sBuildIslands(Constraint **inActiveConstraints, uint32 inNumActiveConstraints, IslandBuilder &ioBuilder, BodyManager &inBodyManager)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void BuildIslands(
|
|
Ptr<Constraint> activeConstraints,
|
|
uint numActiveConstraints,
|
|
IslandBuilder builder,
|
|
BodyManager bodyManager
|
|
) => Jolt.PInvoke.ConstraintManager_BuildIslands(activeConstraints, numActiveConstraints, builder, bodyManager);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// In order to have a deterministic simulation, we need to sort the constraints of an island before solving
|
|
/// them
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L56">Jolt/Physics/Constraints/ConstraintManager.h:56</see>
|
|
/// <br/>
|
|
/// <c>static void sSortConstraints(Constraint **inActiveConstraints, uint32 *inConstraintIdxBegin, uint32 *inConstraintIdxEnd)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void SortConstraints(
|
|
Ptr<Constraint> activeConstraints,
|
|
Ptr<uint> constraintIdxBegin,
|
|
Ptr<uint> constraintIdxEnd
|
|
) => Jolt.PInvoke.ConstraintManager_SortConstraints(activeConstraints, constraintIdxBegin, constraintIdxEnd);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Prior to solving the velocity constraints, you must call SetupVelocityConstraints once to precalculate
|
|
/// values that are independent of velocity
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L59">Jolt/Physics/Constraints/ConstraintManager.h:59</see>
|
|
/// <br/>
|
|
/// <c>static void sSetupVelocityConstraints(Constraint **inActiveConstraints, uint32 inNumActiveConstraints, float inDeltaTime)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void SetupVelocityConstraints(
|
|
Ptr<Constraint> activeConstraints,
|
|
uint numActiveConstraints,
|
|
float deltaTime
|
|
) =>
|
|
Jolt.PInvoke.ConstraintManager_SetupVelocityConstraints(activeConstraints, numActiveConstraints, deltaTime);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// This function is called multiple times to iteratively come to a solution that meets all velocity
|
|
/// constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L66">Jolt/Physics/Constraints/ConstraintManager.h:66</see>
|
|
/// <br/>
|
|
/// <c>static bool sSolveVelocityConstraints(Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe bool SolveVelocityConstraints(
|
|
Ptr<Constraint> activeConstraints,
|
|
Ptr<uint> constraintIdxBegin,
|
|
Ptr<uint> constraintIdxEnd,
|
|
float deltaTime
|
|
) =>
|
|
Jolt.PInvoke.ConstraintManager_SolveVelocityConstraints(
|
|
activeConstraints,
|
|
constraintIdxBegin,
|
|
constraintIdxEnd,
|
|
deltaTime
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// This function is called multiple times to iteratively come to a solution that meets all position
|
|
/// constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L69">Jolt/Physics/Constraints/ConstraintManager.h:69</see>
|
|
/// <br/>
|
|
/// <c>static bool sSolvePositionConstraints(Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime, float inBaumgarte)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// activeConstraints is a buffer of Constraint handles you allocate and size, read by the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe bool SolvePositionConstraints(
|
|
Ptr<Constraint> activeConstraints,
|
|
Ptr<uint> constraintIdxBegin,
|
|
Ptr<uint> constraintIdxEnd,
|
|
float deltaTime,
|
|
float baumgarte
|
|
) =>
|
|
Jolt.PInvoke.ConstraintManager_SolvePositionConstraints(
|
|
activeConstraints,
|
|
constraintIdxBegin,
|
|
constraintIdxEnd,
|
|
deltaTime,
|
|
baumgarte
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Draw all constraints
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L73">Jolt/Physics/Constraints/ConstraintManager.h:73</see>
|
|
/// <br/>
|
|
/// <c>void DrawConstraints(DebugRenderer *inRenderer) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawConstraints(DebugRenderer renderer) =>
|
|
Jolt.PInvoke.ConstraintManager_DrawConstraints(this, renderer);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Draw all constraint limits
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L76">Jolt/Physics/Constraints/ConstraintManager.h:76</see>
|
|
/// <br/>
|
|
/// <c>void DrawConstraintLimits(DebugRenderer *inRenderer) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawConstraintLimits(DebugRenderer renderer) =>
|
|
Jolt.PInvoke.ConstraintManager_DrawConstraintLimits(this, renderer);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Draw all constraint reference frames
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L79">Jolt/Physics/Constraints/ConstraintManager.h:79</see>
|
|
/// <br/>
|
|
/// <c>void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawConstraintReferenceFrame(DebugRenderer renderer) =>
|
|
Jolt.PInvoke.ConstraintManager_DrawConstraintReferenceFrame(this, renderer);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Lock all constraints. This should only be done during PhysicsSystem::Update().
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L89">Jolt/Physics/Constraints/ConstraintManager.h:89</see>
|
|
/// <br/>
|
|
/// <c>void LockAllConstraints()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void LockAllConstraints() => Jolt.PInvoke.ConstraintManager_LockAllConstraints(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Constraints/ConstraintManager.h#L90">Jolt/Physics/Constraints/ConstraintManager.h:90</see>
|
|
/// <br/>
|
|
/// <c>void UnlockAllConstraints()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void UnlockAllConstraints() => Jolt.PInvoke.ConstraintManager_UnlockAllConstraints(this);
|
|
}
|
|
}
|