//
// 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/StaticCompoundShape.h:17
///
/// class StaticCompoundShapeSettings final : public CompoundShapeSettings
///
///
///
///
/// Class that constructs a StaticCompoundShape. Note that if you only want a compound of 1 shape, use a
/// RotatedTranslatedShape instead.
///
///
[InteropHandle]
public readonly partial struct StaticCompoundShapeSettings : IDisposable
{
public static StaticCompoundShapeSettings Create() => Jolt.PInvoke.StaticCompoundShapeSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/StaticCompoundShape.h:19
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.StaticCompoundShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/StaticCompoundShape.h:19
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.StaticCompoundShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/StaticCompoundShape.h:23
///
/// 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.StaticCompoundShapeSettings_CreateShape(this);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/StaticCompoundShape.h:26
///
/// ShapeResult Create(TempAllocator &inTempAllocator) const
///
///
///
///
/// Specialization of Create() function that allows specifying a temp allocator to avoid temporary memory
/// allocations on the heap
///
///
/// Throws InvalidOperationException with Jolt's error message when the operation fails.
///
///
public Shape CreateShape(TempAllocator tempAllocator)
{
var _handle = Jolt.PInvoke.StaticCompoundShapeSettings_CreateShape_2(this, tempAllocator);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
public void AddRef() => Jolt.PInvoke.StaticCompoundShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.StaticCompoundShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.StaticCompoundShapeSettings_GetRefCount(this);
public static implicit operator CompoundShapeSettings(StaticCompoundShapeSettings value) => Jolt.PInvoke.StaticCompoundShapeSettings_AsCompoundShapeSettings(value);
public static implicit operator ShapeSettings(StaticCompoundShapeSettings value) => Jolt.PInvoke.StaticCompoundShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}