mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
632 lines
30 KiB
C#
632 lines
30 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>
|
|
/// A compound shape, sub shapes can be rotated and translated. This shape is optimized for adding / removing
|
|
/// and changing the rotation / translation of sub shapes but is less efficient in querying. Shifts all child
|
|
/// objects so that they're centered around the center of mass (which needs to be kept up to date by calling
|
|
/// AdjustCenterOfMass).
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L32">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:32</see>
|
|
/// <br/>
|
|
/// <c>class MutableCompoundShape final : public CompoundShape</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// A compound shape, sub shapes can be rotated and translated.
|
|
/// This shape is optimized for adding / removing and changing the rotation / translation of sub shapes but is less efficient in querying.
|
|
/// Shifts all child objects so that they're centered around the center of mass (which needs to be kept up to date by calling AdjustCenterOfMass).
|
|
///
|
|
/// Note: If you're using MutableCompoundShape and are querying data while modifying the shape you'll have a race condition.
|
|
/// In this case it is best to create a new MutableCompoundShape using the Clone function. You replace the shape on a body using BodyInterface::SetShape.
|
|
/// If a query is still working on the old shape, it will have taken a reference and keep the old shape alive until the query finishes.
|
|
///
|
|
/// When you modify a MutableCompoundShape, beware that the SubShapeIDs of all other shapes can change. So be careful when storing SubShapeIDs.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct MutableCompoundShape : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L163">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:163</see>
|
|
/// <br/>
|
|
/// <c>struct Bounds</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 96)]
|
|
public partial struct Bounds
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L165">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:165</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMinX</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public float4 MinX;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L166">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:166</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMinY</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(16)]
|
|
public float4 MinY;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L167">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:167</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMinZ</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(32)]
|
|
public float4 MinZ;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L168">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:168</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMaxX</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(48)]
|
|
public float4 MaxX;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L169">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:169</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMaxY</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(64)]
|
|
public float4 MaxY;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L170">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:170</see>
|
|
/// <br/>
|
|
/// <c>Vec4 mMaxZ</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(80)]
|
|
public float4 MaxZ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L38">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:38</see>
|
|
/// <br/>
|
|
/// <c>MutableCompoundShape()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static MutableCompoundShape Create() => Jolt.PInvoke.MutableCompoundShape_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L39">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:39</see>
|
|
/// <br/>
|
|
/// <c>MutableCompoundShape(const MutableCompoundShapeSettings &inSettings, ShapeResult &outResult)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static MutableCompoundShape Create(MutableCompoundShapeSettings settings)
|
|
{
|
|
var _handle = Jolt.PInvoke.MutableCompoundShape_Create_2(settings);
|
|
if (_handle.IsNull())
|
|
throw JoltException.FromLastError();
|
|
return _handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Clone this shape. Can be used to avoid race conditions. See the documentation of this class for more
|
|
/// information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L42">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:42</see>
|
|
/// <br/>
|
|
/// <c>Ref<MutableCompoundShape> Clone() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle carries its own reference; Dispose it once when you're done.
|
|
/// </para>
|
|
/// </remarks>
|
|
public MutableCompoundShape Clone() => Jolt.PInvoke.MutableCompoundShape_Clone(this);
|
|
|
|
/// <inheritdoc cref="Shape.CastRay(in RayCast, SubShapeIDCreator, ref RayCastResult)"/>
|
|
public bool CastRay(in RayCast ray, SubShapeIDCreator subShapeIDCreator, ref RayCastResult hit) =>
|
|
((Shape)this).CastRay(in ray, subShapeIDCreator, ref hit);
|
|
|
|
/// <inheritdoc cref="Shape.CastRay(in RayCast, RayCastSettings, SubShapeIDCreator, Span{RayCastResult}, out uint, ShapeFilter)"/>
|
|
public unsafe uint CastRay(
|
|
in RayCast ray,
|
|
RayCastSettings rayCastSettings,
|
|
SubShapeIDCreator subShapeIDCreator,
|
|
Span<RayCastResult> results,
|
|
out uint totalHits,
|
|
ShapeFilter shapeFilter = default
|
|
) => ((Shape)this).CastRay(in ray, rayCastSettings, subShapeIDCreator, results, out totalHits, shapeFilter);
|
|
|
|
/// <inheritdoc cref="Shape.CastRayClosest(in RayCast, RayCastSettings, SubShapeIDCreator, out RayCastResult, ShapeFilter)"/>
|
|
public bool CastRayClosest(
|
|
in RayCast ray,
|
|
RayCastSettings rayCastSettings,
|
|
SubShapeIDCreator subShapeIDCreator,
|
|
out RayCastResult result,
|
|
ShapeFilter shapeFilter = default
|
|
) => ((Shape)this).CastRayClosest(in ray, rayCastSettings, subShapeIDCreator, out result, shapeFilter);
|
|
|
|
/// <inheritdoc cref="Shape.CollidePoint(float3, SubShapeIDCreator, Span{CollidePointResult}, out uint, ShapeFilter)"/>
|
|
public unsafe uint CollidePoint(
|
|
float3 point,
|
|
SubShapeIDCreator subShapeIDCreator,
|
|
Span<CollidePointResult> results,
|
|
out uint totalHits,
|
|
ShapeFilter shapeFilter = default
|
|
) => ((Shape)this).CollidePoint(point, subShapeIDCreator, results, out totalHits, shapeFilter);
|
|
|
|
/// <inheritdoc cref="Shape.CollectTransformedShapes(in AABox, float3, floatQuat, float3, SubShapeIDCreator, ShapeFilter)"/>
|
|
public NativeHandleArray<TransformedShape> CollectTransformedShapes(
|
|
in AABox box,
|
|
float3 positionCOM,
|
|
floatQuat rotation,
|
|
float3 scale,
|
|
SubShapeIDCreator subShapeIDCreator,
|
|
ShapeFilter shapeFilter
|
|
) =>
|
|
((Shape)this).CollectTransformedShapes(
|
|
in box,
|
|
positionCOM,
|
|
rotation,
|
|
scale,
|
|
subShapeIDCreator,
|
|
shapeFilter
|
|
);
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetIntersectingSubShapes(in AABox, Span{uint})"/>
|
|
public unsafe int GetIntersectingSubShapes(in AABox box, Span<uint> subShapeIndices) =>
|
|
((CompoundShape)this).GetIntersectingSubShapes(in box, subShapeIndices);
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetIntersectingSubShapes(OrientedBox, Span{uint})"/>
|
|
public unsafe int GetIntersectingSubShapes(OrientedBox box, Span<uint> subShapeIndices) =>
|
|
((CompoundShape)this).GetIntersectingSubShapes(box, subShapeIndices);
|
|
|
|
/// <inheritdoc cref="Shape.SaveBinaryState(StreamOut)"/>
|
|
public void SaveBinaryState(StreamOut stream) => ((Shape)this).SaveBinaryState(stream);
|
|
|
|
/// <inheritdoc cref="Shape.GetStats()"/>
|
|
public Shape.Stats GetStats() => ((Shape)this).GetStats();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Adding a new shape. Beware this can create a race condition if you're running collision queries in
|
|
/// parallel. See class documentation for more information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L77">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:77</see>
|
|
/// <br/>
|
|
/// <c>uint AddShape(Vec3Arg inPosition, QuatArg inRotation, const Shape *inShape, uint32 inUserData = 0, uint inIndex = UINT_MAX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Adding a new shape.
|
|
/// Beware this can create a race condition if you're running collision queries in parallel. See class documentation for more information.
|
|
/// @param inPosition The position of the new shape
|
|
/// @param inRotation The orientation of the new shape
|
|
/// @param inShape The shape to add
|
|
/// @param inUserData User data that will be stored with the shape and can be retrieved using GetCompoundUserData
|
|
/// @param inIndex Index where to insert the shape, UINT_MAX to add to the end
|
|
/// @return The index of the newly added shape
|
|
/// </code>
|
|
/// </remarks>
|
|
public uint AddShape(
|
|
float3 position,
|
|
floatQuat rotation,
|
|
Shape shape,
|
|
uint userData = 0,
|
|
uint index = uint.MaxValue
|
|
) => Jolt.PInvoke.MutableCompoundShape_AddShape(this, position, rotation, shape, userData, index);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Remove a shape by index. Beware this can create a race condition if you're running collision queries in
|
|
/// parallel. See class documentation for more information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L81">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:81</see>
|
|
/// <br/>
|
|
/// <c>void RemoveShape(uint inIndex)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void RemoveShape(uint index)
|
|
{
|
|
Jolt.PInvoke.MutableCompoundShape_RemoveShape(this, index, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of sub shapes."
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Modify the position / orientation of a shape. Beware this can create a race condition if you're running
|
|
/// collision queries in parallel. See class documentation for more information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L85">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:85</see>
|
|
/// <br/>
|
|
/// <c>void ModifyShape(uint inIndex, Vec3Arg inPosition, QuatArg inRotation)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void ModifyShape(uint index, float3 position, floatQuat rotation)
|
|
{
|
|
Jolt.PInvoke.MutableCompoundShape_ModifyShape(this, index, position, rotation, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of sub shapes."
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Modify the position / orientation and shape at the same time. Beware this can create a race condition if
|
|
/// you're running collision queries in parallel. See class documentation for more information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L89">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:89</see>
|
|
/// <br/>
|
|
/// <c>void ModifyShape(uint inIndex, Vec3Arg inPosition, QuatArg inRotation, const Shape *inShape)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void ModifyShape(uint index, float3 position, floatQuat rotation, Shape shape)
|
|
{
|
|
Jolt.PInvoke.MutableCompoundShape_ModifyShape_2(this, index, position, rotation, shape, out var _inRange);
|
|
if (_inRange == 0)
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(index),
|
|
index,
|
|
"Expected an index below the number of sub shapes."
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Recalculate the center of mass and shift all objects so they're centered around it (this needs to be
|
|
/// done of dynamic bodies and if the center of mass changes significantly due to adding / removing /
|
|
/// repositioning sub shapes or else the simulation will look unnatural) Note that after adjusting the
|
|
/// center of mass of an object you need to call BodyInterface::NotifyShapeChanged and
|
|
/// Constraint::NotifyShapeChanged on the relevant bodies / constraints. Beware this can create a race
|
|
/// condition if you're running collision queries in parallel. See class documentation for more information.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L105">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:105</see>
|
|
/// <br/>
|
|
/// <c>void AdjustCenterOfMass()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void AdjustCenterOfMass() => Jolt.PInvoke.MutableCompoundShape_AdjustCenterOfMass(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register shape functions with the registry
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/Shape/MutableCompoundShape.h#L110">Jolt/Physics/Collision/Shape/MutableCompoundShape.h:110</see>
|
|
/// <br/>
|
|
/// <c>static void sRegister()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Register() => Jolt.PInvoke.MutableCompoundShape_Register();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Moves and rotates positions.Length sub shapes starting at startIndex in one call, then recalculates the
|
|
/// bounds once - much cheaper than ModifyShape per sub shape. Positions are in the compound's own space, as
|
|
/// AddShape takes them (the centre of mass isn't moved), and each rotation must be normalized.
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void ModifyShapes(
|
|
uint startIndex,
|
|
ReadOnlySpan<float3> positions,
|
|
ReadOnlySpan<floatQuat> rotations
|
|
)
|
|
{
|
|
fixed (floatQuat* rotations_fixed = rotations)
|
|
fixed (float3* positions_fixed = positions)
|
|
{
|
|
if (rotations.Length != positions.Length)
|
|
throw new ArgumentException("Expected one rotation per position.", nameof(rotations));
|
|
if ((ulong)startIndex + (ulong)positions.Length > GetNumSubShapes())
|
|
throw new ArgumentOutOfRangeException(
|
|
nameof(positions),
|
|
positions.Length,
|
|
"startIndex plus the span length runs past the sub shapes."
|
|
);
|
|
Jolt.PInvoke.MutableCompoundShape_ModifyShapes(
|
|
this,
|
|
startIndex,
|
|
positions_fixed,
|
|
(nuint)positions.Length,
|
|
rotations_fixed,
|
|
(nuint)rotations.Length
|
|
);
|
|
}
|
|
}
|
|
|
|
public void AddRef() => ((Shape)this).AddRef();
|
|
|
|
public void Release() => ((Shape)this).Release();
|
|
|
|
public uint GetRefCount() => ((Shape)this).GetRefCount();
|
|
|
|
public static implicit operator CompoundShape(MutableCompoundShape value) =>
|
|
Unsafe.BitCast<MutableCompoundShape, CompoundShape>(value);
|
|
|
|
public static implicit operator Shape(MutableCompoundShape value) =>
|
|
Unsafe.BitCast<MutableCompoundShape, Shape>(value);
|
|
|
|
public void Dispose()
|
|
{
|
|
if (IsNull())
|
|
return;
|
|
Release();
|
|
}
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetSubShapes()"/>
|
|
[return: Brutal.Attributes.Fixed]
|
|
public unsafe ReadOnlySpan<CompoundShape.SubShape> GetSubShapes() => ((CompoundShape)this).GetSubShapes();
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetNumSubShapes()"/>
|
|
public uint GetNumSubShapes() => ((CompoundShape)this).GetNumSubShapes();
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetSubShape(uint)"/>
|
|
public CompoundShape.SubShape GetSubShape(uint idx) => ((CompoundShape)this).GetSubShape(idx);
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetCompoundUserData(uint)"/>
|
|
public uint GetCompoundUserData(uint idx) => ((CompoundShape)this).GetCompoundUserData(idx);
|
|
|
|
/// <inheritdoc cref="CompoundShape.SetCompoundUserData(uint, uint)"/>
|
|
public void SetCompoundUserData(uint idx, uint userData) =>
|
|
((CompoundShape)this).SetCompoundUserData(idx, userData);
|
|
|
|
/// <inheritdoc cref="CompoundShape.IsSubShapeIDValid(uint)"/>
|
|
public bool IsSubShapeIDValid(uint subShapeID) => ((CompoundShape)this).IsSubShapeIDValid(subShapeID);
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetSubShapeIndexFromID(uint, out uint)"/>
|
|
public uint GetSubShapeIndexFromID(uint subShapeID, out uint remainder) =>
|
|
((CompoundShape)this).GetSubShapeIndexFromID(subShapeID, out remainder);
|
|
|
|
/// <inheritdoc cref="CompoundShape.GetSubShapeIDFromIndex(int, SubShapeIDCreator)"/>
|
|
public SubShapeIDCreator GetSubShapeIDFromIndex(int idx, SubShapeIDCreator parentSubShapeID) =>
|
|
((CompoundShape)this).GetSubShapeIDFromIndex(idx, parentSubShapeID);
|
|
|
|
/// <inheritdoc cref="Shape.GetShapeType()"/>
|
|
public ShapeType GetShapeType() => ((Shape)this).GetShapeType();
|
|
|
|
/// <inheritdoc cref="Shape.GetSubType()"/>
|
|
public ShapeSubType GetSubType() => ((Shape)this).GetSubType();
|
|
|
|
/// <inheritdoc cref="Shape.GetUserData()"/>
|
|
public ulong GetUserData() => ((Shape)this).GetUserData();
|
|
|
|
/// <inheritdoc cref="Shape.SetUserData(ulong)"/>
|
|
public void SetUserData(ulong userData) => ((Shape)this).SetUserData(userData);
|
|
|
|
/// <inheritdoc cref="Shape.MustBeStatic()"/>
|
|
public bool MustBeStatic() => ((Shape)this).MustBeStatic();
|
|
|
|
/// <inheritdoc cref="Shape.GetCenterOfMass()"/>
|
|
public float3 GetCenterOfMass() => ((Shape)this).GetCenterOfMass();
|
|
|
|
/// <inheritdoc cref="Shape.GetLocalBounds()"/>
|
|
public AABox GetLocalBounds() => ((Shape)this).GetLocalBounds();
|
|
|
|
/// <inheritdoc cref="Shape.GetSubShapeIDBitsRecursive()"/>
|
|
public uint GetSubShapeIDBitsRecursive() => ((Shape)this).GetSubShapeIDBitsRecursive();
|
|
|
|
/// <inheritdoc cref="Shape.GetWorldSpaceBounds(in float4x4, float3)"/>
|
|
public AABox GetWorldSpaceBounds(in float4x4 centerOfMassTransform, float3 scale) =>
|
|
((Shape)this).GetWorldSpaceBounds(in centerOfMassTransform, scale);
|
|
|
|
/// <inheritdoc cref="Shape.GetWorldSpaceBounds(in double4x4, float3)"/>
|
|
public AABox GetWorldSpaceBounds(in double4x4 centerOfMassTransform, float3 scale) =>
|
|
((Shape)this).GetWorldSpaceBounds(in centerOfMassTransform, scale);
|
|
|
|
/// <inheritdoc cref="Shape.GetInnerRadius()"/>
|
|
public float GetInnerRadius() => ((Shape)this).GetInnerRadius();
|
|
|
|
/// <inheritdoc cref="Shape.GetMassProperties()"/>
|
|
public MassProperties GetMassProperties() => ((Shape)this).GetMassProperties();
|
|
|
|
/// <inheritdoc cref="Shape.GetLeafShape(uint, out uint)"/>
|
|
public Shape GetLeafShape(uint subShapeID, out uint remainder) =>
|
|
((Shape)this).GetLeafShape(subShapeID, out remainder);
|
|
|
|
/// <inheritdoc cref="Shape.GetMaterial(uint)"/>
|
|
public PhysicsMaterial GetMaterial(uint subShapeID) => ((Shape)this).GetMaterial(subShapeID);
|
|
|
|
/// <inheritdoc cref="Shape.GetSurfaceNormal(uint, float3)"/>
|
|
public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) =>
|
|
((Shape)this).GetSurfaceNormal(subShapeID, localSurfacePosition);
|
|
|
|
/// <inheritdoc cref="Shape.GetSupportingFace(uint, float3, float3, in float4x4, out StaticArrayVec3_32)"/>
|
|
public void GetSupportingFace(
|
|
uint subShapeID,
|
|
float3 direction,
|
|
float3 scale,
|
|
in float4x4 centerOfMassTransform,
|
|
out StaticArrayVec3_32 vertices
|
|
) => ((Shape)this).GetSupportingFace(subShapeID, direction, scale, in centerOfMassTransform, out vertices);
|
|
|
|
/// <inheritdoc cref="Shape.GetSubShapeUserData(uint)"/>
|
|
public ulong GetSubShapeUserData(uint subShapeID) => ((Shape)this).GetSubShapeUserData(subShapeID);
|
|
|
|
/// <inheritdoc cref="Shape.GetSubShapeTransformedShape(uint, float3, floatQuat, float3, out uint)"/>
|
|
public TransformedShape GetSubShapeTransformedShape(
|
|
uint subShapeID,
|
|
float3 positionCOM,
|
|
floatQuat rotation,
|
|
float3 scale,
|
|
out uint remainder
|
|
) => ((Shape)this).GetSubShapeTransformedShape(subShapeID, positionCOM, rotation, scale, out remainder);
|
|
|
|
/// <inheritdoc cref="Shape.GetSubmergedVolume(in float4x4, float3, in Plane, out float, out float, out float3, float3)"/>
|
|
public void GetSubmergedVolume(
|
|
in float4x4 centerOfMassTransform,
|
|
float3 scale,
|
|
in Plane surface,
|
|
out float totalVolume,
|
|
out float submergedVolume,
|
|
out float3 centerOfBuoyancy,
|
|
float3 baseOffset
|
|
) =>
|
|
((Shape)this).GetSubmergedVolume(
|
|
in centerOfMassTransform,
|
|
scale,
|
|
in surface,
|
|
out totalVolume,
|
|
out submergedVolume,
|
|
out centerOfBuoyancy,
|
|
baseOffset
|
|
);
|
|
|
|
/// <inheritdoc cref="Shape.Draw(DebugRenderer, in float4x4, float3, uint, bool, bool)"/>
|
|
public void Draw(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
float3 scale,
|
|
uint color,
|
|
bool useMaterialColors,
|
|
bool drawWireframe
|
|
) => ((Shape)this).Draw(renderer, in centerOfMassTransform, scale, color, useMaterialColors, drawWireframe);
|
|
|
|
/// <inheritdoc cref="Shape.DrawGetSupportFunction(DebugRenderer, in float4x4, float3, uint, bool)"/>
|
|
public void DrawGetSupportFunction(
|
|
DebugRenderer renderer,
|
|
in float4x4 centerOfMassTransform,
|
|
float3 scale,
|
|
uint color,
|
|
bool drawSupportDirection
|
|
) =>
|
|
((Shape)this).DrawGetSupportFunction(
|
|
renderer,
|
|
in centerOfMassTransform,
|
|
scale,
|
|
color,
|
|
drawSupportDirection
|
|
);
|
|
|
|
/// <inheritdoc cref="Shape.DrawGetSupportingFace(DebugRenderer, in float4x4, float3)"/>
|
|
public void DrawGetSupportingFace(DebugRenderer renderer, in float4x4 centerOfMassTransform, float3 scale) =>
|
|
((Shape)this).DrawGetSupportingFace(renderer, in centerOfMassTransform, scale);
|
|
|
|
/// <inheritdoc cref="Shape.CollideSoftBodyVertices(in float4x4, float3, CollideSoftBodyVertexIterator, uint, int)"/>
|
|
public void CollideSoftBodyVertices(
|
|
in float4x4 centerOfMassTransform,
|
|
float3 scale,
|
|
CollideSoftBodyVertexIterator vertices,
|
|
uint numVertices,
|
|
int collidingShapeIndex
|
|
) =>
|
|
((Shape)this).CollideSoftBodyVertices(
|
|
in centerOfMassTransform,
|
|
scale,
|
|
vertices,
|
|
numVertices,
|
|
collidingShapeIndex
|
|
);
|
|
|
|
/// <inheritdoc cref="Shape.TransformShape(in float4x4)"/>
|
|
public NativeHandleArray<TransformedShape> TransformShape(in float4x4 centerOfMassTransform) =>
|
|
((Shape)this).TransformShape(in centerOfMassTransform);
|
|
|
|
/// <inheritdoc cref="Shape.ScaleShape(float3)"/>
|
|
public Shape ScaleShape(float3 scale) => ((Shape)this).ScaleShape(scale);
|
|
|
|
/// <inheritdoc cref="Shape.GetTrianglesStart(ref Shape.GetTrianglesContext, in AABox, float3, floatQuat, float3)"/>
|
|
public void GetTrianglesStart(
|
|
ref Shape.GetTrianglesContext context,
|
|
in AABox box,
|
|
float3 positionCOM,
|
|
floatQuat rotation,
|
|
float3 scale
|
|
) => ((Shape)this).GetTrianglesStart(ref context, in box, positionCOM, rotation, scale);
|
|
|
|
/// <inheritdoc cref="Shape.GetTrianglesNext(ref Shape.GetTrianglesContext, int, Ptr{float3}, Ptr{PhysicsMaterial})"/>
|
|
public unsafe int GetTrianglesNext(
|
|
ref Shape.GetTrianglesContext context,
|
|
int maxTrianglesRequested,
|
|
Ptr<float3> triangleVertices,
|
|
Ptr<PhysicsMaterial> materials = default
|
|
) => ((Shape)this).GetTrianglesNext(ref context, maxTrianglesRequested, triangleVertices, materials);
|
|
|
|
/// <inheritdoc cref="Shape.SaveMaterialState()"/>
|
|
public NativeArray<PhysicsMaterial> SaveMaterialState() => ((Shape)this).SaveMaterialState();
|
|
|
|
/// <inheritdoc cref="Shape.RestoreMaterialState(ReadOnlySpan{PhysicsMaterial})"/>
|
|
public unsafe void RestoreMaterialState(ReadOnlySpan<PhysicsMaterial> materials) =>
|
|
((Shape)this).RestoreMaterialState(materials);
|
|
|
|
/// <inheritdoc cref="Shape.SaveSubShapeState()"/>
|
|
public NativeArray<Shape> SaveSubShapeState() => ((Shape)this).SaveSubShapeState();
|
|
|
|
/// <inheritdoc cref="Shape.RestoreSubShapeState(ReadOnlySpan{Shape})"/>
|
|
public unsafe void RestoreSubShapeState(ReadOnlySpan<Shape> subShapes) =>
|
|
((Shape)this).RestoreSubShapeState(subShapes);
|
|
|
|
/// <inheritdoc cref="Shape.SaveWithChildren(StreamOut, ShapeToIDMap, MaterialToIDMap)"/>
|
|
public void SaveWithChildren(StreamOut stream, ShapeToIDMap shapeMap, MaterialToIDMap materialMap) =>
|
|
((Shape)this).SaveWithChildren(stream, shapeMap, materialMap);
|
|
|
|
/// <inheritdoc cref="Shape.GetVolume()"/>
|
|
public float GetVolume() => ((Shape)this).GetVolume();
|
|
|
|
/// <inheritdoc cref="Shape.IsValidScale(float3)"/>
|
|
public bool IsValidScale(float3 scale) => ((Shape)this).IsValidScale(scale);
|
|
|
|
/// <inheritdoc cref="Shape.MakeScaleValid(float3)"/>
|
|
public float3 MakeScaleValid(float3 scale) => ((Shape)this).MakeScaleValid(scale);
|
|
}
|
|
}
|