//
// 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
{
///
///
/// Implementation of GetTrianglesStart/Next that uses a fixed list of vertices for the triangles. These are
/// transformed into world space when getting the triangles.
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/GetTrianglesContext.h:14
///
/// class GetTrianglesContextVertexList
///
///
[InteropHandle]
public readonly partial struct GetTrianglesContextVertexList : IDisposable
{
///
///
/// Constructor, to be called in GetTrianglesStart
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/GetTrianglesContext.h:18
///
/// GetTrianglesContextVertexList(Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, Mat44Arg inLocalTransform, const Vec3 *inTriangleVertices, size_t inNumTriangleVertices, const PhysicsMaterial *inMaterial)
///
///
///
///
/// triangleVertices is copied into a native container the object keeps; the span is only read.
///
///
public static unsafe GetTrianglesContextVertexList Create(
float3 positionCOM,
floatQuat rotation,
float3 scale,
in float4x4 localTransform,
ReadOnlySpan triangleVertices,
PhysicsMaterial material
)
{
fixed (float3* triangleVertices_fixed = triangleVertices)
{
return Jolt.PInvoke.GetTrianglesContextVertexList_Create(
positionCOM,
rotation,
scale,
in localTransform,
triangleVertices_fixed,
(nuint)triangleVertices.Length,
material
);
}
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/GetTrianglesContext.h:31
///
/// int GetTrianglesNext(int inMaxTrianglesRequested, Float3 *outTriangleVertices, const PhysicsMaterial **outMaterials)
///
///
///
///
/// @see Shape::GetTrianglesNext
///
///
/// materials is a buffer of PhysicsMaterial handles you allocate and size; the handles the call writes into
/// it are borrowed from their owner - don't Dispose them.
///
///
public unsafe int GetTrianglesNext(
int maxTrianglesRequested,
Ptr triangleVertices,
Ptr materials
) =>
Jolt.PInvoke.GetTrianglesContextVertexList_GetTrianglesNext(
this,
maxTrianglesRequested,
triangleVertices,
materials
);
public void Dispose() => Jolt.PInvoke.GetTrianglesContextVertexList_Destroy(this);
}
}