// // 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/CapsuleShape.h:12 ///
/// class CapsuleShapeSettings final : public ConvexShapeSettings ///
///
/// /// /// Class that constructs a CapsuleShape /// /// [InteropHandle] public readonly partial struct CapsuleShapeSettings : IDisposable { /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:18 ///
/// CapsuleShapeSettings() = default ///
///
/// /// /// Default constructor for deserialization /// /// public static CapsuleShapeSettings Create() => Jolt.PInvoke.CapsuleShapeSettings_Create(); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:21 ///
/// CapsuleShapeSettings(float inHalfHeightOfCylinder, float inRadius, const PhysicsMaterial *inMaterial = nullptr) ///
///
/// /// /// Create a capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfCylinder, 0) and /// the other at (0, inHalfHeightOfCylinder, 0) /// /// public static CapsuleShapeSettings Create(float halfHeightOfCylinder, float radius, PhysicsMaterial material) => Jolt.PInvoke.CapsuleShapeSettings_Create_2(halfHeightOfCylinder, radius, material); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:14 ///
/// ///
///
/// /// /// The returned handle is borrowed from its owner; don't Dispose it. /// /// public RTTI GetRTTI() => Jolt.PInvoke.CapsuleShapeSettings_GetRTTI(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:14 ///
/// ///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.CapsuleShapeSettings_CastTo(this, rTTI); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:24 ///
/// bool IsValid() const ///
///
/// /// /// Check if this is a valid capsule shape /// /// public bool IsValid() => Jolt.PInvoke.CapsuleShapeSettings_IsValid(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:27 ///
/// bool IsSphere() const ///
///
/// /// /// Checks if the settings of this capsule make this shape a sphere /// /// public bool IsSphere() => Jolt.PInvoke.CapsuleShapeSettings_IsSphere(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:30 ///
/// 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.CapsuleShapeSettings_CreateShape(this); if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError()); return _handle; } /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:32 ///
/// float mRadius = 0.0f ///
///
public float GetRadius() => Jolt.PInvoke.CapsuleShapeSettings_GetRadius(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:32 ///
/// float mRadius = 0.0f ///
///
public void SetRadius(float value) => Jolt.PInvoke.CapsuleShapeSettings_SetRadius(this, value); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:33 ///
/// float mHalfHeightOfCylinder = 0.0f ///
///
public float GetHalfHeightOfCylinder() => Jolt.PInvoke.CapsuleShapeSettings_GetHalfHeightOfCylinder(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/CapsuleShape.h:33 ///
/// float mHalfHeightOfCylinder = 0.0f ///
///
public void SetHalfHeightOfCylinder(float value) => Jolt.PInvoke.CapsuleShapeSettings_SetHalfHeightOfCylinder(this, value); public void AddRef() => Jolt.PInvoke.CapsuleShapeSettings_AddRef(this); public void Release() => Jolt.PInvoke.CapsuleShapeSettings_Release(this); public uint GetRefCount() => Jolt.PInvoke.CapsuleShapeSettings_GetRefCount(this); public static implicit operator ConvexShapeSettings(CapsuleShapeSettings value) => Jolt.PInvoke.CapsuleShapeSettings_AsConvexShapeSettings(value); public static implicit operator ShapeSettings(CapsuleShapeSettings value) => Jolt.PInvoke.CapsuleShapeSettings_AsShapeSettings(value); public void Dispose() { if (IsNull()) return; Release(); } } }