//
// 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
{
///
///
/// Splitter using mean of axis with biggest centroid deviation
///
///
/// C++:
/// Jolt/TriangleSplitter/TriangleSplitterMean.h:12
///
/// class TriangleSplitterMean : public TriangleSplitter
///
///
[InteropHandle]
public readonly partial struct TriangleSplitterMean : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/TriangleSplitter/TriangleSplitterMean.h:16
///
/// TriangleSplitterMean(const VertexList &inVertices, const IndexedTriangleList &inTriangles)
///
///
///
///
/// vertices is copied into a native container the object keeps; the span is only read.
///
///
/// triangles is copied into a native container the object keeps; the span is only read.
///
///
public static unsafe TriangleSplitterMean Create(
ReadOnlySpan vertices,
ReadOnlySpan triangles
)
{
fixed (IndexedTriangle* triangles_fixed = triangles)
fixed (float3* vertices_fixed = vertices)
{
return Jolt.PInvoke.TriangleSplitterMean_Create(
vertices_fixed,
(nuint)vertices.Length,
triangles_fixed,
(nuint)triangles.Length
);
}
}
///
public void GetStats(ref TriangleSplitter.Stats stats) => ((TriangleSplitter)this).GetStats(ref stats);
///
public bool Split(
in TriangleSplitter.Range triangles,
ref TriangleSplitter.Range left,
ref TriangleSplitter.Range right
) => ((TriangleSplitter)this).Split(in triangles, ref left, ref right);
public static implicit operator TriangleSplitter(TriangleSplitterMean value) =>
Unsafe.BitCast(value);
public void Dispose() => Jolt.PInvoke.TriangleSplitterMean_Destroy(this);
///
public TriangleSplitter.Range GetInitialRange() => ((TriangleSplitter)this).GetInitialRange();
///
[return: Brutal.Attributes.Fixed]
public unsafe ReadOnlySpan GetVertices() => ((TriangleSplitter)this).GetVertices();
///
public IndexedTriangle GetTriangle(uint idx) => ((TriangleSplitter)this).GetTriangle(idx);
}
}