//
// 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 BoxShape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:13
///
/// class BoxShapeSettings final : public ConvexShapeSettings
///
///
[InteropHandle]
public readonly partial struct BoxShapeSettings : IDisposable
{
///
///
/// Default constructor for deserialization
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:19
///
/// BoxShapeSettings() = default
///
///
public static BoxShapeSettings Create() => Jolt.PInvoke.BoxShapeSettings_Create();
///
///
/// Create a box with half edge length inHalfExtent and convex radius inConvexRadius. (internally the convex
/// radius will be subtracted from the half extent so the total box will not grow with the convex radius).
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:23
///
/// explicit BoxShapeSettings(Vec3Arg inHalfExtent, float inConvexRadius = cDefaultConvexRadius, const PhysicsMaterial *inMaterial = nullptr)
///
///
public static BoxShapeSettings Create(
float3 halfExtent,
float convexRadius = 0.05f,
PhysicsMaterial material = default
) => Jolt.PInvoke.BoxShapeSettings_Create_2(halfExtent, convexRadius, material);
///
public RTTI GetRTTI() => ((ShapeSettings)this).GetRTTI();
///
public unsafe Ptr CastTo(RTTI rtti) => ((ShapeSettings)this).CastTo(rtti);
///
public Shape CreateShape() => ((ShapeSettings)this).CreateShape();
///
///
/// Half the size of the box (including convex radius)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:28
///
/// Vec3 mHalfExtent = Vec3::sZero()
///
///
public float3 GetHalfExtent() => Jolt.PInvoke.BoxShapeSettings_GetHalfExtent(this);
///
///
/// Half the size of the box (including convex radius)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:28
///
/// Vec3 mHalfExtent = Vec3::sZero()
///
///
public void SetHalfExtent(float3 value) => Jolt.PInvoke.BoxShapeSettings_SetHalfExtent(this, value);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:29
///
/// float mConvexRadius = 0.0f
///
///
public float GetConvexRadius() => Jolt.PInvoke.BoxShapeSettings_GetConvexRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/BoxShape.h:29
///
/// float mConvexRadius = 0.0f
///
///
public void SetConvexRadius(float value) => Jolt.PInvoke.BoxShapeSettings_SetConvexRadius(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(BoxShapeSettings value) =>
Unsafe.BitCast(value);
public static implicit operator ShapeSettings(BoxShapeSettings 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);
}
}