//
// 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:52
///
/// class CompoundShape : public Shape
///
///
///
///
/// Base class for a compound shape
///
///
[InteropHandle]
public readonly partial struct CompoundShape : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:141
///
/// struct SubShape
///
///
[StructLayout(LayoutKind.Explicit, Size = 40)]
public struct SubShape
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:238
///
/// RefConst<Shape> mShape
///
///
[FieldOffset(0)]
public Shape mShape;
///
///
/// Note: Position of center of mass of sub shape!
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:239
///
/// Float3 mPositionCOM
///
///
[FieldOffset(8)]
public float3 mPositionCOM;
///
///
/// Note: X, Y, Z of rotation quaternion - note we read 4 bytes beyond this so make sure there's
/// something there
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:240
///
/// Float3 mRotation
///
///
[FieldOffset(20)]
public float3 mRotation;
///
///
/// User data value (put here because it falls in padding bytes)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:241
///
/// uint32 mUserData
///
///
[FieldOffset(32)]
public uint mUserData;
///
///
/// If mRotation is close to identity (put here because it falls in padding bytes)
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:242
///
/// bool mIsRotationIdentity
///
///
[FieldOffset(36)]
public Brutal.Bool8 mIsRotationIdentity;
}
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:62
///
/// virtual Vec3 GetCenterOfMass() const override
///
///
///
///
/// See Shape::GetCenterOfMass
///
///
public float3 GetCenterOfMass() => Jolt.PInvoke.CompoundShape_GetCenterOfMass(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:65
///
/// virtual bool MustBeStatic() const override
///
///
///
///
/// See Shape::MustBeStatic
///
///
public bool MustBeStatic() => Jolt.PInvoke.CompoundShape_MustBeStatic(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:71
///
/// virtual uint GetSubShapeIDBitsRecursive() const override
///
///
///
///
/// See Shape::GetSubShapeIDBitsRecursive
///
///
public uint GetSubShapeIDBitsRecursive() => Jolt.PInvoke.CompoundShape_GetSubShapeIDBitsRecursive(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:78
///
/// virtual float GetInnerRadius() const override
///
///
///
///
/// See Shape::GetInnerRadius
///
///
public float GetInnerRadius() => Jolt.PInvoke.CompoundShape_GetInnerRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:84
///
/// virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override
///
///
///
///
/// See Shape::GetMaterial
///
///
public PhysicsMaterial GetMaterial(uint subShapeID) => Jolt.PInvoke.CompoundShape_GetMaterial(this, subShapeID);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:87
///
/// virtual const Shape * GetLeafShape(const SubShapeID &inSubShapeID, SubShapeID &outRemainder) const override
///
///
///
///
/// See Shape::GetLeafShape
///
///
public Shape GetLeafShape(uint subShapeID, out uint remainder) => Jolt.PInvoke.CompoundShape_GetLeafShape(this, subShapeID, out remainder);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:90
///
/// virtual uint64 GetSubShapeUserData(const SubShapeID &inSubShapeID) const override
///
///
///
///
/// See Shape::GetSubShapeUserData
///
///
public ulong GetSubShapeUserData(uint subShapeID) => Jolt.PInvoke.CompoundShape_GetSubShapeUserData(this, subShapeID);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:96
///
/// virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const override
///
///
///
///
/// See Shape::GetSurfaceNormal
///
///
public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) => Jolt.PInvoke.CompoundShape_GetSurfaceNormal(this, subShapeID, localSurfacePosition);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:102
///
/// virtual void GetSubmergedVolume(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const Plane &inSurface, float &outTotalVolume, float &outSubmergedVolume, Vec3 &outCenterOfBuoyancy JPH_IF_DEBUG_RENDERER(, RVec3Arg inBaseOffset)) const override
///
///
///
///
/// See Shape::GetSubmergedVolume
///
///
public void GetSubmergedVolume(float4x4 centerOfMassTransform, float3 scale, Plane surface, out float totalVolume, out float submergedVolume, out float3 centerOfBuoyancy, float3 baseOffset) => Jolt.PInvoke.CompoundShape_GetSubmergedVolume(this, centerOfMassTransform, scale, surface, out totalVolume, out submergedVolume, out centerOfBuoyancy, baseOffset);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:106
///
/// virtual void Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const override
///
///
///
///
/// See Shape::Draw
///
///
public void Draw(DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, bool useMaterialColors, bool drawWireframe) => Jolt.PInvoke.CompoundShape_Draw(this, renderer, centerOfMassTransform, scale, color, useMaterialColors, drawWireframe);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:109
///
/// virtual void DrawGetSupportFunction(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inDrawSupportDirection) const override
///
///
///
///
/// See Shape::DrawGetSupportFunction
///
///
public void DrawGetSupportFunction(DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, bool drawSupportDirection) => Jolt.PInvoke.CompoundShape_DrawGetSupportFunction(this, renderer, centerOfMassTransform, scale, color, drawSupportDirection);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:112
///
/// virtual void DrawGetSupportingFace(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale) const override
///
///
///
///
/// See Shape::DrawGetSupportingFace
///
///
public void DrawGetSupportingFace(DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale) => Jolt.PInvoke.CompoundShape_DrawGetSupportingFace(this, renderer, centerOfMassTransform, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:116
///
/// virtual void CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const override
///
///
///
///
/// See: Shape::CollideSoftBodyVertices
///
///
public void CollideSoftBodyVertices(float4x4 centerOfMassTransform, float3 scale, CollideSoftBodyVertexIterator vertices, uint numVertices, int collidingShapeIndex) => Jolt.PInvoke.CompoundShape_CollideSoftBodyVertices(this, centerOfMassTransform, scale, vertices, numVertices, collidingShapeIndex);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:122
///
/// virtual void GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const override
///
///
///
///
/// See Shape::GetTrianglesStart
///
///
public void GetTrianglesStart(ref Shape.GetTrianglesContext context, AABox box, float3 positionCOM, floatQuat rotation, float3 scale) => Jolt.PInvoke.CompoundShape_GetTrianglesStart(this, ref context, box, positionCOM, rotation, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:132
///
/// virtual int GetIntersectingSubShapes(const AABox &inBox, uint *outSubShapeIndices, int inMaxSubShapeIndices) const = 0
///
///
///
///
/// Get which sub shape's bounding boxes overlap with an axis aligned box
/// @param inBox The axis aligned box to test against (relative to the center of mass of this shape)
/// @param outSubShapeIndices Buffer where to place the indices of the sub shapes that intersect
/// @param inMaxSubShapeIndices How many indices will fit in the buffer (normally you'd provide a buffer of GetNumSubShapes() indices)
/// @return How many indices were placed in outSubShapeIndices
///
///
public unsafe int GetIntersectingSubShapes(AABox box, Ptr subShapeIndices, int maxSubShapeIndices) => Jolt.PInvoke.CompoundShape_GetIntersectingSubShapes(this, box, subShapeIndices, maxSubShapeIndices);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:139
///
/// virtual int GetIntersectingSubShapes(const OrientedBox &inBox, uint *outSubShapeIndices, int inMaxSubShapeIndices) const = 0
///
///
///
///
/// Get which sub shape's bounding boxes overlap with an axis aligned box
/// @param inBox The axis aligned box to test against (relative to the center of mass of this shape)
/// @param outSubShapeIndices Buffer where to place the indices of the sub shapes that intersect
/// @param inMaxSubShapeIndices How many indices will fit in the buffer (normally you'd provide a buffer of GetNumSubShapes() indices)
/// @return How many indices were placed in outSubShapeIndices
///
///
public unsafe int GetIntersectingSubShapes(OrientedBox box, Ptr subShapeIndices, int maxSubShapeIndices) => Jolt.PInvoke.CompoundShape_GetIntersectingSubShapes_2(this, box, subShapeIndices, maxSubShapeIndices);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:254
///
/// uint GetNumSubShapes() const
///
///
///
///
/// Get the total number of sub shapes
///
///
public uint GetNumSubShapes() => Jolt.PInvoke.CompoundShape_GetNumSubShapes(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:260
///
/// uint32 GetCompoundUserData(uint inIdx) const
///
///
///
///
/// Get the user data associated with a shape in this compound
///
///
public uint GetCompoundUserData(uint idx) => Jolt.PInvoke.CompoundShape_GetCompoundUserData(this, idx);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:263
///
/// void SetCompoundUserData(uint inIdx, uint32 inUserData)
///
///
///
///
/// Set the user data associated with a shape in this compound
///
///
public void SetCompoundUserData(uint idx, uint userData) => Jolt.PInvoke.CompoundShape_SetCompoundUserData(this, idx, userData);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:268
///
/// inline bool IsSubShapeIDValid(SubShapeID inSubShapeID) const
///
///
///
///
/// Check if a sub shape ID is still valid for this shape
/// @param inSubShapeID Sub shape id that indicates the leaf shape relative to this shape
/// @return True if the ID is valid, false if not
///
///
public bool IsSubShapeIDValid(uint subShapeID) => Jolt.PInvoke.CompoundShape_IsSubShapeIDValid(this, subShapeID);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:278
///
/// inline uint32 GetSubShapeIndexFromID(SubShapeID inSubShapeID, SubShapeID &outRemainder) const
///
///
///
///
/// Convert SubShapeID to sub shape index
/// @param inSubShapeID Sub shape id that indicates the leaf shape relative to this shape
/// @param outRemainder This is the sub shape ID for the sub shape of the compound after popping off the index
/// @return The index of the sub shape of this compound
///
///
public uint GetSubShapeIndexFromID(uint subShapeID, out uint remainder) => Jolt.PInvoke.CompoundShape_GetSubShapeIndexFromID(this, subShapeID, out remainder);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:295
///
/// virtual void SaveBinaryState(StreamOut &inStream) const override
///
///
///
///
/// See Shape
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.CompoundShape_SaveBinaryState(this, stream);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:303
///
/// virtual float GetVolume() const override
///
///
///
///
/// See Shape::GetVolume
///
///
public float GetVolume() => Jolt.PInvoke.CompoundShape_GetVolume(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:306
///
/// virtual bool IsValidScale(Vec3Arg inScale) const override
///
///
///
///
/// See Shape::IsValidScale
///
///
public bool IsValidScale(float3 scale) => Jolt.PInvoke.CompoundShape_IsValidScale(this, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:309
///
/// virtual Vec3 MakeScaleValid(Vec3Arg inScale) const override
///
///
///
///
/// See Shape::MakeScaleValid
///
///
public float3 MakeScaleValid(float3 scale) => Jolt.PInvoke.CompoundShape_MakeScaleValid(this, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CompoundShape.h:312
///
/// static void sRegister()
///
///
///
///
/// Register shape functions with the registry
///
///
public static void sRegister() => Jolt.PInvoke.CompoundShape_sRegister();
public void AddRef() => Jolt.PInvoke.CompoundShape_AddRef(this);
public void Release() => Jolt.PInvoke.CompoundShape_Release(this);
public uint GetRefCount() => Jolt.PInvoke.CompoundShape_GetRefCount(this);
public static implicit operator Shape(CompoundShape value) => Jolt.PInvoke.CompoundShape_AsShape(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}