//
// 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
{
///
///
/// Helper class to build an AABB tree
///
///
/// C++:
/// Jolt/AABBTree/AABBTreeBuilder.h:35
///
/// class AABBTreeBuilder
///
///
[InteropHandle]
public readonly partial struct AABBTreeBuilder : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/AABBTree/AABBTreeBuilder.h:101
///
/// explicit AABBTreeBuilder(TriangleSplitter &inSplitter, uint inMaxTrianglesPerLeaf = 16)
///
///
public static AABBTreeBuilder Create(TriangleSplitter splitter, uint maxTrianglesPerLeaf = 16) =>
Jolt.PInvoke.AABBTreeBuilder_Create(splitter, maxTrianglesPerLeaf);
///
///
/// Get all triangles
///
///
/// C++:
/// Jolt/AABBTree/AABBTreeBuilder.h:110
///
/// const Array<IndexedTriangle> &GetTriangles() const
///
///
///
///
/// 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.
///
///
[return: Brutal.Attributes.Fixed]
public unsafe ReadOnlySpan GetTriangles()
{
Jolt.PInvoke.AABBTreeBuilder_GetTriangles(this, out var _outResult);
return new ReadOnlySpan((void*)_outResult.Data, checked((int)_outResult.Count));
}
public void Dispose() => Jolt.PInvoke.AABBTreeBuilder_Destroy(this);
}
}