//
// 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/CylinderShape.h:13
///
/// class CylinderShapeSettings final : public ConvexShapeSettings
///
///
///
///
/// Class that constructs a CylinderShape
///
///
[InteropHandle]
public readonly partial struct CylinderShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:19
///
/// CylinderShapeSettings() = default
///
///
///
///
/// Default constructor for deserialization
///
///
public static CylinderShapeSettings Create() => Jolt.PInvoke.CylinderShapeSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:23
///
/// CylinderShapeSettings(float inHalfHeight, float inRadius, float inConvexRadius = cDefaultConvexRadius, const PhysicsMaterial *inMaterial = nullptr)
///
///
///
///
/// Create a shape centered around the origin with one top at (0, -inHalfHeight, 0) and the other at (0, inHalfHeight, 0) and radius inRadius.
/// (internally the convex radius will be subtracted from the cylinder the total cylinder will not grow with the convex radius, but the edges of the cylinder will be rounded a bit).
///
///
public static CylinderShapeSettings Create(float halfHeight, float radius, float convexRadius, PhysicsMaterial material) => Jolt.PInvoke.CylinderShapeSettings_Create_2(halfHeight, radius, convexRadius, material);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:15
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.CylinderShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:15
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.CylinderShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:26
///
/// 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.CylinderShapeSettings_CreateShape(this);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:28
///
/// float mHalfHeight = 0.0f
///
///
public float GetHalfHeight() => Jolt.PInvoke.CylinderShapeSettings_GetHalfHeight(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:28
///
/// float mHalfHeight = 0.0f
///
///
public void SetHalfHeight(float value) => Jolt.PInvoke.CylinderShapeSettings_SetHalfHeight(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:29
///
/// float mRadius = 0.0f
///
///
public float GetRadius() => Jolt.PInvoke.CylinderShapeSettings_GetRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:29
///
/// float mRadius = 0.0f
///
///
public void SetRadius(float value) => Jolt.PInvoke.CylinderShapeSettings_SetRadius(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:30
///
/// float mConvexRadius = 0.0f
///
///
public float GetConvexRadius() => Jolt.PInvoke.CylinderShapeSettings_GetConvexRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CylinderShape.h:30
///
/// float mConvexRadius = 0.0f
///
///
public void SetConvexRadius(float value) => Jolt.PInvoke.CylinderShapeSettings_SetConvexRadius(this, value);
public void AddRef() => Jolt.PInvoke.CylinderShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.CylinderShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.CylinderShapeSettings_GetRefCount(this);
public static implicit operator ConvexShapeSettings(CylinderShapeSettings value) => Jolt.PInvoke.CylinderShapeSettings_AsConvexShapeSettings(value);
public static implicit operator ShapeSettings(CylinderShapeSettings value) => Jolt.PInvoke.CylinderShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}