// // 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/Core/Memory.h:35 ///
/// void RegisterDefaultAllocator() ///
///
/// /// /// Register platform default allocation / free functions /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RegisterDefaultAllocator")] public static partial void RegisterDefaultAllocator(); /// /// /// C++: /// Jolt/Core/HashCombine.h:15 ///
/// inline uint64 HashBytes(const void *inData, uint inSize, uint64 inSeed = 0xcbf29ce484222325UL) ///
///
/// /// /// Implements the FNV-1a hash algorithm /// @see https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function /// @param inData Data block of bytes /// @param inSize Number of bytes /// @param inSeed Seed of the hash (can be used to pass in the hash of a previous operation, otherwise leave default) /// @return Hash /// /// [LibraryImport("jolt", EntryPoint = "Jolt_HashBytes")] public static partial ulong HashBytes(void* data, uint size, ulong seed); /// /// /// C++: /// Jolt/Core/HashCombine.h:28 ///
/// constexpr uint64 HashString(const char *inString, uint64 inSeed = 0xcbf29ce484222325UL) ///
///
/// /// /// Calculate the FNV-1a hash of inString. /// @see https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function /// /// [LibraryImport("jolt", EntryPoint = "Jolt_HashString")] public static partial ulong HashString(byte* @string, ulong seed); /// /// /// C++: /// Jolt/Core/HashCombine.h:43 ///
/// inline uint64 Hash64(uint64 inValue) ///
///
/// /// /// A 64 bit hash function by Thomas Wang, Jan 1997 /// See: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm /// @param inValue Value to hash /// @return Hash /// /// [LibraryImport("jolt", EntryPoint = "Jolt_Hash64")] public static partial ulong Hash64(ulong value); /// /// /// C++: /// Jolt/Math/Math.h:16 ///
/// constexpr float DegreesToRadians(float inV) ///
///
/// /// /// Convert a value from degrees to radians /// /// [LibraryImport("jolt", EntryPoint = "Jolt_DegreesToRadians")] public static partial float DegreesToRadians(float v); /// /// /// C++: /// Jolt/Math/Math.h:22 ///
/// constexpr float RadiansToDegrees(float inV) ///
///
/// /// /// Convert a value from radians to degrees /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RadiansToDegrees")] public static partial float RadiansToDegrees(float v); /// /// /// C++: /// Jolt/Math/Math.h:28 ///
/// inline float CenterAngleAroundZero(float inV) ///
///
/// /// /// Convert angle in radians to the range \f$[-\pi, \pi]\f$ /// /// [LibraryImport("jolt", EntryPoint = "Jolt_CenterAngleAroundZero")] public static partial float CenterAngleAroundZero(float v); /// /// /// C++: /// Jolt/Math/Math.h:98 ///
/// inline uint CountTrailingZeros(uint32 inValue) ///
///
/// /// /// Compute number of trailing zero bits (how many low bits are zero) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_CountTrailingZeros")] public static partial uint CountTrailingZeros(uint value); /// /// /// C++: /// Jolt/Math/Math.h:134 ///
/// inline uint CountLeadingZeros(uint32 inValue) ///
///
/// /// /// Compute the number of leading zero bits (how many high bits are zero) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_CountLeadingZeros")] public static partial uint CountLeadingZeros(uint value); /// /// /// C++: /// Jolt/Math/Math.h:164 ///
/// inline uint CountBits(uint32 inValue) ///
///
/// /// /// Count the number of 1 bits in a value /// /// [LibraryImport("jolt", EntryPoint = "Jolt_CountBits")] public static partial uint CountBits(uint value); /// /// /// C++: /// Jolt/Math/Math.h:185 ///
/// inline uint32 GetNextPowerOf2(uint32 inValue) ///
///
/// /// /// Get the next higher power of 2 of a value, or the value itself if the value is already a power of 2 /// /// [LibraryImport("jolt", EntryPoint = "Jolt_GetNextPowerOf2")] public static partial uint GetNextPowerOf2(uint value); /// /// /// C++: /// Jolt/Math/Trigonometry.h:12 ///
/// float Sin(float inX) ///
///
/// /// /// Sine of x (input in radians) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_Sin")] public static partial float Sin(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:20 ///
/// float Cos(float inX) ///
///
/// /// /// Cosine of x (input in radians) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_Cos")] public static partial float Cos(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:28 ///
/// float Tan(float inX) ///
///
/// /// /// Tangent of x (input in radians) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_Tan")] public static partial float Tan(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:35 ///
/// float ASin(float inX) ///
///
/// /// /// Arc sine of x (returns value in the range [-PI / 2, PI / 2]) /// Note that all input values will be clamped to the range [-1, 1] and this function will not return NaNs like std::asin /// /// [LibraryImport("jolt", EntryPoint = "Jolt_ASin")] public static partial float ASin(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:42 ///
/// float ACos(float inX) ///
///
/// /// /// Arc cosine of x (returns value in the range [0, PI]) /// Note that all input values will be clamped to the range [-1, 1] and this function will not return NaNs like std::acos /// /// [LibraryImport("jolt", EntryPoint = "Jolt_ACos")] public static partial float ACos(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:48 ///
/// float ACosApproximate(float inX) ///
///
/// /// /// An approximation of ACos, max error is 4.2e-3 over the entire range [-1, 1], is approximately 2.5x /// faster than ACos /// /// [LibraryImport("jolt", EntryPoint = "Jolt_ACosApproximate")] public static partial float ACosApproximate(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:68 ///
/// float ATan(float inX) ///
///
/// /// /// Arc tangent of x (returns value in the range [-PI / 2, PI / 2]) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_ATan")] public static partial float ATan(float x); /// /// /// C++: /// Jolt/Math/Trigonometry.h:74 ///
/// float ATan2(float inY, float inX) ///
///
/// /// /// Arc tangent of y / x using the signs of the arguments to determine the correct quadrant (returns /// value in the range [-PI, PI]) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_ATan2")] public static partial float ATan2(float y, float x); /// /// /// C++: /// Jolt/ConfigurationString.h:10 ///
/// inline const char *GetConfigurationString() ///
///
/// /// /// Construct a string that lists the most important configuration settings /// /// [LibraryImport("jolt", EntryPoint = "Jolt_GetConfigurationString")] public static partial byte* GetConfigurationString(); /// /// /// C++: /// Jolt/RegisterTypes.h:10 ///
/// extern bool VerifyJoltVersionIDInternal(uint64 inVersionID) ///
///
/// /// /// Internal helper function /// /// [LibraryImport("jolt", EntryPoint = "Jolt_VerifyJoltVersionIDInternal")] public static partial Brutal.Bool8 VerifyJoltVersionIDInternal(ulong versionID); /// /// /// C++: /// Jolt/RegisterTypes.h:16 ///
/// bool VerifyJoltVersionID() ///
///
/// /// /// This function can be used to verify the library ABI is compatible with your /// application. /// Use it in this way: `assert(VerifyJoltVersionID());`. /// Returns `false` if the library used is not compatible with your app. /// /// [LibraryImport("jolt", EntryPoint = "Jolt_VerifyJoltVersionID")] public static partial Brutal.Bool8 VerifyJoltVersionID(); /// /// /// C++: /// Jolt/RegisterTypes.h:19 ///
/// extern void RegisterTypesInternal(uint64 inVersionID) ///
///
/// /// /// Internal helper function /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RegisterTypesInternal")] public static partial void RegisterTypesInternal(ulong versionID); /// /// /// C++: /// Jolt/RegisterTypes.h:24 ///
/// void RegisterTypes() ///
///
/// /// /// Register all physics types with the factory and install their collision handlers with the CollisionDispatch class. /// If you have your own custom shape types you probably need to register their handlers with the CollisionDispatch before calling this function. /// If you implement your own default material (PhysicsMaterial::sDefault) make sure to initialize it before this function or else this function will create one for you. /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RegisterTypes")] public static partial void RegisterTypes(); /// /// /// C++: /// Jolt/RegisterTypes.h:27 ///
/// extern void UnregisterTypes() ///
///
/// /// /// Unregisters all types with the factory and cleans up the default material /// /// [LibraryImport("jolt", EntryPoint = "Jolt_UnregisterTypes")] public static partial void UnregisterTypes(); /// /// /// C++: /// Jolt/Core/TickCounter.h:28 ///
/// uint64 GetProcessorTickCount() ///
///
/// /// /// Functionality to get the processors cycle counter /// /// [LibraryImport("jolt", EntryPoint = "Jolt_GetProcessorTickCount")] public static partial ulong GetProcessorTickCount(); /// /// /// C++: /// Jolt/Core/StringTools.h:36 ///
/// const char *NibbleToBinary(uint32 inNibble) ///
///
/// /// /// Converts the lower 4 bits of inNibble to a string that represents the number in binary format /// /// [LibraryImport("jolt", EntryPoint = "Jolt_NibbleToBinary")] public static partial byte* NibbleToBinary(uint nibble); /// /// /// C++: /// Jolt/Geometry/AABox4.h:193 ///
/// Vec4 AABox4DistanceSqToPoint(Vec4Arg inPointX, Vec4Arg inPointY, Vec4Arg inPointZ, Vec4Arg inBoxMinX, Vec4Arg inBoxMinY, Vec4Arg inBoxMinZ, Vec4Arg inBoxMaxX, Vec4Arg inBoxMaxY, Vec4Arg inBoxMaxZ) ///
///
/// /// /// Get the squared distance between 4 AABoxes and a point /// /// [LibraryImport("jolt", EntryPoint = "Jolt_AABox4DistanceSqToPoint")] public static partial float4 AABox4DistanceSqToPoint(float4 pointX, float4 pointY, float4 pointZ, float4 boxMinX, float4 boxMinY, float4 boxMinZ, float4 boxMaxX, float4 boxMaxY, float4 boxMaxZ); /// /// /// C++: /// Jolt/Geometry/AABox4.h:205 ///
/// Vec4 AABox4DistanceSqToPoint(Vec3 inPoint, Vec4Arg inBoxMinX, Vec4Arg inBoxMinY, Vec4Arg inBoxMinZ, Vec4Arg inBoxMaxX, Vec4Arg inBoxMaxY, Vec4Arg inBoxMaxZ) ///
///
/// /// /// Get the squared distance between 4 AABoxes and a point /// /// [LibraryImport("jolt", EntryPoint = "Jolt_AABox4DistanceSqToPoint_2")] public static partial float4 AABox4DistanceSqToPoint_2(float3 point, float4 boxMinX, float4 boxMinY, float4 boxMinZ, float4 boxMaxX, float4 boxMaxY, float4 boxMaxZ); /// /// /// C++: /// Jolt/Geometry/RayAABox.h:33 ///
/// float RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax) ///
///
/// /// /// Intersect AABB with ray, returns minimal distance along ray or FLT_MAX if no hit /// Note: Can return negative value if ray starts in box /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayAABox")] public static partial float RayAABox(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax); /// /// /// C++: /// Jolt/Geometry/RayAABox.h:72 ///
/// Vec4 RayAABox4(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec4Arg inBoundsMinX, Vec4Arg inBoundsMinY, Vec4Arg inBoundsMinZ, Vec4Arg inBoundsMaxX, Vec4Arg inBoundsMaxY, Vec4Arg inBoundsMaxZ) ///
///
/// /// /// Intersect 4 AABBs with ray, returns minimal distance along ray or FLT_MAX if no hit /// Note: Can return negative value if ray starts in box /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayAABox4")] public static partial float4 RayAABox4(float3 origin, RayInvDirection invDirection, float4 boundsMinX, float4 boundsMinY, float4 boundsMinZ, float4 boundsMaxX, float4 boundsMaxY, float4 boundsMaxZ); /// /// /// C++: /// Jolt/Geometry/RayAABox.h:136 ///
/// void RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax, float &outMin, float &outMax) ///
///
/// /// /// Intersect AABB with ray, returns minimal and maximal distance along ray or FLT_MAX, -FLT_MAX if no hit /// Note: Can return negative value for outMin if ray starts in box /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayAABox_2")] public static partial void RayAABox_2(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax, out float min, out float max); /// /// /// C++: /// Jolt/Geometry/RayAABox.h:175 ///
/// bool RayAABoxHits(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax, float inClosest) ///
///
/// /// /// Intersect AABB with ray, returns true if there is a hit closer than inClosest /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayAABoxHits")] public static partial Brutal.Bool8 RayAABoxHits(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax, float closest); /// /// /// C++: /// Jolt/Geometry/RayAABox.h:216 ///
/// bool RayAABoxHits(Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax) ///
///
/// /// /// Intersect AABB with ray without hit fraction, based on separating axis test /// @see http://www.codercorner.com/RayAABB.cpp /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayAABoxHits_2")] public static partial Brutal.Bool8 RayAABoxHits_2(float3 origin, float3 direction, float3 boundsMin, float3 boundsMax); /// /// /// C++: /// Jolt/Geometry/RayCylinder.h:17 ///
/// float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderRadius) ///
///
/// /// /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection /// against an infinite cylinder centered along the Y axis /// @return FLT_MAX if there is no intersection, otherwise the fraction along the ray. /// @param inRayDirection Direction of the ray. Does not need to be normalized. /// @param inRayOrigin Origin of the ray. If the ray starts inside the cylinder, the returned fraction will be 0. /// @param inCylinderRadius Radius of the infinite cylinder /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayCylinder")] public static partial float RayCylinder(float3 rayOrigin, float3 rayDirection, float cylinderRadius); /// /// /// C++: /// Jolt/Geometry/RayCylinder.h:57 ///
/// float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderHalfHeight, float inCylinderRadius) ///
///
/// /// /// Test a ray against a cylinder centered around the origin with its axis along the Y axis and half height specified. /// @return FLT_MAX if there is no intersection, otherwise the fraction along the ray. /// @param inRayDirection Ray direction. Does not need to be normalized. /// @param inRayOrigin Origin of the ray. If the ray starts inside the cylinder, the returned fraction will be 0. /// @param inCylinderRadius Radius of the cylinder /// @param inCylinderHalfHeight Distance from the origin to the top (or bottom) of the cylinder /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayCylinder_2")] public static partial float RayCylinder_2(float3 rayOrigin, float3 rayDirection, float cylinderHalfHeight, float cylinderRadius); /// /// /// C++: /// Jolt/Geometry/RaySphere.h:17 ///
/// float RaySphere(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, Vec3Arg inSphereCenter, float inSphereRadius) ///
///
/// /// /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a sphere, /// @return FLT_MAX if there is no intersection, otherwise the fraction along the ray. /// @param inRayOrigin Ray origin. If the ray starts inside the sphere, the returned fraction will be 0. /// @param inRayDirection Ray direction. Does not need to be normalized. /// @param inSphereCenter Position of the center of the sphere /// @param inSphereRadius Radius of the sphere /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RaySphere")] public static partial float RaySphere(float3 rayOrigin, float3 rayDirection, float3 sphereCenter, float sphereRadius); /// /// /// C++: /// Jolt/Geometry/RaySphere.h:54 ///
/// int RaySphere(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, Vec3Arg inSphereCenter, float inSphereRadius, float &outMinFraction, float &outMaxFraction) ///
///
/// /// /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection against a sphere. /// Outputs entry and exit points (outMinFraction and outMaxFraction) along the ray (which could be negative if the hit point is before the start of the ray). /// @param inRayOrigin Ray origin. If the ray starts inside the sphere, the returned fraction will be 0. /// @param inRayDirection Ray direction. Does not need to be normalized. /// @param inSphereCenter Position of the center of the sphere. /// @param inSphereRadius Radius of the sphere. /// @param outMinFraction Returned lowest intersection fraction /// @param outMaxFraction Returned highest intersection fraction /// @return The amount of intersections with the sphere. /// If 1 intersection is returned outMinFraction will be equal to outMaxFraction /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RaySphere_2")] public static partial int RaySphere_2(float3 rayOrigin, float3 rayDirection, float3 sphereCenter, float sphereRadius, out float minFraction, out float maxFraction); /// /// /// C++: /// Jolt/Geometry/RayCapsule.h:19 ///
/// float RayCapsule(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCapsuleHalfHeight, float inCapsuleRadius) ///
///
/// /// /// Tests a ray starting at inRayOrigin and extending infinitely in inRayDirection /// against a capsule centered around the origin with its axis along the Y axis and half height specified. /// @return FLT_MAX if there is no intersection, otherwise the fraction along the ray. /// @param inRayDirection Ray direction. Does not need to be normalized. /// @param inRayOrigin Origin of the ray. If the ray starts inside the capsule, the returned fraction will be 0. /// @param inCapsuleHalfHeight Distance from the origin to the center of the top sphere (or that of the bottom) /// @param inCapsuleRadius Radius of the top/bottom sphere /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayCapsule")] public static partial float RayCapsule(float3 rayOrigin, float3 rayDirection, float capsuleHalfHeight, float capsuleRadius); /// /// /// C++: /// Jolt/Geometry/RayTriangle.h:11 ///
/// float RayTriangle(Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2) ///
///
/// /// /// Intersect ray with triangle, returns closest point or FLT_MAX if no hit (branch less version) /// Adapted from: http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayTriangle")] public static partial float RayTriangle(float3 origin, float3 direction, float3 v0, float3 v1, float3 v2); /// /// /// C++: /// Jolt/Geometry/RayTriangle.h:76 ///
/// Vec4 RayTriangle4(Vec3Arg inOrigin, Vec3Arg inDirection, Vec4Arg inV0X, Vec4Arg inV0Y, Vec4Arg inV0Z, Vec4Arg inV1X, Vec4Arg inV1Y, Vec4Arg inV1Z, Vec4Arg inV2X, Vec4Arg inV2Y, Vec4Arg inV2Z) ///
///
/// /// /// Intersect ray with 4 triangles in SOA format, returns 4 vector of closest points or FLT_MAX if no /// hit (uses bit tricks to do less divisions) /// /// [LibraryImport("jolt", EntryPoint = "Jolt_RayTriangle4")] public static partial float4 RayTriangle4(float3 origin, float3 direction, float4 v0X, float4 v0Y, float4 v0Z, float4 v1X, float4 v1Y, float4 v1Z, float4 v2X, float4 v2Y, float4 v2Z); /// /// /// The error message from the most recent failed Result-returning call on this thread, the text the /// throwing wrappers (ShapeSettings.CreateShape and friends) report. /// /// [LibraryImport("jolt", EntryPoint = "Jolt_GetLastError")] public static partial nint GetLastError(); } } }