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

112 lines
4 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 simple triangle and its material
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L10">Jolt/Geometry/Triangle.h:10</see>
/// <br/>
/// <c>class Triangle</c>
/// </para>
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 44)]
public partial struct Triangle
{
/// <summary>
/// <para>
/// Vertices
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L27">Jolt/Geometry/Triangle.h:27</see>
/// <br/>
/// <c>Float3 mV[3]</c>
/// </para>
/// </summary>
[FieldOffset(0)]
public float3_3 V;
/// <summary>
/// <para>
/// Follows mV[3] so that we can read mV as 4 vectors
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L28">Jolt/Geometry/Triangle.h:28</see>
/// <br/>
/// <c>uint32 mMaterialIndex = 0</c>
/// </para>
/// </summary>
[FieldOffset(36)]
public uint MaterialIndex;
/// <summary>
/// <para>
/// User data that can be used for anything by the application, e.g. for tracking the original index of the
/// triangle
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L29">Jolt/Geometry/Triangle.h:29</see>
/// <br/>
/// <c>uint32 mUserData = 0</c>
/// </para>
/// </summary>
[FieldOffset(40)]
public uint UserData;
/// <summary>
/// <para>
/// Constructor
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L16">Jolt/Geometry/Triangle.h:16</see>
/// <br/>
/// <c>Triangle() = default</c>
/// </para>
/// </summary>
public static Triangle Create()
{
Jolt.PInvoke.Triangle_Create(out var _outResult);
return _outResult;
}
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L17">Jolt/Geometry/Triangle.h:17</see>
/// <br/>
/// <c>Triangle(const Float3 &amp;inV1, const Float3 &amp;inV2, const Float3 &amp;inV3, uint32 inMaterialIndex = 0, uint32 inUserData = 0)</c>
/// </para>
/// </summary>
public static Triangle Create(float3 v1, float3 v2, float3 v3, uint materialIndex = 0, uint userData = 0)
{
Jolt.PInvoke.Triangle_Create_2(v1, v2, v3, materialIndex, userData, out var _outResult);
return _outResult;
}
/// <summary>
/// <para>
/// Get center of triangle
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Triangle.h#L21">Jolt/Geometry/Triangle.h:21</see>
/// <br/>
/// <c>Vec3 GetCentroid() const</c>
/// </para>
/// </summary>
public readonly float3 GetCentroid() => Jolt.PInvoke.Triangle_GetCentroid(ref Unsafe.AsRef(in this));
}
}