//
// 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
{
///
///
/// A simple triangle and its material
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:10
///
/// class Triangle
///
///
[StructLayout(LayoutKind.Explicit, Size = 44)]
public partial struct Triangle
{
///
///
/// Vertices
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:27
///
/// Float3 mV[3]
///
///
[FieldOffset(0)]
public float3_3 V;
///
///
/// Follows mV[3] so that we can read mV as 4 vectors
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:28
///
/// uint32 mMaterialIndex = 0
///
///
[FieldOffset(36)]
public uint MaterialIndex;
///
///
/// User data that can be used for anything by the application, e.g. for tracking the original index of the
/// triangle
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:29
///
/// uint32 mUserData = 0
///
///
[FieldOffset(40)]
public uint UserData;
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:16
///
/// Triangle() = default
///
///
public static Triangle Create()
{
Jolt.PInvoke.Triangle_Create(out var _outResult);
return _outResult;
}
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:17
///
/// Triangle(const Float3 &inV1, const Float3 &inV2, const Float3 &inV3, uint32 inMaterialIndex = 0, uint32 inUserData = 0)
///
///
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;
}
///
///
/// Get center of triangle
///
///
/// C++:
/// Jolt/Geometry/Triangle.h:21
///
/// Vec3 GetCentroid() const
///
///
public readonly float3 GetCentroid() => Jolt.PInvoke.Triangle_GetCentroid(ref Unsafe.AsRef(in this));
}
}