//
// 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 can construct shapes and that is serializable using the ObjectStream system. Can be used to store
/// shape data in 'uncooked' form (i.e. in a form that is still human readable and authorable). Once the shape
/// has been created using the Create() function, the data will be moved into the Shape class in a form that is
/// optimized for collision detection. After this, the ShapeSettings object is no longer needed and can be
/// destroyed. Each shape class has a derived class of the ShapeSettings object to store shape specific data.
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:145
///
/// class ShapeSettings : public SerializableObject, public RefTarget<ShapeSettings>
///
///
[InteropHandle]
public readonly partial struct ShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:147
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.ShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:147
///
///
///
///
public unsafe Ptr CastTo(RTTI rtti) => Jolt.PInvoke.ShapeSettings_CastTo(this, rtti);
///
///
/// Create a shape according to the settings specified by this object.
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:153
///
/// virtual ShapeResult Create() const = 0
///
///
///
///
/// Throws JoltException with Jolt's error message when the operation fails.
///
///
public Shape CreateShape()
{
var _handle = Jolt.PInvoke.ShapeSettings_CreateShape(this);
if (_handle.IsNull())
throw JoltException.FromLastError();
return _handle;
}
///
///
/// When creating a shape, the result is cached so that calling Create() again will return the same shape.
/// If you make changes to the ShapeSettings you need to call this function to clear the cached result to
/// allow Create() to build a new shape.
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:157
///
/// void ClearCachedResult()
///
///
public void ClearCachedResult() => Jolt.PInvoke.ShapeSettings_ClearCachedResult(this);
///
///
/// User data (to be used freely by the application)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:160
///
/// uint64 mUserData = 0
///
///
public ulong GetUserData() => Jolt.PInvoke.ShapeSettings_GetUserData(this);
///
///
/// User data (to be used freely by the application)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/Shape.h:160
///
/// uint64 mUserData = 0
///
///
public void SetUserData(ulong value) => Jolt.PInvoke.ShapeSettings_SetUserData(this, value);
public void AddRef() => Jolt.PInvoke.ShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.ShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.ShapeSettings_GetRefCount(this);
public void Dispose()
{
if (IsNull())
return;
Release();
}
}
}