mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
278 lines
14 KiB
C#
278 lines
14 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L22">Jolt/Physics/Collision/Shape/MeshShape.h:22</see>
|
|
/// <br/>
|
|
/// <c>class MeshShapeSettings final : public ShapeSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Class that constructs a MeshShape
|
|
/// </para>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct MeshShapeSettings : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L71">Jolt/Physics/Collision/Shape/MeshShape.h:71</see>
|
|
/// <br/>
|
|
/// <c>enum class EBuildQuality</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public enum EBuildQuality : int
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Favor runtime performance, takes more time to build the MeshShape but performs better
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L73">Jolt/Physics/Collision/Shape/MeshShape.h:73</see>
|
|
/// <br/>
|
|
/// <c>FavorRuntimePerformance</c>
|
|
/// </para>
|
|
/// </summary>
|
|
FavorRuntimePerformance,
|
|
/// <summary>
|
|
/// <para>
|
|
/// Favor build speed, build the tree faster but the MeshShape will be slower
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L74">Jolt/Physics/Collision/Shape/MeshShape.h:74</see>
|
|
/// <br/>
|
|
/// <c>FavorBuildSpeed</c>
|
|
/// </para>
|
|
/// </summary>
|
|
FavorBuildSpeed,
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L28">Jolt/Physics/Collision/Shape/MeshShape.h:28</see>
|
|
/// <br/>
|
|
/// <c>MeshShapeSettings() = default</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Default constructor for deserialization
|
|
/// </para>
|
|
/// </remarks>
|
|
public static MeshShapeSettings Create() => Jolt.PInvoke.MeshShapeSettings_Create();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L24">Jolt/Physics/Collision/Shape/MeshShape.h:24</see>
|
|
/// <br/>
|
|
/// <c></c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public RTTI GetRTTI() => Jolt.PInvoke.MeshShapeSettings_GetRTTI(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L24">Jolt/Physics/Collision/Shape/MeshShape.h:24</see>
|
|
/// <br/>
|
|
/// <c></c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.MeshShapeSettings_CastTo(this, rTTI);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L35">Jolt/Physics/Collision/Shape/MeshShape.h:35</see>
|
|
/// <br/>
|
|
/// <c>void Sanitize()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Sanitize the mesh data. Remove duplicate and degenerate triangles. This is called automatically when
|
|
/// constructing the MeshShapeSettings with a list of (indexed-) triangles.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Sanitize() => Jolt.PInvoke.MeshShapeSettings_Sanitize(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L38">Jolt/Physics/Collision/Shape/MeshShape.h:38</see>
|
|
/// <br/>
|
|
/// <c>virtual ShapeResult Create() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See: ShapeSettings
|
|
/// </para>
|
|
/// <para>
|
|
/// Throws InvalidOperationException with Jolt's error message when the operation fails.
|
|
/// </para>
|
|
/// </remarks>
|
|
public Shape CreateShape()
|
|
{
|
|
var _handle = Jolt.PInvoke.MeshShapeSettings_CreateShape(this);
|
|
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
|
|
return _handle;
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L56">Jolt/Physics/Collision/Shape/MeshShape.h:56</see>
|
|
/// <br/>
|
|
/// <c>uint mMaxTrianglesPerLeaf = 8</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Maximum number of triangles in each leaf of the axis aligned box tree. This is a balance between memory and performance. Can be in the range [1, MeshShape::MaxTrianglesPerLeaf].
|
|
/// Sensible values are between 4 (for better performance) and 8 (for less memory usage).
|
|
/// </code>
|
|
/// </remarks>
|
|
public uint GetMaxTrianglesPerLeaf() => Jolt.PInvoke.MeshShapeSettings_GetMaxTrianglesPerLeaf(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L56">Jolt/Physics/Collision/Shape/MeshShape.h:56</see>
|
|
/// <br/>
|
|
/// <c>uint mMaxTrianglesPerLeaf = 8</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Maximum number of triangles in each leaf of the axis aligned box tree. This is a balance between memory and performance. Can be in the range [1, MeshShape::MaxTrianglesPerLeaf].
|
|
/// Sensible values are between 4 (for better performance) and 8 (for less memory usage).
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetMaxTrianglesPerLeaf(uint value) => Jolt.PInvoke.MeshShapeSettings_SetMaxTrianglesPerLeaf(this, value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// cos(5 degrees)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L63">Jolt/Physics/Collision/Shape/MeshShape.h:63</see>
|
|
/// <br/>
|
|
/// <c>float mActiveEdgeCosThresholdAngle = 0.996195f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Cosine of the threshold angle (if the angle between the two triangles is bigger than this, the edge is active, note that a concave edge is always inactive).
|
|
/// Setting this value too small can cause ghost collisions with edges, setting it too big can cause depenetration artifacts (objects not depenetrating quickly).
|
|
/// Valid ranges are between cos(0 degrees) and cos(90 degrees). The default value is cos(5 degrees).
|
|
/// Negative values will make all edges active and causes EActiveEdgeMode::CollideOnlyWithActive to behave as EActiveEdgeMode::CollideWithAll.
|
|
/// This speeds up the build process but will require all bodies that can interact with the mesh to use BodyCreationSettings::mEnhancedInternalEdgeRemoval = true.
|
|
/// </code>
|
|
/// </remarks>
|
|
public float GetActiveEdgeCosThresholdAngle() => Jolt.PInvoke.MeshShapeSettings_GetActiveEdgeCosThresholdAngle(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// cos(5 degrees)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L63">Jolt/Physics/Collision/Shape/MeshShape.h:63</see>
|
|
/// <br/>
|
|
/// <c>float mActiveEdgeCosThresholdAngle = 0.996195f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Cosine of the threshold angle (if the angle between the two triangles is bigger than this, the edge is active, note that a concave edge is always inactive).
|
|
/// Setting this value too small can cause ghost collisions with edges, setting it too big can cause depenetration artifacts (objects not depenetrating quickly).
|
|
/// Valid ranges are between cos(0 degrees) and cos(90 degrees). The default value is cos(5 degrees).
|
|
/// Negative values will make all edges active and causes EActiveEdgeMode::CollideOnlyWithActive to behave as EActiveEdgeMode::CollideWithAll.
|
|
/// This speeds up the build process but will require all bodies that can interact with the mesh to use BodyCreationSettings::mEnhancedInternalEdgeRemoval = true.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetActiveEdgeCosThresholdAngle(float value) => Jolt.PInvoke.MeshShapeSettings_SetActiveEdgeCosThresholdAngle(this, value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L69">Jolt/Physics/Collision/Shape/MeshShape.h:69</see>
|
|
/// <br/>
|
|
/// <c>bool mPerTriangleUserData = false</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// When true, we store the user data coming from Triangle::mUserData or IndexedTriangle::mUserData in the mesh shape.
|
|
/// This can be used to store additional data like the original index of the triangle in the mesh.
|
|
/// Can be retrieved using MeshShape::GetTriangleUserData.
|
|
/// Turning this on increases the memory used by the MeshShape by roughly 25%.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool GetPerTriangleUserData() => Jolt.PInvoke.MeshShapeSettings_GetPerTriangleUserData(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L69">Jolt/Physics/Collision/Shape/MeshShape.h:69</see>
|
|
/// <br/>
|
|
/// <c>bool mPerTriangleUserData = false</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// When true, we store the user data coming from Triangle::mUserData or IndexedTriangle::mUserData in the mesh shape.
|
|
/// This can be used to store additional data like the original index of the triangle in the mesh.
|
|
/// Can be retrieved using MeshShape::GetTriangleUserData.
|
|
/// Turning this on increases the memory used by the MeshShape by roughly 25%.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetPerTriangleUserData(bool value) => Jolt.PInvoke.MeshShapeSettings_SetPerTriangleUserData(this, value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L78">Jolt/Physics/Collision/Shape/MeshShape.h:78</see>
|
|
/// <br/>
|
|
/// <c>EBuildQuality mBuildQuality = EBuildQuality::FavorRuntimePerformance</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Determines the quality of the tree building process.
|
|
/// </para>
|
|
/// </remarks>
|
|
public MeshShapeSettings.EBuildQuality GetBuildQuality() => Jolt.PInvoke.MeshShapeSettings_GetBuildQuality(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/MeshShape.h#L78">Jolt/Physics/Collision/Shape/MeshShape.h:78</see>
|
|
/// <br/>
|
|
/// <c>EBuildQuality mBuildQuality = EBuildQuality::FavorRuntimePerformance</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Determines the quality of the tree building process.
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetBuildQuality(MeshShapeSettings.EBuildQuality value) => Jolt.PInvoke.MeshShapeSettings_SetBuildQuality(this, value);
|
|
public void AddRef() => Jolt.PInvoke.MeshShapeSettings_AddRef(this);
|
|
public void Release() => Jolt.PInvoke.MeshShapeSettings_Release(this);
|
|
public uint GetRefCount() => Jolt.PInvoke.MeshShapeSettings_GetRefCount(this);
|
|
public static implicit operator ShapeSettings(MeshShapeSettings value) => Jolt.PInvoke.MeshShapeSettings_AsShapeSettings(value);
|
|
public void Dispose()
|
|
{
|
|
if (IsNull()) return;
|
|
Release();
|
|
}
|
|
}
|
|
}
|