mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
280 lines
12 KiB
C#
280 lines
12 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>
|
|
/// Assigns bodies in large islands to multiple groups that can run in parallel
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L26">Jolt/Physics/LargeIslandSplitter.h:26</see>
|
|
/// <br/>
|
|
/// <c>class LargeIslandSplitter : public NonCopyable</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Assigns bodies in large islands to multiple groups that can run in parallel
|
|
///
|
|
/// This basically implements what is described in: High-Performance Physical Simulations on Next-Generation Architecture with Many Cores by Chen et al.
|
|
/// See: http://web.eecs.umich.edu/~msmelyan/papers/physsim_onmanycore_itj.pdf section "PARALLELIZATION METHODOLOGY"
|
|
///
|
|
/// WARNING: This class is an internal part of PhysicsSystem, it has no functions that can be called by users of the library.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct LargeIslandSplitter : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Status code for retrieving a batch
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L37">Jolt/Physics/LargeIslandSplitter.h:37</see>
|
|
/// <br/>
|
|
/// <c>enum class EStatus</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public enum Status : int
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Work is expected to be available later
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L39">Jolt/Physics/LargeIslandSplitter.h:39</see>
|
|
/// <br/>
|
|
/// <c>WaitingForBatch</c>
|
|
/// </para>
|
|
/// </summary>
|
|
WaitingForBatch,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Work is being returned
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L40">Jolt/Physics/LargeIslandSplitter.h:40</see>
|
|
/// <br/>
|
|
/// <c>BatchRetrieved</c>
|
|
/// </para>
|
|
/// </summary>
|
|
BatchRetrieved,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// No further work is expected from this
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L41">Jolt/Physics/LargeIslandSplitter.h:41</see>
|
|
/// <br/>
|
|
/// <c>AllBatchesDone</c>
|
|
/// </para>
|
|
/// </summary>
|
|
AllBatchesDone,
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Describes a split of constraints and contacts
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L45">Jolt/Physics/LargeIslandSplitter.h:45</see>
|
|
/// <br/>
|
|
/// <c>struct Split</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
|
public partial struct Split
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Begin of the contact buffer (offset relative to mContactAndConstraintIndices)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L51">Jolt/Physics/LargeIslandSplitter.h:51</see>
|
|
/// <br/>
|
|
/// <c>uint32 mContactBufferBegin</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public uint ContactBufferBegin;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// End of the contact buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L52">Jolt/Physics/LargeIslandSplitter.h:52</see>
|
|
/// <br/>
|
|
/// <c>uint32 mContactBufferEnd</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(4)]
|
|
public uint ContactBufferEnd;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Begin of the constraint buffer (offset relative to mContactAndConstraintIndices)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L54">Jolt/Physics/LargeIslandSplitter.h:54</see>
|
|
/// <br/>
|
|
/// <c>uint32 mConstraintBufferBegin</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(8)]
|
|
public uint ConstraintBufferBegin;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// End of the constraint buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L55">Jolt/Physics/LargeIslandSplitter.h:55</see>
|
|
/// <br/>
|
|
/// <c>uint32 mConstraintBufferEnd</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(12)]
|
|
public uint ConstraintBufferEnd;
|
|
}
|
|
|
|
public static LargeIslandSplitter Create() => Jolt.PInvoke.LargeIslandSplitter_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Prepare the island splitter by allocating memory
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L139">Jolt/Physics/LargeIslandSplitter.h:139</see>
|
|
/// <br/>
|
|
/// <c>void Prepare(const IslandBuilder &inIslandBuilder, uint32 inNumActiveBodies, TempAllocator *inTempAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Prepare(IslandBuilder islandBuilder, uint numActiveBodies, TempAllocator tempAllocator) =>
|
|
Jolt.PInvoke.LargeIslandSplitter_Prepare(this, islandBuilder, numActiveBodies, tempAllocator);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Assign two bodies to a split. Returns the split index.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L142">Jolt/Physics/LargeIslandSplitter.h:142</see>
|
|
/// <br/>
|
|
/// <c>uint AssignSplit(const Body *inBody1, const Body *inBody2)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint AssignSplit(Body body1, Body body2) =>
|
|
Jolt.PInvoke.LargeIslandSplitter_AssignSplit(this, body1, body2);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Force a body to be in a non parallel split. Returns the split index.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L145">Jolt/Physics/LargeIslandSplitter.h:145</see>
|
|
/// <br/>
|
|
/// <c>uint AssignToNonParallelSplit(const Body *inBody)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint AssignToNonParallelSplit(Body body) =>
|
|
Jolt.PInvoke.LargeIslandSplitter_AssignToNonParallelSplit(this, body);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the island index of the island that was split for a particular split island index
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L157">Jolt/Physics/LargeIslandSplitter.h:157</see>
|
|
/// <br/>
|
|
/// <c>inline uint32 GetIslandIndex(uint inSplitIslandIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public uint GetIslandIndex(uint splitIslandIndex) =>
|
|
Jolt.PInvoke.LargeIslandSplitter_GetIslandIndex(this, splitIslandIndex);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Prepare the island splitter for iterating over the split islands again for position solving. Marks all
|
|
/// batches as startable.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L164">Jolt/Physics/LargeIslandSplitter.h:164</see>
|
|
/// <br/>
|
|
/// <c>void PrepareForSolvePositions()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void PrepareForSolvePositions() => Jolt.PInvoke.LargeIslandSplitter_PrepareForSolvePositions(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Reset the island splitter
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L167">Jolt/Physics/LargeIslandSplitter.h:167</see>
|
|
/// <br/>
|
|
/// <c>void Reset(TempAllocator *inTempAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Reset(TempAllocator tempAllocator) => Jolt.PInvoke.LargeIslandSplitter_Reset(this, tempAllocator);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L32">Jolt/Physics/LargeIslandSplitter.h:32</see>
|
|
/// <br/>
|
|
/// <c>static constexpr uint cNumSplits = sizeof(SplitMask) * 8</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetNumSplits() => Jolt.PInvoke.LargeIslandSplitter_GetNumSplits();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L33">Jolt/Physics/LargeIslandSplitter.h:33</see>
|
|
/// <br/>
|
|
/// <c>static constexpr uint cNonParallelSplitIdx = cNumSplits - 1</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetNonParallelSplitIdx() => Jolt.PInvoke.LargeIslandSplitter_GetNonParallelSplitIdx();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// If the number of constraints + contacts in an island is larger than this, we will try to split the
|
|
/// island
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/LargeIslandSplitter.h#L34">Jolt/Physics/LargeIslandSplitter.h:34</see>
|
|
/// <br/>
|
|
/// <c>static constexpr uint cLargeIslandTreshold = 128</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetLargeIslandTreshold() => Jolt.PInvoke.LargeIslandSplitter_GetLargeIslandTreshold();
|
|
|
|
public void Dispose() => Jolt.PInvoke.LargeIslandSplitter_Destroy(this);
|
|
}
|
|
}
|