brutal/Brutal.Jolt/Generated/Classes/CompoundShapeSettings.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

197 lines
8.5 KiB
C#

// <auto-generated/>
// 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
{
/// <summary>
/// <para>
/// Base class settings to construct a compound shape
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L17">Jolt/Physics/Collision/Shape/CompoundShape.h:17</see>
/// <br/>
/// <c>class CompoundShapeSettings : public ShapeSettings</c>
/// </para>
/// </summary>
[InteropHandle]
public readonly partial struct CompoundShapeSettings : IDisposable
{
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L31">Jolt/Physics/Collision/Shape/CompoundShape.h:31</see>
/// <br/>
/// <c>struct SubShapeSettings</c>
/// </para>
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 64)]
public partial struct SubShapeSettings
{
/// <summary>
/// <para>
/// Sub shape (either this or mShapePtr needs to be filled up)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L35">Jolt/Physics/Collision/Shape/CompoundShape.h:35</see>
/// <br/>
/// <c>RefConst&lt;ShapeSettings&gt; mShape</c>
/// </para>
/// </summary>
[FieldOffset(0)]
public ShapeSettings Shape;
/// <summary>
/// <para>
/// Sub shape (either this or mShape needs to be filled up)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L36">Jolt/Physics/Collision/Shape/CompoundShape.h:36</see>
/// <br/>
/// <c>RefConst&lt;Shape&gt; mShapePtr</c>
/// </para>
/// </summary>
[FieldOffset(8)]
public Shape ShapePtr;
/// <summary>
/// <para>
/// Position of the sub shape
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L37">Jolt/Physics/Collision/Shape/CompoundShape.h:37</see>
/// <br/>
/// <c>Vec3 mPosition</c>
/// </para>
/// </summary>
[FieldOffset(16)]
public float3 Position;
/// <summary>
/// <para>
/// Rotation of the sub shape
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L38">Jolt/Physics/Collision/Shape/CompoundShape.h:38</see>
/// <br/>
/// <c>Quat mRotation</c>
/// </para>
/// </summary>
[FieldOffset(32)]
public floatQuat Rotation;
/// <summary>
/// <para>
/// 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.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L43">Jolt/Physics/Collision/Shape/CompoundShape.h:43</see>
/// <br/>
/// <c>uint32 mUserData = 0</c>
/// </para>
/// </summary>
[FieldOffset(48)]
public uint UserData;
}
/// <inheritdoc cref="ShapeSettings.GetRTTI()"/>
public RTTI GetRTTI() => ((ShapeSettings)this).GetRTTI();
/// <inheritdoc cref="ShapeSettings.CastTo(RTTI)"/>
public unsafe Ptr CastTo(RTTI rtti) => ((ShapeSettings)this).CastTo(rtti);
/// <summary>
/// <para>
/// Add a shape to the compound.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L26">Jolt/Physics/Collision/Shape/CompoundShape.h:26</see>
/// <br/>
/// <c>void AddShape(Vec3Arg inPosition, QuatArg inRotation, const ShapeSettings *inShape, uint32 inUserData = 0)</c>
/// </para>
/// </summary>
public void AddShape(float3 position, floatQuat rotation, ShapeSettings shape, uint userData = 0) =>
Jolt.PInvoke.CompoundShapeSettings_AddShape(this, position, rotation, shape, userData);
/// <summary>
/// <para>
/// Add a shape to the compound. Variant that uses a concrete shape, which means this object cannot be
/// serialized.
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L29">Jolt/Physics/Collision/Shape/CompoundShape.h:29</see>
/// <br/>
/// <c>void AddShape(Vec3Arg inPosition, QuatArg inRotation, const Shape *inShape, uint32 inUserData = 0)</c>
/// </para>
/// </summary>
public void AddShape(float3 position, floatQuat rotation, Shape shape, uint userData = 0) =>
Jolt.PInvoke.CompoundShapeSettings_AddShape_2(this, position, rotation, shape, userData);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/CompoundShape.h#L48">Jolt/Physics/Collision/Shape/CompoundShape.h:48</see>
/// <br/>
/// <c>SubShapes mSubShapes</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// The span is a view of the container's own storage, not a copy, so it costs nothing to take. It's only
/// valid until that container is resized or its owner is destroyed.
/// </para>
/// </remarks>
[return: Brutal.Attributes.Fixed]
public unsafe ReadOnlySpan<CompoundShapeSettings.SubShapeSettings> GetSubShapes()
{
Jolt.PInvoke.CompoundShapeSettings_GetSubShapes(this, out var _outResult);
return new ReadOnlySpan<CompoundShapeSettings.SubShapeSettings>(
(void*)_outResult.Data,
checked((int)_outResult.Count)
);
}
public void AddRef() => ((ShapeSettings)this).AddRef();
public void Release() => ((ShapeSettings)this).Release();
public uint GetRefCount() => ((ShapeSettings)this).GetRefCount();
public static implicit operator ShapeSettings(CompoundShapeSettings value) =>
Unsafe.BitCast<CompoundShapeSettings, ShapeSettings>(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
/// <inheritdoc cref="ShapeSettings.CreateShape()"/>
public Shape CreateShape() => ((ShapeSettings)this).CreateShape();
/// <inheritdoc cref="ShapeSettings.ClearCachedResult()"/>
public void ClearCachedResult() => ((ShapeSettings)this).ClearCachedResult();
/// <inheritdoc cref="ShapeSettings.GetUserData()"/>
public ulong GetUserData() => ((ShapeSettings)this).GetUserData();
/// <inheritdoc cref="ShapeSettings.SetUserData(ulong)"/>
public void SetUserData(ulong value) => ((ShapeSettings)this).SetUserData(value);
}
}