//
// 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/CompoundShape.h:17
///
/// class CompoundShapeSettings : public ShapeSettings
///
///
///
///
/// Base class settings to construct a compound shape
///
///
[InteropHandle]
public readonly partial struct CompoundShapeSettings : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:31
///
/// struct SubShapeSettings
///
///
[StructLayout(LayoutKind.Explicit, Size = 64)]
public struct SubShapeSettings
{
///
///
/// Sub shape (either this or mShapePtr needs to be filled up)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:35
///
/// RefConst<ShapeSettings> mShape
///
///
[FieldOffset(0)]
public ShapeSettings mShape;
///
///
/// Sub shape (either this or mShape needs to be filled up)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:36
///
/// RefConst<Shape> mShapePtr
///
///
[FieldOffset(8)]
public Shape mShapePtr;
///
///
/// Position of the sub shape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:37
///
/// Vec3 mPosition
///
///
[FieldOffset(16)]
public float3 mPosition;
///
///
/// Rotation of the sub shape
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:38
///
/// Quat mRotation
///
///
[FieldOffset(32)]
public floatQuat mRotation;
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:43
///
/// uint32 mUserData = 0
///
///
///
///
/// User data value (can be used by the application for any purpose).
/// Note this value can be retrieved through GetSubShape(...).mUserData, not through GetSubShapeUserData(...) as that returns Shape::GetUserData() of the leaf shape.
/// Use GetSubShapeIndexFromID get a shape index from a SubShapeID to pass to GetSubShape.
///
///
[FieldOffset(48)]
public uint mUserData;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:19
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.CompoundShapeSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:19
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.CompoundShapeSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:26
///
/// void AddShape(Vec3Arg inPosition, QuatArg inRotation, const ShapeSettings *inShape, uint32 inUserData = 0)
///
///
///
///
/// Add a shape to the compound.
///
///
public void AddShape(float3 position, floatQuat rotation, ShapeSettings shape, uint userData) => Jolt.PInvoke.CompoundShapeSettings_AddShape(this, position, rotation, shape, userData);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:29
///
/// void AddShape(Vec3Arg inPosition, QuatArg inRotation, const Shape *inShape, uint32 inUserData = 0)
///
///
///
///
/// Add a shape to the compound. Variant that uses a concrete shape, which means this object cannot be
/// serialized.
///
///
public void AddShape(float3 position, floatQuat rotation, Shape shape, uint userData) => Jolt.PInvoke.CompoundShapeSettings_AddShape_2(this, position, rotation, shape, userData);
public void AddRef() => Jolt.PInvoke.CompoundShapeSettings_AddRef(this);
public void Release() => Jolt.PInvoke.CompoundShapeSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.CompoundShapeSettings_GetRefCount(this);
public static implicit operator ShapeSettings(CompoundShapeSettings value) => Jolt.PInvoke.CompoundShapeSettings_AsShapeSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}