// // 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/MeshShape.h:84 ///
/// class MeshShape final : public Shape ///
///
/// /// /// A mesh shape, consisting of triangles. Mesh shapes are mostly used for static geometry. /// They can be used by dynamic or kinematic objects but only if they don't collide with other mesh or heightfield shapes as those collisions are currently not supported. /// Note that if you make a mesh shape a dynamic or kinematic object, you need to provide a mass yourself as mesh shapes don't need to form a closed hull so don't have a well defined volume from which the mass can be calculated. /// /// [InteropHandle] public readonly partial struct MeshShape : IDisposable { /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:209 ///
/// enum ETriangleFlags ///
///
/// /// /// 8 bit flags stored per triangle /// /// public enum ETriangleFlags : int { /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:212 ///
/// FLAGS_MATERIAL_BITS = 5 ///
///
/// /// /// Material index /// /// FLAGS_MATERIAL_BITS = 5, /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:213 ///
/// FLAGS_MATERIAL_MASK = (1 << FLAGS_MATERIAL_BITS) - 1 ///
///
FLAGS_MATERIAL_MASK = (1 << FLAGS_MATERIAL_BITS) - 1, /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:216 ///
/// FLAGS_ACTIVE_EGDE_SHIFT = FLAGS_MATERIAL_BITS ///
///
/// /// /// Active edge bits /// /// FLAGS_ACTIVE_EGDE_SHIFT = FLAGS_MATERIAL_BITS, /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:217 ///
/// FLAGS_ACTIVE_EDGE_BITS = 3 ///
///
FLAGS_ACTIVE_EDGE_BITS = 3, /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:218 ///
/// FLAGS_ACTIVE_EDGE_MASK = (1 << FLAGS_ACTIVE_EDGE_BITS) - 1 ///
///
FLAGS_ACTIVE_EDGE_MASK = (1 << FLAGS_ACTIVE_EDGE_BITS) - 1, } /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:90 ///
/// MeshShape() ///
///
/// /// /// Constructor /// /// public static MeshShape Create() => Jolt.PInvoke.MeshShape_Create(); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:94 ///
/// virtual bool MustBeStatic() const override ///
///
/// /// /// See Shape::MustBeStatic /// /// public bool MustBeStatic() => Jolt.PInvoke.MeshShape_MustBeStatic(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:100 ///
/// virtual uint GetSubShapeIDBitsRecursive() const override ///
///
/// /// /// See Shape::GetSubShapeIDBitsRecursive /// /// public uint GetSubShapeIDBitsRecursive() => Jolt.PInvoke.MeshShape_GetSubShapeIDBitsRecursive(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:103 ///
/// virtual float GetInnerRadius() const override ///
///
/// /// /// See Shape::GetInnerRadius /// /// public float GetInnerRadius() => Jolt.PInvoke.MeshShape_GetInnerRadius(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:109 ///
/// virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override ///
///
/// /// /// See Shape::GetMaterial /// /// public PhysicsMaterial GetMaterial(uint subShapeID) => Jolt.PInvoke.MeshShape_GetMaterial(this, subShapeID); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:116 ///
/// uint GetMaterialIndex(const SubShapeID &inSubShapeID) const ///
///
/// /// /// Determine which material index a particular sub shape uses (note that if there are no materials this function will return 0 so check the array size) /// Note: This could for example be used to create a decorator shape around a mesh shape that overrides the GetMaterial call to replace a material with another material. /// /// public uint GetMaterialIndex(uint subShapeID) => Jolt.PInvoke.MeshShape_GetMaterialIndex(this, subShapeID); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:119 ///
/// virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const override ///
///
/// /// /// See Shape::GetSurfaceNormal /// /// public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) => Jolt.PInvoke.MeshShape_GetSurfaceNormal(this, subShapeID, localSurfacePosition); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:126 ///
/// 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.MeshShape_Draw(this, renderer, centerOfMassTransform, scale, color, useMaterialColors, drawWireframe); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:139 ///
/// 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.MeshShape_CollideSoftBodyVertices(this, centerOfMassTransform, scale, vertices, numVertices, collidingShapeIndex); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:142 ///
/// 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.MeshShape_GetTrianglesStart(this, ref context, box, positionCOM, rotation, scale); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:148 ///
/// 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.MeshShape_GetSubmergedVolume(this, centerOfMassTransform, scale, surface, out totalVolume, out submergedVolume, out centerOfBuoyancy, baseOffset); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:151 ///
/// virtual void SaveBinaryState(StreamOut &inStream) const override ///
///
/// /// /// See Shape /// /// public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.MeshShape_SaveBinaryState(this, stream); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:159 ///
/// virtual float GetVolume() const override ///
///
/// /// /// See Shape::GetVolume /// /// public float GetVolume() => Jolt.PInvoke.MeshShape_GetVolume(this); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:162 ///
/// uint32 GetTriangleUserData(const SubShapeID &inSubShapeID) const ///
///
/// /// /// When MeshShape::mPerTriangleUserData is true, this function can be used to retrieve the user data that /// was stored in the mesh shape. /// /// public uint GetTriangleUserData(uint subShapeID) => Jolt.PInvoke.MeshShape_GetTriangleUserData(this, subShapeID); /// /// /// C++: /// Jolt/Physics/Collision/Shape/MeshShape.h:171 ///
/// static void sRegister() ///
///
/// /// /// Register shape functions with the registry /// /// public static void sRegister() => Jolt.PInvoke.MeshShape_sRegister(); public void AddRef() => Jolt.PInvoke.MeshShape_AddRef(this); public void Release() => Jolt.PInvoke.MeshShape_Release(this); public uint GetRefCount() => Jolt.PInvoke.MeshShape_GetRefCount(this); public static implicit operator Shape(MeshShape value) => Jolt.PInvoke.MeshShape_AsShape(value); public void Dispose() { if (IsNull()) return; Release(); } } }