mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 12:38:24 +01:00
178 lines
7.1 KiB
C#
178 lines
7.1 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>
|
|
/// Triangle with 32-bit indices
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L12">Jolt/Geometry/IndexedTriangle.h:12</see>
|
|
/// <br/>
|
|
/// <c>class IndexedTriangleNoMaterial</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
|
public partial struct IndexedTriangleNoMaterial
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L75">Jolt/Geometry/IndexedTriangle.h:75</see>
|
|
/// <br/>
|
|
/// <c>uint32 mIdx[3]</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public uint_3 Idx;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L18">Jolt/Geometry/IndexedTriangle.h:18</see>
|
|
/// <br/>
|
|
/// <c>IndexedTriangleNoMaterial() = default</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static IndexedTriangleNoMaterial Create()
|
|
{
|
|
Jolt.PInvoke.IndexedTriangleNoMaterial_Create(out var _outResult);
|
|
return _outResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L19">Jolt/Geometry/IndexedTriangle.h:19</see>
|
|
/// <br/>
|
|
/// <c>constexpr IndexedTriangleNoMaterial(uint32 inI1, uint32 inI2, uint32 inI3) : mIdx { inI1, inI2, inI3 } { }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static IndexedTriangleNoMaterial Create(uint i1, uint i2, uint i3)
|
|
{
|
|
Jolt.PInvoke.IndexedTriangleNoMaterial_Create_2(i1, i2, i3, out var _outResult);
|
|
return _outResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if two triangles are equivalent (using the same vertices)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L28">Jolt/Geometry/IndexedTriangle.h:28</see>
|
|
/// <br/>
|
|
/// <c>bool IsEquivalent(const IndexedTriangleNoMaterial &inRHS) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public readonly bool IsEquivalent(in IndexedTriangleNoMaterial rhs) =>
|
|
Jolt.PInvoke.IndexedTriangleNoMaterial_IsEquivalent(ref Unsafe.AsRef(in this), in rhs);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if two triangles are opposite (using the same vertices but in opposing order)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L36">Jolt/Geometry/IndexedTriangle.h:36</see>
|
|
/// <br/>
|
|
/// <c>bool IsOpposite(const IndexedTriangleNoMaterial &inRHS) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public readonly bool IsOpposite(in IndexedTriangleNoMaterial rhs) =>
|
|
Jolt.PInvoke.IndexedTriangleNoMaterial_IsOpposite(ref Unsafe.AsRef(in this), in rhs);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if triangle is degenerate
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L44">Jolt/Geometry/IndexedTriangle.h:44</see>
|
|
/// <br/>
|
|
/// <c>bool IsDegenerate(const VertexList &inVertices) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// vertices is copied into a native container for the call; the span is only read.
|
|
/// </para>
|
|
/// </remarks>
|
|
public readonly unsafe bool IsDegenerate(ReadOnlySpan<float3> vertices)
|
|
{
|
|
fixed (float3* vertices_fixed = vertices)
|
|
{
|
|
return Jolt.PInvoke.IndexedTriangleNoMaterial_IsDegenerate(
|
|
ref Unsafe.AsRef(in this),
|
|
vertices_fixed,
|
|
(nuint)vertices.Length
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Rotate the vertices so that the second vertex becomes first etc. This does not change the represented
|
|
/// triangle.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L54">Jolt/Geometry/IndexedTriangle.h:54</see>
|
|
/// <br/>
|
|
/// <c>void Rotate()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Rotate() => Jolt.PInvoke.IndexedTriangleNoMaterial_Rotate(ref this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get center of triangle
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L63">Jolt/Geometry/IndexedTriangle.h:63</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetCentroid(const VertexList &inVertices) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// vertices is copied into a native container for the call; the span is only read.
|
|
/// </para>
|
|
/// </remarks>
|
|
public readonly unsafe float3 GetCentroid(ReadOnlySpan<float3> vertices)
|
|
{
|
|
fixed (float3* vertices_fixed = vertices)
|
|
{
|
|
return Jolt.PInvoke.IndexedTriangleNoMaterial_GetCentroid(
|
|
ref Unsafe.AsRef(in this),
|
|
vertices_fixed,
|
|
(nuint)vertices.Length
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the hash value of this structure
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/IndexedTriangle.h#L69">Jolt/Geometry/IndexedTriangle.h:69</see>
|
|
/// <br/>
|
|
/// <c>uint64 GetHash() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public readonly ulong GetHash() => Jolt.PInvoke.IndexedTriangleNoMaterial_GetHash(ref Unsafe.AsRef(in this));
|
|
}
|
|
}
|