brutal/Brutal.Jolt/Generated/Classes/GetTrianglesContextVertexList.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

96 lines
3.8 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>
/// Implementation of GetTrianglesStart/Next that uses a fixed list of vertices for the triangles. These are
/// transformed into world space when getting the triangles.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/GetTrianglesContext.h#L14">Jolt/Physics/Collision/Shape/GetTrianglesContext.h:14</see>
/// <br/>
/// <c>class GetTrianglesContextVertexList</c>
/// </para>
/// </summary>
[InteropHandle]
public readonly partial struct GetTrianglesContextVertexList : IDisposable
{
/// <summary>
/// <para>
/// Constructor, to be called in GetTrianglesStart
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/GetTrianglesContext.h#L18">Jolt/Physics/Collision/Shape/GetTrianglesContext.h:18</see>
/// <br/>
/// <c>GetTrianglesContextVertexList(Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, Mat44Arg inLocalTransform, const Vec3 *inTriangleVertices, size_t inNumTriangleVertices, const PhysicsMaterial *inMaterial)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// triangleVertices is copied into a native container the object keeps; the span is only read.
/// </para>
/// </remarks>
public static unsafe GetTrianglesContextVertexList Create(
float3 positionCOM,
floatQuat rotation,
float3 scale,
in float4x4 localTransform,
ReadOnlySpan<float3> triangleVertices,
PhysicsMaterial material
)
{
fixed (float3* triangleVertices_fixed = triangleVertices)
{
return Jolt.PInvoke.GetTrianglesContextVertexList_Create(
positionCOM,
rotation,
scale,
in localTransform,
triangleVertices_fixed,
(nuint)triangleVertices.Length,
material
);
}
}
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/GetTrianglesContext.h#L31">Jolt/Physics/Collision/Shape/GetTrianglesContext.h:31</see>
/// <br/>
/// <c>int GetTrianglesNext(int inMaxTrianglesRequested, Float3 *outTriangleVertices, const PhysicsMaterial **outMaterials)</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// @see Shape::GetTrianglesNext
/// </para>
/// <para>
/// 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.
/// </para>
/// </remarks>
public unsafe int GetTrianglesNext(
int maxTrianglesRequested,
Ptr<float3> triangleVertices,
Ptr<PhysicsMaterial> materials
) =>
Jolt.PInvoke.GetTrianglesContextVertexList_GetTrianglesNext(
this,
maxTrianglesRequested,
triangleVertices,
materials
);
public void Dispose() => Jolt.PInvoke.GetTrianglesContextVertexList_Destroy(this);
}
}