mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
239 lines
11 KiB
C#
239 lines
11 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/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>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L37">Jolt/Physics/LargeIslandSplitter.h:37</see>
|
|
/// <br/>
|
|
/// <c>enum class EStatus</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Status code for retrieving a batch
|
|
/// </para>
|
|
/// </remarks>
|
|
public enum EStatus : int
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Work is expected to be available later
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/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/23dadd0e603f1b321142d4c74df07fce85064989/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/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L41">Jolt/Physics/LargeIslandSplitter.h:41</see>
|
|
/// <br/>
|
|
/// <c>AllBatchesDone</c>
|
|
/// </para>
|
|
/// </summary>
|
|
AllBatchesDone,
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L45">Jolt/Physics/LargeIslandSplitter.h:45</see>
|
|
/// <br/>
|
|
/// <c>struct Split</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Describes a split of constraints and contacts
|
|
/// </para>
|
|
/// </remarks>
|
|
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
|
public struct Split
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Begin of the contact buffer (offset relative to mContactAndConstraintIndices)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L51">Jolt/Physics/LargeIslandSplitter.h:51</see>
|
|
/// <br/>
|
|
/// <c>uint32 mContactBufferBegin</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public uint mContactBufferBegin;
|
|
/// <summary>
|
|
/// <para>
|
|
/// End of the contact buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L52">Jolt/Physics/LargeIslandSplitter.h:52</see>
|
|
/// <br/>
|
|
/// <c>uint32 mContactBufferEnd</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(4)]
|
|
public uint mContactBufferEnd;
|
|
/// <summary>
|
|
/// <para>
|
|
/// Begin of the constraint buffer (offset relative to mContactAndConstraintIndices)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L54">Jolt/Physics/LargeIslandSplitter.h:54</see>
|
|
/// <br/>
|
|
/// <c>uint32 mConstraintBufferBegin</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(8)]
|
|
public uint mConstraintBufferBegin;
|
|
/// <summary>
|
|
/// <para>
|
|
/// End of the constraint buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L55">Jolt/Physics/LargeIslandSplitter.h:55</see>
|
|
/// <br/>
|
|
/// <c>uint32 mConstraintBufferEnd</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(12)]
|
|
public uint mConstraintBufferEnd;
|
|
}
|
|
public static LargeIslandSplitter Create() => Jolt.PInvoke.LargeIslandSplitter_Create();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/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>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Prepare the island splitter by allocating memory
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Prepare(IslandBuilder islandBuilder, uint numActiveBodies, TempAllocator tempAllocator) => Jolt.PInvoke.LargeIslandSplitter_Prepare(this, islandBuilder, numActiveBodies, tempAllocator);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L142">Jolt/Physics/LargeIslandSplitter.h:142</see>
|
|
/// <br/>
|
|
/// <c>uint AssignSplit(const Body *inBody1, const Body *inBody2)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Assign two bodies to a split. Returns the split index.
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint AssignSplit(Body body1, Body body2) => Jolt.PInvoke.LargeIslandSplitter_AssignSplit(this, body1, body2);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L145">Jolt/Physics/LargeIslandSplitter.h:145</see>
|
|
/// <br/>
|
|
/// <c>uint AssignToNonParallelSplit(const Body *inBody)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Force a body to be in a non parallel split. Returns the split index.
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint AssignToNonParallelSplit(Body body) => Jolt.PInvoke.LargeIslandSplitter_AssignToNonParallelSplit(this, body);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L157">Jolt/Physics/LargeIslandSplitter.h:157</see>
|
|
/// <br/>
|
|
/// <c>inline uint32 GetIslandIndex(uint inSplitIslandIndex) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the island index of the island that was split for a particular split island index
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetIslandIndex(uint splitIslandIndex) => Jolt.PInvoke.LargeIslandSplitter_GetIslandIndex(this, splitIslandIndex);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L164">Jolt/Physics/LargeIslandSplitter.h:164</see>
|
|
/// <br/>
|
|
/// <c>void PrepareForSolvePositions()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Prepare the island splitter for iterating over the split islands again for position solving. Marks all
|
|
/// batches as startable.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void PrepareForSolvePositions() => Jolt.PInvoke.LargeIslandSplitter_PrepareForSolvePositions(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/LargeIslandSplitter.h#L167">Jolt/Physics/LargeIslandSplitter.h:167</see>
|
|
/// <br/>
|
|
/// <c>void Reset(TempAllocator *inTempAllocator)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Reset the island splitter
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Reset(TempAllocator tempAllocator) => Jolt.PInvoke.LargeIslandSplitter_Reset(this, tempAllocator);
|
|
public void Dispose() => Jolt.PInvoke.LargeIslandSplitter_Destroy(this);
|
|
}
|
|
}
|