//
// 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/SphereShape.h:12
///
/// class SphereShapeSettings final : public ConvexShapeSettings
///
///
///
///
/// Class that constructs a SphereShape
///
///
[InteropHandle]
public readonly partial struct SphereShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:18
///
/// SphereShapeSettings() = default
///
///
///
///
/// Default constructor for deserialization
///
///
public static SphereShapeSettings Create() => Jolt.PInvoke.SphereShapeSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:21
///
/// explicit SphereShapeSettings(float inRadius, const PhysicsMaterial *inMaterial = nullptr)
///
///
///
///
/// Create a sphere with radius inRadius
///
///
public static SphereShapeSettings Create(float radius, PhysicsMaterial material) => Jolt.PInvoke.SphereShapeSettings_Create_2(radius, material);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:14
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.SphereShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:14
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.SphereShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:24
///
/// 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.SphereShapeSettings_CreateShape(this);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:26
///
/// float mRadius = 0.0f
///
///
public float GetRadius() => Jolt.PInvoke.SphereShapeSettings_GetRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/SphereShape.h:26
///
/// float mRadius = 0.0f
///
///
public void SetRadius(float value) => Jolt.PInvoke.SphereShapeSettings_SetRadius(this, value);
public void AddRef() => Jolt.PInvoke.SphereShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.SphereShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.SphereShapeSettings_GetRefCount(this);
public static implicit operator ConvexShapeSettings(SphereShapeSettings value) => Jolt.PInvoke.SphereShapeSettings_AsConvexShapeSettings(value);
public static implicit operator ShapeSettings(SphereShapeSettings value) => Jolt.PInvoke.SphereShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}