mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-28 05:58:25 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
645
Brutal.Jolt/Generated/Classes/ConvexHullShape.gen.cs
Normal file
645
Brutal.Jolt/Generated/Classes/ConvexHullShape.gen.cs
Normal file
|
|
@ -0,0 +1,645 @@
|
|||
// <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
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L40">Jolt/Physics/Collision/Shape/ConvexHullShape.h:40</see>
|
||||
/// <br/>
|
||||
/// <c>class ConvexHullShape final : public ConvexShape</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[InteropHandle]
|
||||
public readonly partial struct ConvexHullShape : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L167">Jolt/Physics/Collision/Shape/ConvexHullShape.h:167</see>
|
||||
/// <br/>
|
||||
/// <c>struct Face</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
public partial struct Face
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// First index in mVertexIdx to use
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L169">Jolt/Physics/Collision/Shape/ConvexHullShape.h:169</see>
|
||||
/// <br/>
|
||||
/// <c>uint16 mFirstVertex</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[FieldOffset(0)]
|
||||
public ushort FirstVertex;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Number of vertices in the mVertexIdx to use
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L170">Jolt/Physics/Collision/Shape/ConvexHullShape.h:170</see>
|
||||
/// <br/>
|
||||
/// <c>uint16 mNumVertices = 0</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[FieldOffset(2)]
|
||||
public ushort NumVertices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L176">Jolt/Physics/Collision/Shape/ConvexHullShape.h:176</see>
|
||||
/// <br/>
|
||||
/// <c>struct Point</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
public partial struct Point
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Position of vertex
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L178">Jolt/Physics/Collision/Shape/ConvexHullShape.h:178</see>
|
||||
/// <br/>
|
||||
/// <c>Vec3 mPosition</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[FieldOffset(0)]
|
||||
public float3 Position;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Number of faces in the face array below
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L179">Jolt/Physics/Collision/Shape/ConvexHullShape.h:179</see>
|
||||
/// <br/>
|
||||
/// <c>int mNumFaces = 0</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[FieldOffset(16)]
|
||||
public int NumFaces;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Indices of 3 neighboring faces with the biggest difference in normal (used to shift vertices for
|
||||
/// convex radius)
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L180">Jolt/Physics/Collision/Shape/ConvexHullShape.h:180</see>
|
||||
/// <br/>
|
||||
/// <c>int mFaces[3] = { -1, -1, -1 }</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[FieldOffset(20)]
|
||||
public int_3 Faces;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Constructor
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L50">Jolt/Physics/Collision/Shape/ConvexHullShape.h:50</see>
|
||||
/// <br/>
|
||||
/// <c>ConvexHullShape()</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static ConvexHullShape Create() => Jolt.PInvoke.ConvexHullShape_Create();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L51">Jolt/Physics/Collision/Shape/ConvexHullShape.h:51</see>
|
||||
/// <br/>
|
||||
/// <c>ConvexHullShape(const ConvexHullShapeSettings &inSettings, ShapeResult &outResult)</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static ConvexHullShape Create(ConvexHullShapeSettings settings)
|
||||
{
|
||||
var _handle = Jolt.PInvoke.ConvexHullShape_Create_2(settings);
|
||||
if (_handle.IsNull())
|
||||
throw JoltException.FromLastError();
|
||||
return _handle;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Shape.GetCenterOfMass()"/>
|
||||
public float3 GetCenterOfMass() => ((Shape)this).GetCenterOfMass();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetLocalBounds()"/>
|
||||
public AABox GetLocalBounds() => ((Shape)this).GetLocalBounds();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetInnerRadius()"/>
|
||||
public float GetInnerRadius() => ((Shape)this).GetInnerRadius();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetMassProperties()"/>
|
||||
public MassProperties GetMassProperties() => ((Shape)this).GetMassProperties();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSurfaceNormal(uint, float3)"/>
|
||||
public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) =>
|
||||
((Shape)this).GetSurfaceNormal(subShapeID, localSurfacePosition);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSupportingFace(uint, float3, float3, in float4x4, out StaticArrayVec3_32)"/>
|
||||
public void GetSupportingFace(
|
||||
uint subShapeID,
|
||||
float3 direction,
|
||||
float3 scale,
|
||||
in float4x4 centerOfMassTransform,
|
||||
out StaticArrayVec3_32 vertices
|
||||
) => ((Shape)this).GetSupportingFace(subShapeID, direction, scale, in centerOfMassTransform, out vertices);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSubmergedVolume(in float4x4, float3, in Plane, out float, out float, out float3, float3)"/>
|
||||
public void GetSubmergedVolume(
|
||||
in float4x4 centerOfMassTransform,
|
||||
float3 scale,
|
||||
in Plane surface,
|
||||
out float totalVolume,
|
||||
out float submergedVolume,
|
||||
out float3 centerOfBuoyancy,
|
||||
float3 baseOffset
|
||||
) =>
|
||||
((Shape)this).GetSubmergedVolume(
|
||||
in centerOfMassTransform,
|
||||
scale,
|
||||
in surface,
|
||||
out totalVolume,
|
||||
out submergedVolume,
|
||||
out centerOfBuoyancy,
|
||||
baseOffset
|
||||
);
|
||||
|
||||
/// <inheritdoc cref="Shape.Draw(DebugRenderer, in float4x4, float3, uint, bool, bool)"/>
|
||||
public void Draw(
|
||||
DebugRenderer renderer,
|
||||
in float4x4 centerOfMassTransform,
|
||||
float3 scale,
|
||||
uint color,
|
||||
bool useMaterialColors,
|
||||
bool drawWireframe
|
||||
) => ((Shape)this).Draw(renderer, in centerOfMassTransform, scale, color, useMaterialColors, drawWireframe);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Debugging helper draw function that draws how all points are moved when a shape is shrunk by the convex
|
||||
/// radius
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L82">Jolt/Physics/Collision/Shape/ConvexHullShape.h:82</see>
|
||||
/// <br/>
|
||||
/// <c>void DrawShrunkShape(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale) const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public void DrawShrunkShape(DebugRenderer renderer, in float4x4 centerOfMassTransform, float3 scale) =>
|
||||
Jolt.PInvoke.ConvexHullShape_DrawShrunkShape(this, renderer, in centerOfMassTransform, scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.CastRay(in RayCast, SubShapeIDCreator, ref RayCastResult)"/>
|
||||
public bool CastRay(in RayCast ray, SubShapeIDCreator subShapeIDCreator, ref RayCastResult hit) =>
|
||||
((Shape)this).CastRay(in ray, subShapeIDCreator, ref hit);
|
||||
|
||||
/// <inheritdoc cref="Shape.CastRay(in RayCast, RayCastSettings, SubShapeIDCreator, Span{RayCastResult}, out uint, ShapeFilter)"/>
|
||||
public unsafe uint CastRay(
|
||||
in RayCast ray,
|
||||
RayCastSettings rayCastSettings,
|
||||
SubShapeIDCreator subShapeIDCreator,
|
||||
Span<RayCastResult> results,
|
||||
out uint totalHits,
|
||||
ShapeFilter shapeFilter = default
|
||||
) => ((Shape)this).CastRay(in ray, rayCastSettings, subShapeIDCreator, results, out totalHits, shapeFilter);
|
||||
|
||||
/// <inheritdoc cref="Shape.CastRayClosest(in RayCast, RayCastSettings, SubShapeIDCreator, out RayCastResult, ShapeFilter)"/>
|
||||
public bool CastRayClosest(
|
||||
in RayCast ray,
|
||||
RayCastSettings rayCastSettings,
|
||||
SubShapeIDCreator subShapeIDCreator,
|
||||
out RayCastResult result,
|
||||
ShapeFilter shapeFilter = default
|
||||
) => ((Shape)this).CastRayClosest(in ray, rayCastSettings, subShapeIDCreator, out result, shapeFilter);
|
||||
|
||||
/// <inheritdoc cref="Shape.CollidePoint(float3, SubShapeIDCreator, Span{CollidePointResult}, out uint, ShapeFilter)"/>
|
||||
public unsafe uint CollidePoint(
|
||||
float3 point,
|
||||
SubShapeIDCreator subShapeIDCreator,
|
||||
Span<CollidePointResult> results,
|
||||
out uint totalHits,
|
||||
ShapeFilter shapeFilter = default
|
||||
) => ((Shape)this).CollidePoint(point, subShapeIDCreator, results, out totalHits, shapeFilter);
|
||||
|
||||
/// <inheritdoc cref="Shape.CollideSoftBodyVertices(in float4x4, float3, CollideSoftBodyVertexIterator, uint, int)"/>
|
||||
public void CollideSoftBodyVertices(
|
||||
in float4x4 centerOfMassTransform,
|
||||
float3 scale,
|
||||
CollideSoftBodyVertexIterator vertices,
|
||||
uint numVertices,
|
||||
int collidingShapeIndex
|
||||
) =>
|
||||
((Shape)this).CollideSoftBodyVertices(
|
||||
in centerOfMassTransform,
|
||||
scale,
|
||||
vertices,
|
||||
numVertices,
|
||||
collidingShapeIndex
|
||||
);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetTrianglesStart(ref Shape.GetTrianglesContext, in AABox, float3, floatQuat, float3)"/>
|
||||
public void GetTrianglesStart(
|
||||
ref Shape.GetTrianglesContext context,
|
||||
in AABox box,
|
||||
float3 positionCOM,
|
||||
floatQuat rotation,
|
||||
float3 scale
|
||||
) => ((Shape)this).GetTrianglesStart(ref context, in box, positionCOM, rotation, scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetTrianglesNext(ref Shape.GetTrianglesContext, int, Ptr{float3}, Ptr{PhysicsMaterial})"/>
|
||||
public unsafe int GetTrianglesNext(
|
||||
ref Shape.GetTrianglesContext context,
|
||||
int maxTrianglesRequested,
|
||||
Ptr<float3> triangleVertices,
|
||||
Ptr<PhysicsMaterial> materials = default
|
||||
) => ((Shape)this).GetTrianglesNext(ref context, maxTrianglesRequested, triangleVertices, materials);
|
||||
|
||||
/// <inheritdoc cref="Shape.SaveBinaryState(StreamOut)"/>
|
||||
public void SaveBinaryState(StreamOut stream) => ((Shape)this).SaveBinaryState(stream);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetStats()"/>
|
||||
public Shape.Stats GetStats() => ((Shape)this).GetStats();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetVolume()"/>
|
||||
public float GetVolume() => ((Shape)this).GetVolume();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the convex radius of this convex hull
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L111">Jolt/Physics/Collision/Shape/ConvexHullShape.h:111</see>
|
||||
/// <br/>
|
||||
/// <c>float GetConvexRadius() const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public float GetConvexRadius() => Jolt.PInvoke.ConvexHullShape_GetConvexRadius(this);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the planes of this convex hull
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L114">Jolt/Physics/Collision/Shape/ConvexHullShape.h:114</see>
|
||||
/// <br/>
|
||||
/// <c>const Array<Plane> & GetPlanes() const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The span is a view of the container's own storage, not a copy, so it costs nothing to take. It's only
|
||||
/// valid until that container is resized or its owner is destroyed.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[return: Brutal.Attributes.Fixed]
|
||||
public unsafe ReadOnlySpan<Plane> GetPlanes()
|
||||
{
|
||||
Jolt.PInvoke.ConvexHullShape_GetPlanes(this, out var _outResult);
|
||||
return new ReadOnlySpan<Plane>((void*)_outResult.Data, checked((int)_outResult.Count));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the number of vertices in this convex hull
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L117">Jolt/Physics/Collision/Shape/ConvexHullShape.h:117</see>
|
||||
/// <br/>
|
||||
/// <c>inline uint GetNumPoints() const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public uint GetNumPoints() => Jolt.PInvoke.ConvexHullShape_GetNumPoints(this);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get a vertex of this convex hull relative to the center of mass
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L120">Jolt/Physics/Collision/Shape/ConvexHullShape.h:120</see>
|
||||
/// <br/>
|
||||
/// <c>inline Vec3 GetPoint(uint inIndex) const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public float3 GetPoint(uint index)
|
||||
{
|
||||
var _result = Jolt.PInvoke.ConvexHullShape_GetPoint(this, index, out var _inRange);
|
||||
if (_inRange == 0)
|
||||
throw new ArgumentOutOfRangeException(
|
||||
nameof(index),
|
||||
index,
|
||||
"Expected an index below the number of points."
|
||||
);
|
||||
return _result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the number of faces in this convex hull
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L123">Jolt/Physics/Collision/Shape/ConvexHullShape.h:123</see>
|
||||
/// <br/>
|
||||
/// <c>inline uint GetNumFaces() const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public uint GetNumFaces() => Jolt.PInvoke.ConvexHullShape_GetNumFaces(this);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the number of vertices in a face
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L126">Jolt/Physics/Collision/Shape/ConvexHullShape.h:126</see>
|
||||
/// <br/>
|
||||
/// <c>inline uint GetNumVerticesInFace(uint inFaceIndex) const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public uint GetNumVerticesInFace(uint faceIndex)
|
||||
{
|
||||
var _result = Jolt.PInvoke.ConvexHullShape_GetNumVerticesInFace(this, faceIndex, out var _inRange);
|
||||
if (_inRange == 0)
|
||||
throw new ArgumentOutOfRangeException(
|
||||
nameof(faceIndex),
|
||||
faceIndex,
|
||||
"Expected an index below the number of faces."
|
||||
);
|
||||
return _result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get the vertices indices of a face
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L133">Jolt/Physics/Collision/Shape/ConvexHullShape.h:133</see>
|
||||
/// <br/>
|
||||
/// <c>inline uint GetFaceVertices(uint inFaceIndex, uint inMaxVertices, uint *outVertices) const</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <code>
|
||||
/// Get the vertices indices of a face
|
||||
/// @param inFaceIndex Index of the face.
|
||||
/// @param inMaxVertices Maximum number of vertices to return.
|
||||
/// @param outVertices Array of vertices indices, must be at least inMaxVertices in size, the vertices are returned in counter clockwise order and the positions can be obtained using GetPoint(index).
|
||||
/// @return Number of vertices in face, if this is bigger than inMaxVertices, not all vertices were retrieved.
|
||||
/// </code>
|
||||
/// <para>
|
||||
/// vertices is the buffer the native call fills, and its capacity travels with it: the call writes at most
|
||||
/// as many elements as the span holds, and only for the duration of the call.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public unsafe uint GetFaceVertices(uint faceIndex, Span<uint> vertices)
|
||||
{
|
||||
fixed (uint* vertices_fixed = vertices)
|
||||
{
|
||||
var _result = Jolt.PInvoke.ConvexHullShape_GetFaceVertices(
|
||||
this,
|
||||
faceIndex,
|
||||
(uint)vertices.Length,
|
||||
vertices_fixed,
|
||||
out var _inRange
|
||||
);
|
||||
if (_inRange == 0)
|
||||
throw new ArgumentOutOfRangeException(
|
||||
nameof(faceIndex),
|
||||
faceIndex,
|
||||
"Expected an index below the number of faces."
|
||||
);
|
||||
return _result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Register shape functions with the registry
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L144">Jolt/Physics/Collision/Shape/ConvexHullShape.h:144</see>
|
||||
/// <br/>
|
||||
/// <c>static void sRegister()</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static void Register() => Jolt.PInvoke.ConvexHullShape_Register();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Maximum amount of points supported in a convex hull. Note that while constructing a hull, interior
|
||||
/// points are discarded so you can provide more points. The ConvexHullShapeSettings::Create function will
|
||||
/// return an error when too many points are provided.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L47">Jolt/Physics/Collision/Shape/ConvexHullShape.h:47</see>
|
||||
/// <br/>
|
||||
/// <c>static constexpr int cMaxPointsInHull = 256</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static int GetMaxPointsInHull() => Jolt.PInvoke.ConvexHullShape_GetMaxPointsInHull();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Draw the outlines of the faces of the convex hull when drawing the shape
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L148">Jolt/Physics/Collision/Shape/ConvexHullShape.h:148</see>
|
||||
/// <br/>
|
||||
/// <c>inline static bool sDrawFaceOutlines = false</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static bool GetDrawFaceOutlines() => Jolt.PInvoke.ConvexHullShape_GetDrawFaceOutlines();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Draw the outlines of the faces of the convex hull when drawing the shape
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// C++:
|
||||
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/ConvexHullShape.h#L148">Jolt/Physics/Collision/Shape/ConvexHullShape.h:148</see>
|
||||
/// <br/>
|
||||
/// <c>inline static bool sDrawFaceOutlines = false</c>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static void SetDrawFaceOutlines(bool value) => Jolt.PInvoke.ConvexHullShape_SetDrawFaceOutlines(value);
|
||||
|
||||
public void AddRef() => ((Shape)this).AddRef();
|
||||
|
||||
public void Release() => ((Shape)this).Release();
|
||||
|
||||
public uint GetRefCount() => ((Shape)this).GetRefCount();
|
||||
|
||||
public static implicit operator ConvexShape(ConvexHullShape value) =>
|
||||
Unsafe.BitCast<ConvexHullShape, ConvexShape>(value);
|
||||
|
||||
public static implicit operator Shape(ConvexHullShape value) => Unsafe.BitCast<ConvexHullShape, Shape>(value);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (IsNull())
|
||||
return;
|
||||
Release();
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ConvexShape.GetMaterial()"/>
|
||||
public PhysicsMaterial GetMaterial() => ((ConvexShape)this).GetMaterial();
|
||||
|
||||
/// <inheritdoc cref="ConvexShape.SetMaterial(PhysicsMaterial)"/>
|
||||
public void SetMaterial(PhysicsMaterial material) => ((ConvexShape)this).SetMaterial(material);
|
||||
|
||||
/// <inheritdoc cref="ConvexShape.SetDensity(float)"/>
|
||||
public void SetDensity(float density) => ((ConvexShape)this).SetDensity(density);
|
||||
|
||||
/// <inheritdoc cref="ConvexShape.GetDensity()"/>
|
||||
public float GetDensity() => ((ConvexShape)this).GetDensity();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetShapeType()"/>
|
||||
public ShapeType GetShapeType() => ((Shape)this).GetShapeType();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSubType()"/>
|
||||
public ShapeSubType GetSubType() => ((Shape)this).GetSubType();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetUserData()"/>
|
||||
public ulong GetUserData() => ((Shape)this).GetUserData();
|
||||
|
||||
/// <inheritdoc cref="Shape.SetUserData(ulong)"/>
|
||||
public void SetUserData(ulong userData) => ((Shape)this).SetUserData(userData);
|
||||
|
||||
/// <inheritdoc cref="Shape.MustBeStatic()"/>
|
||||
public bool MustBeStatic() => ((Shape)this).MustBeStatic();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSubShapeIDBitsRecursive()"/>
|
||||
public uint GetSubShapeIDBitsRecursive() => ((Shape)this).GetSubShapeIDBitsRecursive();
|
||||
|
||||
/// <inheritdoc cref="Shape.GetWorldSpaceBounds(in float4x4, float3)"/>
|
||||
public AABox GetWorldSpaceBounds(in float4x4 centerOfMassTransform, float3 scale) =>
|
||||
((Shape)this).GetWorldSpaceBounds(in centerOfMassTransform, scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetWorldSpaceBounds(in double4x4, float3)"/>
|
||||
public AABox GetWorldSpaceBounds(in double4x4 centerOfMassTransform, float3 scale) =>
|
||||
((Shape)this).GetWorldSpaceBounds(in centerOfMassTransform, scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetLeafShape(uint, out uint)"/>
|
||||
public Shape GetLeafShape(uint subShapeID, out uint remainder) =>
|
||||
((Shape)this).GetLeafShape(subShapeID, out remainder);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetMaterial(uint)"/>
|
||||
public PhysicsMaterial GetMaterial(uint subShapeID) => ((Shape)this).GetMaterial(subShapeID);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSubShapeUserData(uint)"/>
|
||||
public ulong GetSubShapeUserData(uint subShapeID) => ((Shape)this).GetSubShapeUserData(subShapeID);
|
||||
|
||||
/// <inheritdoc cref="Shape.GetSubShapeTransformedShape(uint, float3, floatQuat, float3, out uint)"/>
|
||||
public TransformedShape GetSubShapeTransformedShape(
|
||||
uint subShapeID,
|
||||
float3 positionCOM,
|
||||
floatQuat rotation,
|
||||
float3 scale,
|
||||
out uint remainder
|
||||
) => ((Shape)this).GetSubShapeTransformedShape(subShapeID, positionCOM, rotation, scale, out remainder);
|
||||
|
||||
/// <inheritdoc cref="Shape.DrawGetSupportFunction(DebugRenderer, in float4x4, float3, uint, bool)"/>
|
||||
public void DrawGetSupportFunction(
|
||||
DebugRenderer renderer,
|
||||
in float4x4 centerOfMassTransform,
|
||||
float3 scale,
|
||||
uint color,
|
||||
bool drawSupportDirection
|
||||
) =>
|
||||
((Shape)this).DrawGetSupportFunction(
|
||||
renderer,
|
||||
in centerOfMassTransform,
|
||||
scale,
|
||||
color,
|
||||
drawSupportDirection
|
||||
);
|
||||
|
||||
/// <inheritdoc cref="Shape.DrawGetSupportingFace(DebugRenderer, in float4x4, float3)"/>
|
||||
public void DrawGetSupportingFace(DebugRenderer renderer, in float4x4 centerOfMassTransform, float3 scale) =>
|
||||
((Shape)this).DrawGetSupportingFace(renderer, in centerOfMassTransform, scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.CollectTransformedShapes(in AABox, float3, floatQuat, float3, SubShapeIDCreator, ShapeFilter)"/>
|
||||
public NativeHandleArray<TransformedShape> CollectTransformedShapes(
|
||||
in AABox box,
|
||||
float3 positionCOM,
|
||||
floatQuat rotation,
|
||||
float3 scale,
|
||||
SubShapeIDCreator subShapeIDCreator,
|
||||
ShapeFilter shapeFilter
|
||||
) =>
|
||||
((Shape)this).CollectTransformedShapes(
|
||||
in box,
|
||||
positionCOM,
|
||||
rotation,
|
||||
scale,
|
||||
subShapeIDCreator,
|
||||
shapeFilter
|
||||
);
|
||||
|
||||
/// <inheritdoc cref="Shape.TransformShape(in float4x4)"/>
|
||||
public NativeHandleArray<TransformedShape> TransformShape(in float4x4 centerOfMassTransform) =>
|
||||
((Shape)this).TransformShape(in centerOfMassTransform);
|
||||
|
||||
/// <inheritdoc cref="Shape.ScaleShape(float3)"/>
|
||||
public Shape ScaleShape(float3 scale) => ((Shape)this).ScaleShape(scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.SaveMaterialState()"/>
|
||||
public NativeArray<PhysicsMaterial> SaveMaterialState() => ((Shape)this).SaveMaterialState();
|
||||
|
||||
/// <inheritdoc cref="Shape.RestoreMaterialState(ReadOnlySpan{PhysicsMaterial})"/>
|
||||
public unsafe void RestoreMaterialState(ReadOnlySpan<PhysicsMaterial> materials) =>
|
||||
((Shape)this).RestoreMaterialState(materials);
|
||||
|
||||
/// <inheritdoc cref="Shape.SaveSubShapeState()"/>
|
||||
public NativeArray<Shape> SaveSubShapeState() => ((Shape)this).SaveSubShapeState();
|
||||
|
||||
/// <inheritdoc cref="Shape.RestoreSubShapeState(ReadOnlySpan{Shape})"/>
|
||||
public unsafe void RestoreSubShapeState(ReadOnlySpan<Shape> subShapes) =>
|
||||
((Shape)this).RestoreSubShapeState(subShapes);
|
||||
|
||||
/// <inheritdoc cref="Shape.SaveWithChildren(StreamOut, ShapeToIDMap, MaterialToIDMap)"/>
|
||||
public void SaveWithChildren(StreamOut stream, ShapeToIDMap shapeMap, MaterialToIDMap materialMap) =>
|
||||
((Shape)this).SaveWithChildren(stream, shapeMap, materialMap);
|
||||
|
||||
/// <inheritdoc cref="Shape.IsValidScale(float3)"/>
|
||||
public bool IsValidScale(float3 scale) => ((Shape)this).IsValidScale(scale);
|
||||
|
||||
/// <inheritdoc cref="Shape.MakeScaleValid(float3)"/>
|
||||
public float3 MakeScaleValid(float3 scale) => ((Shape)this).MakeScaleValid(scale);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue