//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Class that constructs a CapsuleShape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:12
///
/// class CapsuleShapeSettings final : public ConvexShapeSettings
///
///
[InteropHandle]
public readonly partial struct CapsuleShapeSettings : IDisposable
{
///
///
/// Default constructor for deserialization
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:18
///
/// CapsuleShapeSettings() = default
///
///
public static CapsuleShapeSettings Create() => Jolt.PInvoke.CapsuleShapeSettings_Create();
///
///
/// Create a capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfCylinder, 0) and
/// the other at (0, inHalfHeightOfCylinder, 0)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:21
///
/// CapsuleShapeSettings(float inHalfHeightOfCylinder, float inRadius, const PhysicsMaterial *inMaterial = nullptr)
///
///
public static CapsuleShapeSettings Create(
float halfHeightOfCylinder,
float radius,
PhysicsMaterial material = default
) => Jolt.PInvoke.CapsuleShapeSettings_Create_2(halfHeightOfCylinder, radius, material);
///
public RTTI GetRTTI() => ((ShapeSettings)this).GetRTTI();
///
public unsafe Ptr CastTo(RTTI rtti) => ((ShapeSettings)this).CastTo(rtti);
///
///
/// Check if this is a valid capsule shape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:24
///
/// bool IsValid() const
///
///
public bool IsValid() => Jolt.PInvoke.CapsuleShapeSettings_IsValid(this);
///
///
/// Checks if the settings of this capsule make this shape a sphere
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:27
///
/// bool IsSphere() const
///
///
public bool IsSphere() => Jolt.PInvoke.CapsuleShapeSettings_IsSphere(this);
///
public Shape CreateShape() => ((ShapeSettings)this).CreateShape();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:33
///
/// float mRadius = 0.0f
///
///
public float GetRadius() => Jolt.PInvoke.CapsuleShapeSettings_GetRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:33
///
/// float mRadius = 0.0f
///
///
public void SetRadius(float value) => Jolt.PInvoke.CapsuleShapeSettings_SetRadius(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:34
///
/// float mHalfHeightOfCylinder = 0.0f
///
///
public float GetHalfHeightOfCylinder() => Jolt.PInvoke.CapsuleShapeSettings_GetHalfHeightOfCylinder(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:34
///
/// float mHalfHeightOfCylinder = 0.0f
///
///
public void SetHalfHeightOfCylinder(float value) =>
Jolt.PInvoke.CapsuleShapeSettings_SetHalfHeightOfCylinder(this, value);
public void AddRef() => ((ShapeSettings)this).AddRef();
public void Release() => ((ShapeSettings)this).Release();
public uint GetRefCount() => ((ShapeSettings)this).GetRefCount();
public static implicit operator ConvexShapeSettings(CapsuleShapeSettings value) =>
Unsafe.BitCast(value);
public static implicit operator ShapeSettings(CapsuleShapeSettings value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
///
public void SetDensity(float density) => ((ConvexShapeSettings)this).SetDensity(density);
///
public PhysicsMaterial GetMaterial() => ((ConvexShapeSettings)this).GetMaterial();
///
public void SetMaterial(PhysicsMaterial value) => ((ConvexShapeSettings)this).SetMaterial(value);
///
public float GetDensity() => ((ConvexShapeSettings)this).GetDensity();
///
public void ClearCachedResult() => ((ShapeSettings)this).ClearCachedResult();
///
public ulong GetUserData() => ((ShapeSettings)this).GetUserData();
///
public void SetUserData(ulong value) => ((ShapeSettings)this).SetUserData(value);
}
}