// // Generated by Brutal.Jolt.Generate; do not edit by hand. #nullable enable using Brutal.Interop; using Brutal.Numerics; namespace Brutal.JoltApi { public static partial class Jolt { public static unsafe partial class PInvoke { /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:200 ///
/// inline EShapeType GetType() const ///
///
/// /// /// Get type /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetShapeType")] public static partial EShapeType Shape_GetShapeType(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:201 ///
/// inline EShapeSubType GetSubType() const ///
///
[LibraryImport("jolt", EntryPoint = "Shape_GetSubType")] public static partial EShapeSubType Shape_GetSubType(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:204 ///
/// uint64 GetUserData() const ///
///
/// /// /// User data (to be used freely by the application) /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetUserData")] public static partial ulong Shape_GetUserData(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:205 ///
/// void SetUserData(uint64 inUserData) ///
///
[LibraryImport("jolt", EntryPoint = "Shape_SetUserData")] public static partial void Shape_SetUserData(Shape self, ulong userData); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:208 ///
/// virtual bool MustBeStatic() const ///
///
/// /// /// Check if this shape can only be used to create a static body or if it can also be dynamic/kinematic /// /// [LibraryImport("jolt", EntryPoint = "Shape_MustBeStatic")] public static partial Brutal.Bool8 Shape_MustBeStatic(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:211 ///
/// virtual Vec3 GetCenterOfMass() const ///
///
/// /// /// All shapes are centered around their center of mass. This function returns the center of mass /// position that needs to be applied to transform the shape to where it was created. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetCenterOfMass")] public static partial float3 Shape_GetCenterOfMass(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:217 ///
/// virtual uint GetSubShapeIDBitsRecursive() const = 0 ///
///
/// /// /// Get the max number of sub shape ID bits that are needed to be able to address any leaf shape in this /// shape. Used mainly for checking that it is smaller or equal than SubShapeID::MaxBits. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetSubShapeIDBitsRecursive")] public static partial uint Shape_GetSubShapeIDBitsRecursive(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:238 ///
/// virtual float GetInnerRadius() const = 0 ///
///
/// /// /// Returns the radius of the biggest sphere that fits entirely in the shape. In case this shape consists of multiple sub shapes, it returns the smallest sphere of the parts. /// This can be used as a measure of how far the shape can be moved without risking going through geometry. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetInnerRadius")] public static partial float Shape_GetInnerRadius(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:247 ///
/// virtual const Shape * GetLeafShape(const SubShapeID &inSubShapeID, SubShapeID &outRemainder) const ///
///
/// /// /// Get the leaf shape for a particular sub shape ID. /// @param inSubShapeID The full sub shape ID that indicates the path to the leaf shape /// @param outRemainder What remains of the sub shape ID after removing the path to the leaf shape (could e.g. refer to a triangle within a MeshShape) /// @return The shape or null if the sub shape ID is invalid /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetLeafShape")] public static partial Shape Shape_GetLeafShape(Shape self, uint subShapeID, out uint remainder); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:250 ///
/// virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const = 0 ///
///
/// /// /// Get the material assigned to a particular sub shape ID /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetMaterial")] public static partial PhysicsMaterial Shape_GetMaterial(Shape self, uint subShapeID); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:254 ///
/// virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const = 0 ///
///
/// /// /// Get the surface normal of a particular sub shape ID and point on surface (all vectors are relative to center of mass for this shape). /// Note: When you have a CollideShapeResult or ShapeCastResult you should use -mPenetrationAxis.Normalized() as contact normal as GetSurfaceNormal will only return face normals (and not vertex or edge normals). /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetSurfaceNormal")] public static partial float3 Shape_GetSurfaceNormal(Shape self, uint subShapeID, float3 localSurfacePosition); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:269 ///
/// virtual uint64 GetSubShapeUserData(const SubShapeID &inSubShapeID) const ///
///
/// /// /// Get the user data of a particular sub shape ID. Corresponds with the value stored in /// Shape::GetUserData of the leaf shape pointed to by inSubShapeID. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetSubShapeUserData")] public static partial ulong Shape_GetSubShapeUserData(Shape self, uint subShapeID); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:290 ///
/// virtual void GetSubmergedVolume(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const Plane &inSurface, float &outTotalVolume, float &outSubmergedVolume, Vec3 &outCenterOfBuoyancy ///
///
[LibraryImport("jolt", EntryPoint = "Shape_GetSubmergedVolume")] public static partial void Shape_GetSubmergedVolume(Shape self, float4x4 centerOfMassTransform, float3 scale, Plane surface, out float totalVolume, out float submergedVolume, out float3 centerOfBuoyancy, float3 baseOffset); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:298 ///
/// virtual void Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const = 0 ///
///
/// /// /// Draw the shape at a particular location with a particular color (debugging purposes) /// /// [LibraryImport("jolt", EntryPoint = "Shape_Draw")] public static partial void Shape_Draw(Shape self, DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, Brutal.Bool8 useMaterialColors, Brutal.Bool8 drawWireframe); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:301 ///
/// virtual void DrawGetSupportFunction(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inDrawSupportDirection) const ///
///
/// /// /// Draw the results of the GetSupportFunction with the convex radius added back on to show any errors /// introduced by this process (only relevant for convex shapes) /// /// [LibraryImport("jolt", EntryPoint = "Shape_DrawGetSupportFunction")] public static partial void Shape_DrawGetSupportFunction(Shape self, DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, Brutal.Bool8 drawSupportDirection); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:304 ///
/// virtual void DrawGetSupportingFace(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale) const ///
///
/// /// /// Draw the results of the GetSupportingFace function to show any errors introduced by this process /// (only relevant for convex shapes) /// /// [LibraryImport("jolt", EntryPoint = "Shape_DrawGetSupportingFace")] public static partial void Shape_DrawGetSupportingFace(Shape self, DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:329 ///
/// virtual void CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const = 0 ///
///
/// /// /// Collides all vertices of a soft body with this shape and updates SoftBodyVertex::mCollisionPlane, SoftBodyVertex::mCollidingShapeIndex and SoftBodyVertex::mLargestPenetration if a collision with more penetration was found. /// @param inCenterOfMassTransform Center of mass transform for this shape relative to the vertices. /// @param inScale Scale in local space of the shape (scales relative to its center of mass) /// @param inVertices The vertices of the soft body /// @param inNumVertices The number of vertices in inVertices /// @param inCollidingShapeIndex Value to store in CollideSoftBodyVertexIterator::mCollidingShapeIndex when a collision was found /// /// [LibraryImport("jolt", EntryPoint = "Shape_CollideSoftBodyVertices")] public static partial void Shape_CollideSoftBodyVertices(Shape self, float4x4 centerOfMassTransform, float3 scale, CollideSoftBodyVertexIterator vertices, uint numVertices, int collidingShapeIndex); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:345 ///
/// ShapeResult ScaleShape(Vec3Arg inScale) const ///
///
/// /// /// Scale this shape. Note that not all shapes support all scales, this will return a shape that matches the scale as accurately as possible. See Shape::IsValidScale for more information. /// @param inScale The scale to use for this shape (note: this scale is applied to the entire shape in the space it was created, most other functions apply the scale in the space of the leaf shapes and from the center of mass!) /// /// /// Returns a null handle when the operation fails; call Jolt.GetLastError() for Jolt's error message. /// /// [LibraryImport("jolt", EntryPoint = "Shape_ScaleShape")] public static partial Shape Shape_ScaleShape(Shape self, float3 scale); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:358 ///
/// virtual void GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const = 0 ///
///
/// /// /// To start iterating over triangles, call this function first. /// ioContext is a temporary buffer and should remain untouched until the last call to GetTrianglesNext. /// inBox is the world space bounding in which you want to get the triangles. /// inPositionCOM/inRotation/inScale describes the transform of this shape. /// To get the actual triangles call GetTrianglesNext. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetTrianglesStart")] public static partial void Shape_GetTrianglesStart(Shape self, ref Shape.GetTrianglesContext context, AABox box, float3 positionCOM, floatQuat rotation, float3 scale); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:376 ///
/// virtual void SaveBinaryState(StreamOut &inStream) const ///
///
/// /// /// Saves the contents of the shape in binary form to inStream. /// /// [LibraryImport("jolt", EntryPoint = "Shape_SaveBinaryState")] public static partial void Shape_SaveBinaryState(Shape self, StreamOut stream); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:379 ///
/// static ShapeResult sRestoreFromBinaryState(StreamIn &inStream) ///
///
/// /// /// Creates a Shape of the correct type and restores its contents from the binary stream inStream. /// /// /// Returns a null handle when the operation fails; call Jolt.GetLastError() for Jolt's error message. /// /// [LibraryImport("jolt", EntryPoint = "Shape_sRestoreFromBinaryState")] public static partial Shape Shape_sRestoreFromBinaryState(StreamIn stream); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:425 ///
/// virtual float GetVolume() const = 0 ///
///
/// /// /// < Volume of this shape (m^3). Note that for compound shapes the volume may be incorrect since /// child shapes can overlap which is not accounted for. /// /// [LibraryImport("jolt", EntryPoint = "Shape_GetVolume")] public static partial float Shape_GetVolume(Shape self); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:439 ///
/// virtual bool IsValidScale(Vec3Arg inScale) const ///
///
/// /// /// Test if inScale is a valid scale for this shape. Some shapes can only be scaled uniformly, compound shapes cannot handle shapes /// being rotated and scaled (this would cause shearing), scale can never be zero. When the scale is invalid, the function will return false. /// /// Here's a list of supported scales: /// * SphereShape: Scale must be uniform (signs of scale are ignored). /// * BoxShape: Any scale supported (signs of scale are ignored). /// * TriangleShape: Any scale supported when convex radius is zero, otherwise only uniform scale supported. /// * CapsuleShape: Scale must be uniform (signs of scale are ignored). /// * TaperedCapsuleShape: Scale must be uniform (sign of Y scale can be used to flip the capsule). /// * CylinderShape: Scale must be uniform in XZ plane, Y can scale independently (signs of scale are ignored). /// * RotatedTranslatedShape: Scale must not cause shear in the child shape. /// * CompoundShape: Scale must not cause shear in any of the child shapes. /// /// [LibraryImport("jolt", EntryPoint = "Shape_IsValidScale")] public static partial Brutal.Bool8 Shape_IsValidScale(Shape self, float3 scale); /// /// /// C++: /// Jolt/Physics/Collision/Shape/Shape.h:446 ///
/// virtual Vec3 MakeScaleValid(Vec3Arg inScale) const ///
///
/// /// /// This function will make sure that if you wrap this shape in a ScaledShape that the scale is valid. /// Note that this involves discarding components of the scale that are invalid, so the resulting scaled shape may be different than the requested scale. /// Compare the return value of this function with the scale you passed in to detect major inconsistencies and possibly warn the user. /// @param inScale Local space scale for this shape. /// @return Scale that can be used to wrap this shape in a ScaledShape. IsValidScale will return true for this scale. /// /// [LibraryImport("jolt", EntryPoint = "Shape_MakeScaleValid")] public static partial float3 Shape_MakeScaleValid(Shape self, float3 scale); [LibraryImport("jolt", EntryPoint = "Shape_AddRef")] public static partial void Shape_AddRef(Shape self); [LibraryImport("jolt", EntryPoint = "Shape_Release")] public static partial void Shape_Release(Shape self); [LibraryImport("jolt", EntryPoint = "Shape_GetRefCount")] public static partial uint Shape_GetRefCount(Shape self); } } }