//
// 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/OffsetCenterOfMassShape.h:14
///
/// class OffsetCenterOfMassShapeSettings final : public DecoratedShapeSettings
///
///
///
///
/// Class that constructs an OffsetCenterOfMassShape
///
///
[InteropHandle]
public readonly partial struct OffsetCenterOfMassShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:20
///
/// OffsetCenterOfMassShapeSettings() = default
///
///
///
///
/// Constructor
///
///
public static OffsetCenterOfMassShapeSettings Create() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:23
///
/// OffsetCenterOfMassShapeSettings(Vec3Arg inOffset, const ShapeSettings *inShape)
///
///
///
///
/// Construct with shape settings, can be serialized.
///
///
public static OffsetCenterOfMassShapeSettings Create(float3 offset, ShapeSettings shape) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_Create_2(offset, shape);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:26
///
/// OffsetCenterOfMassShapeSettings(Vec3Arg inOffset, const Shape *inShape)
///
///
///
///
/// Variant that uses a concrete shape, which means this object cannot be serialized.
///
///
public static OffsetCenterOfMassShapeSettings Create(float3 offset, Shape shape) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_Create_3(offset, shape);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:16
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:16
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:29
///
/// 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.OffsetCenterOfMassShapeSettings_CreateShape(this);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
///
///
/// Offset to be applied to the center of mass of the child shape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:31
///
/// Vec3 mOffset
///
///
public float3 GetOffset() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_GetOffset(this);
///
///
/// Offset to be applied to the center of mass of the child shape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h:31
///
/// Vec3 mOffset
///
///
public void SetOffset(float3 value) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_SetOffset(this, value);
public void AddRef() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_GetRefCount(this);
public static implicit operator DecoratedShapeSettings(OffsetCenterOfMassShapeSettings value) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_AsDecoratedShapeSettings(value);
public static implicit operator ShapeSettings(OffsetCenterOfMassShapeSettings value) => Jolt.PInvoke.OffsetCenterOfMassShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}