//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:12
///
/// class TriangleShapeSettings final : public ConvexShapeSettings
///
///
///
///
/// Class that constructs a TriangleShape
///
///
[InteropHandle]
public readonly partial struct TriangleShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:18
///
/// TriangleShapeSettings() = default
///
///
///
///
/// Default constructor for deserialization
///
///
public static TriangleShapeSettings Create() => Jolt.PInvoke.TriangleShapeSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:22
///
/// TriangleShapeSettings(Vec3Arg inV1, Vec3Arg inV2, Vec3Arg inV3, float inConvexRadius = 0.0f, const PhysicsMaterial *inMaterial = nullptr)
///
///
///
///
/// Create a triangle with points (inV1, inV2, inV3) (counter clockwise) and convex radius inConvexRadius.
/// Note that the convex radius is currently only used for shape vs shape collision, for all other purposes the triangle is infinitely thin.
///
///
public static TriangleShapeSettings Create(float3 v1, float3 v2, float3 v3, float convexRadius, PhysicsMaterial material) => Jolt.PInvoke.TriangleShapeSettings_Create_2(v1, v2, v3, convexRadius, material);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:14
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.TriangleShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:14
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.TriangleShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:25
///
/// virtual ShapeResult Create() const override
///
///
///
///
/// See: ShapeSettings
///
///
/// Throws InvalidOperationException with Jolt's error message when the operation fails.
///
///
public Shape CreateShape()
{
var _handle = Jolt.PInvoke.TriangleShapeSettings_CreateShape(this);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:27
///
/// Vec3 mV1
///
///
public float3 GetV1() => Jolt.PInvoke.TriangleShapeSettings_GetV1(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:27
///
/// Vec3 mV1
///
///
public void SetV1(float3 value) => Jolt.PInvoke.TriangleShapeSettings_SetV1(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:28
///
/// Vec3 mV2
///
///
public float3 GetV2() => Jolt.PInvoke.TriangleShapeSettings_GetV2(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:28
///
/// Vec3 mV2
///
///
public void SetV2(float3 value) => Jolt.PInvoke.TriangleShapeSettings_SetV2(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:29
///
/// Vec3 mV3
///
///
public float3 GetV3() => Jolt.PInvoke.TriangleShapeSettings_GetV3(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:29
///
/// Vec3 mV3
///
///
public void SetV3(float3 value) => Jolt.PInvoke.TriangleShapeSettings_SetV3(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:30
///
/// float mConvexRadius = 0.0f
///
///
public float GetConvexRadius() => Jolt.PInvoke.TriangleShapeSettings_GetConvexRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/TriangleShape.h:30
///
/// float mConvexRadius = 0.0f
///
///
public void SetConvexRadius(float value) => Jolt.PInvoke.TriangleShapeSettings_SetConvexRadius(this, value);
public void AddRef() => Jolt.PInvoke.TriangleShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.TriangleShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.TriangleShapeSettings_GetRefCount(this);
public static implicit operator ConvexShapeSettings(TriangleShapeSettings value) => Jolt.PInvoke.TriangleShapeSettings_AsConvexShapeSettings(value);
public static implicit operator ShapeSettings(TriangleShapeSettings value) => Jolt.PInvoke.TriangleShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}