mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
203 lines
8.5 KiB
C#
203 lines
8.5 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 class that splits a triangle list into two parts for building a tree
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L13">Jolt/TriangleSplitter/TriangleSplitter.h:13</see>
|
|
/// <br/>
|
|
/// <c>class TriangleSplitter : public NonCopyable</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct TriangleSplitter
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L22">Jolt/TriangleSplitter/TriangleSplitter.h:22</see>
|
|
/// <br/>
|
|
/// <c>struct Stats</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
|
public partial struct Stats
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L24">Jolt/TriangleSplitter/TriangleSplitter.h:24</see>
|
|
/// <br/>
|
|
/// <c>const char * mSplitterName = nullptr</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public Ptr<byte> SplitterName;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L25">Jolt/TriangleSplitter/TriangleSplitter.h:25</see>
|
|
/// <br/>
|
|
/// <c>int mLeafSize = 0</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(8)]
|
|
public int LeafSize;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Helper struct to indicate triangle range before and after the split
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L32">Jolt/TriangleSplitter/TriangleSplitter.h:32</see>
|
|
/// <br/>
|
|
/// <c>struct Range</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
|
public partial struct Range
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Start and end index (end = 1 beyond end)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L45">Jolt/TriangleSplitter/TriangleSplitter.h:45</see>
|
|
/// <br/>
|
|
/// <c>uint mBegin</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public uint Begin;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L46">Jolt/TriangleSplitter/TriangleSplitter.h:46</see>
|
|
/// <br/>
|
|
/// <c>uint mEnd</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(4)]
|
|
public uint End;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get stats of splitter
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L29">Jolt/TriangleSplitter/TriangleSplitter.h:29</see>
|
|
/// <br/>
|
|
/// <c>virtual void GetStats(Stats &outStats) const = 0</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void GetStats(ref TriangleSplitter.Stats stats) =>
|
|
Jolt.PInvoke.TriangleSplitter_GetStats(this, ref stats);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Range of triangles to start with
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L50">Jolt/TriangleSplitter/TriangleSplitter.h:50</see>
|
|
/// <br/>
|
|
/// <c>Range GetInitialRange() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public TriangleSplitter.Range GetInitialRange()
|
|
{
|
|
Jolt.PInvoke.TriangleSplitter_GetInitialRange(this, out var _outResult);
|
|
return _outResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Split triangles into two groups left and right, returns false if no split could be made
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L60">Jolt/TriangleSplitter/TriangleSplitter.h:60</see>
|
|
/// <br/>
|
|
/// <c>virtual bool Split(const Range &inTriangles, Range &outLeft, Range &outRight) = 0</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Split triangles into two groups left and right, returns false if no split could be made
|
|
/// @param inTriangles The range of triangles (in mSortedTriangleIdx) to process
|
|
/// @param outLeft On return this will contain the ranges for the left subpart. mSortedTriangleIdx may have been shuffled.
|
|
/// @param outRight On return this will contain the ranges for the right subpart. mSortedTriangleIdx may have been shuffled.
|
|
/// @return Returns true when a split was found
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool Split(
|
|
in TriangleSplitter.Range triangles,
|
|
ref TriangleSplitter.Range left,
|
|
ref TriangleSplitter.Range right
|
|
) => Jolt.PInvoke.TriangleSplitter_Split(this, in triangles, ref left, ref right);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the list of vertices
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L63">Jolt/TriangleSplitter/TriangleSplitter.h:63</see>
|
|
/// <br/>
|
|
/// <c>const VertexList & GetVertices() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The span is a view of the container's own storage, not a copy, so it costs nothing to take. It's only
|
|
/// valid until that container is resized or its owner is destroyed.
|
|
/// </para>
|
|
/// </remarks>
|
|
[return: Brutal.Attributes.Fixed]
|
|
public unsafe ReadOnlySpan<float3> GetVertices()
|
|
{
|
|
Jolt.PInvoke.TriangleSplitter_GetVertices(this, out var _outResult);
|
|
return new ReadOnlySpan<float3>((void*)_outResult.Data, checked((int)_outResult.Count));
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get triangle by index
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/TriangleSplitter/TriangleSplitter.h#L69">Jolt/TriangleSplitter/TriangleSplitter.h:69</see>
|
|
/// <br/>
|
|
/// <c>const IndexedTriangle & GetTriangle(uint inIdx) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public IndexedTriangle GetTriangle(uint idx)
|
|
{
|
|
Jolt.PInvoke.TriangleSplitter_GetTriangle(this, idx, out var _inRange, out var _outResult);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(idx),
|
|
idx,
|
|
"Expected an index below the number of triangles."
|
|
);
|
|
return _outResult;
|
|
}
|
|
}
|
|
}
|