mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 21:18:24 +01:00
222 lines
9 KiB
C#
222 lines
9 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 convex hull builder that tries to create hulls as accurately as possible. Used for offline processing.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L20">Jolt/Geometry/ConvexHullBuilder.h:20</see>
|
|
/// <br/>
|
|
/// <c>class ConvexHullBuilder : public NonCopyable</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct ConvexHullBuilder : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Result enum that indicates how the hull got created
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L96">Jolt/Geometry/ConvexHullBuilder.h:96</see>
|
|
/// <br/>
|
|
/// <c>enum class EResult</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public enum Result : int
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Hull building finished successfully
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L98">Jolt/Geometry/ConvexHullBuilder.h:98</see>
|
|
/// <br/>
|
|
/// <c>Success</c>
|
|
/// </para>
|
|
/// </summary>
|
|
Success,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Hull building finished successfully, but the desired accuracy was not reached because the max
|
|
/// vertices limit was reached
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L99">Jolt/Geometry/ConvexHullBuilder.h:99</see>
|
|
/// <br/>
|
|
/// <c>MaxVerticesReached</c>
|
|
/// </para>
|
|
/// </summary>
|
|
MaxVerticesReached,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Too few points to create a hull
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L100">Jolt/Geometry/ConvexHullBuilder.h:100</see>
|
|
/// <br/>
|
|
/// <c>TooFewPoints</c>
|
|
/// </para>
|
|
/// </summary>
|
|
TooFewPoints,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Too few faces in the created hull (signifies precision errors during building)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L101">Jolt/Geometry/ConvexHullBuilder.h:101</see>
|
|
/// <br/>
|
|
/// <c>TooFewFaces</c>
|
|
/// </para>
|
|
/// </summary>
|
|
TooFewFaces,
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Degenerate hull detected
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L102">Jolt/Geometry/ConvexHullBuilder.h:102</see>
|
|
/// <br/>
|
|
/// <c>Degenerate</c>
|
|
/// </para>
|
|
/// </summary>
|
|
Degenerate,
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L263">Jolt/Geometry/ConvexHullBuilder.h:263</see>
|
|
/// <br/>
|
|
/// <c>struct Coplanar</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
|
public partial struct Coplanar
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Index in mPositions
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L265">Jolt/Geometry/ConvexHullBuilder.h:265</see>
|
|
/// <br/>
|
|
/// <c>int mPositionIdx</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public int PositionIdx;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Distance to the edge of closest face (should be > 0)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L266">Jolt/Geometry/ConvexHullBuilder.h:266</see>
|
|
/// <br/>
|
|
/// <c>float mDistanceSq</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(4)]
|
|
public float DistanceSq;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L90">Jolt/Geometry/ConvexHullBuilder.h:90</see>
|
|
/// <br/>
|
|
/// <c>explicit ConvexHullBuilder(const Positions &inPositions)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// positions is copied into a native container the object keeps; the span is only read.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe ConvexHullBuilder Create(ReadOnlySpan<float3> positions)
|
|
{
|
|
fixed (float3* positions_fixed = positions)
|
|
{
|
|
return Jolt.PInvoke.ConvexHullBuilder_Create(positions_fixed, (nuint)positions.Length);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Returns the amount of vertices that are currently used by the hull
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L114">Jolt/Geometry/ConvexHullBuilder.h:114</see>
|
|
/// <br/>
|
|
/// <c>int GetNumVerticesUsed() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public int GetNumVerticesUsed() => Jolt.PInvoke.ConvexHullBuilder_GetNumVerticesUsed(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Returns true if the hull contains a polygon with inIndices (counter clockwise indices in mPositions)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L117">Jolt/Geometry/ConvexHullBuilder.h:117</see>
|
|
/// <br/>
|
|
/// <c>bool ContainsFace(const Array<int> &inIndices) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// indices is copied into a native container for the call; the span is only read.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe bool ContainsFace(ReadOnlySpan<int> indices)
|
|
{
|
|
fixed (int* indices_fixed = indices)
|
|
{
|
|
return Jolt.PInvoke.ConvexHullBuilder_ContainsFace(this, indices_fixed, (nuint)indices.Length);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate the center of mass and the volume of the current convex hull
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/ConvexHullBuilder.h#L120">Jolt/Geometry/ConvexHullBuilder.h:120</see>
|
|
/// <br/>
|
|
/// <c>void GetCenterOfMassAndVolume(Vec3 &outCenterOfMass, float &outVolume) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void GetCenterOfMassAndVolume(out float3 centerOfMass, out float volume) =>
|
|
Jolt.PInvoke.ConvexHullBuilder_GetCenterOfMassAndVolume(this, out centerOfMass, out volume);
|
|
|
|
public void Dispose() => Jolt.PInvoke.ConvexHullBuilder_Destroy(this);
|
|
}
|
|
}
|