//
// 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
{
///
///
/// C++:
/// Jolt/Core/Memory.h:35
///
/// void RegisterDefaultAllocator()
///
///
///
///
/// Register platform default allocation / free functions
///
///
public static void RegisterDefaultAllocator() => Jolt.PInvoke.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
///
///
public static unsafe ulong HashBytes(Ptr data, ByteSize size, ulong seed) => Jolt.PInvoke.HashBytes(data, (uint)size, 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
///
///
public static unsafe ulong HashString(RefString8 @string, ulong seed)
{
fixed (byte* @string_fixed = @string)
{
return Jolt.PInvoke.HashString(@string_fixed, 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
///
///
public static ulong Hash64(ulong value) => Jolt.PInvoke.Hash64(value);
///
///
/// C++:
/// Jolt/Math/Math.h:16
///
/// constexpr float DegreesToRadians(float inV)
///
///
///
///
/// Convert a value from degrees to radians
///
///
public static float DegreesToRadians(float v) => Jolt.PInvoke.DegreesToRadians(v);
///
///
/// C++:
/// Jolt/Math/Math.h:22
///
/// constexpr float RadiansToDegrees(float inV)
///
///
///
///
/// Convert a value from radians to degrees
///
///
public static float RadiansToDegrees(float v) => Jolt.PInvoke.RadiansToDegrees(v);
///
///
/// C++:
/// Jolt/Math/Math.h:28
///
/// inline float CenterAngleAroundZero(float inV)
///
///
///
///
/// Convert angle in radians to the range \f$[-\pi, \pi]\f$
///
///
public static float CenterAngleAroundZero(float v) => Jolt.PInvoke.CenterAngleAroundZero(v);
///
///
/// C++:
/// Jolt/Math/Math.h:98
///
/// inline uint CountTrailingZeros(uint32 inValue)
///
///
///
///
/// Compute number of trailing zero bits (how many low bits are zero)
///
///
public static uint CountTrailingZeros(uint value) => Jolt.PInvoke.CountTrailingZeros(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)
///
///
public static uint CountLeadingZeros(uint value) => Jolt.PInvoke.CountLeadingZeros(value);
///
///
/// C++:
/// Jolt/Math/Math.h:164
///
/// inline uint CountBits(uint32 inValue)
///
///
///
///
/// Count the number of 1 bits in a value
///
///
public static uint CountBits(uint value) => Jolt.PInvoke.CountBits(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
///
///
public static uint GetNextPowerOf2(uint value) => Jolt.PInvoke.GetNextPowerOf2(value);
///
///
/// C++:
/// Jolt/Math/Trigonometry.h:12
///
/// float Sin(float inX)
///
///
///
///
/// Sine of x (input in radians)
///
///
public static float Sin(float x) => Jolt.PInvoke.Sin(x);
///
///
/// C++:
/// Jolt/Math/Trigonometry.h:20
///
/// float Cos(float inX)
///
///
///
///
/// Cosine of x (input in radians)
///
///
public static float Cos(float x) => Jolt.PInvoke.Cos(x);
///
///
/// C++:
/// Jolt/Math/Trigonometry.h:28
///
/// float Tan(float inX)
///
///
///
///
/// Tangent of x (input in radians)
///
///
public static float Tan(float x) => Jolt.PInvoke.Tan(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
///
///
public static float ASin(float x) => Jolt.PInvoke.ASin(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
///
///
public static float ACos(float x) => Jolt.PInvoke.ACos(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
///
///
public static float ACosApproximate(float x) => Jolt.PInvoke.ACosApproximate(x);
///
///
/// C++:
/// Jolt/Math/Trigonometry.h:68
///
/// float ATan(float inX)
///
///
///
///
/// Arc tangent of x (returns value in the range [-PI / 2, PI / 2])
///
///
public static float ATan(float x) => Jolt.PInvoke.ATan(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])
///
///
public static float ATan2(float y, float x) => Jolt.PInvoke.ATan2(y, x);
///
///
/// C++:
/// Jolt/ConfigurationString.h:10
///
/// inline const char *GetConfigurationString()
///
///
///
///
/// Construct a string that lists the most important configuration settings
///
///
public static unsafe RefString8 GetConfigurationString() => (Ptr)Jolt.PInvoke.GetConfigurationString();
///
///
/// C++:
/// Jolt/RegisterTypes.h:10
///
/// extern bool VerifyJoltVersionIDInternal(uint64 inVersionID)
///
///
///
///
/// Internal helper function
///
///
public static bool VerifyJoltVersionIDInternal(ulong versionID) => Jolt.PInvoke.VerifyJoltVersionIDInternal(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.
///
///
public static bool VerifyJoltVersionID() => Jolt.PInvoke.VerifyJoltVersionID();
///
///
/// C++:
/// Jolt/RegisterTypes.h:19
///
/// extern void RegisterTypesInternal(uint64 inVersionID)
///
///
///
///
/// Internal helper function
///
///
public static void RegisterTypesInternal(ulong versionID) => Jolt.PInvoke.RegisterTypesInternal(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.
///
///
public static void RegisterTypes() => Jolt.PInvoke.RegisterTypes();
///
///
/// C++:
/// Jolt/RegisterTypes.h:27
///
/// extern void UnregisterTypes()
///
///
///
///
/// Unregisters all types with the factory and cleans up the default material
///
///
public static void UnregisterTypes() => Jolt.PInvoke.UnregisterTypes();
///
///
/// C++:
/// Jolt/Core/TickCounter.h:28
///
/// uint64 GetProcessorTickCount()
///
///
///
///
/// Functionality to get the processors cycle counter
///
///
public static ulong GetProcessorTickCount() => Jolt.PInvoke.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
///
///
public static unsafe RefString8 NibbleToBinary(uint nibble) => (Ptr)Jolt.PInvoke.NibbleToBinary(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
///
///
public static float4 AABox4DistanceSqToPoint(float4 pointX, float4 pointY, float4 pointZ, float4 boxMinX, float4 boxMinY, float4 boxMinZ, float4 boxMaxX, float4 boxMaxY, float4 boxMaxZ) => Jolt.PInvoke.AABox4DistanceSqToPoint(pointX, pointY, pointZ, boxMinX, boxMinY, boxMinZ, boxMaxX, boxMaxY, 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
///
///
public static float4 AABox4DistanceSqToPoint(float3 point, float4 boxMinX, float4 boxMinY, float4 boxMinZ, float4 boxMaxX, float4 boxMaxY, float4 boxMaxZ) => Jolt.PInvoke.AABox4DistanceSqToPoint_2(point, boxMinX, boxMinY, boxMinZ, boxMaxX, boxMaxY, 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
///
///
public static float RayAABox(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax) => Jolt.PInvoke.RayAABox(origin, invDirection, boundsMin, 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
///
///
public static float4 RayAABox4(float3 origin, RayInvDirection invDirection, float4 boundsMinX, float4 boundsMinY, float4 boundsMinZ, float4 boundsMaxX, float4 boundsMaxY, float4 boundsMaxZ) => Jolt.PInvoke.RayAABox4(origin, invDirection, boundsMinX, boundsMinY, boundsMinZ, boundsMaxX, boundsMaxY, 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
///
///
public static void RayAABox(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax, out float min, out float max) => Jolt.PInvoke.RayAABox_2(origin, invDirection, boundsMin, boundsMax, out min, out 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
///
///
public static bool RayAABoxHits(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax, float closest) => Jolt.PInvoke.RayAABoxHits(origin, invDirection, boundsMin, boundsMax, 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
///
///
public static bool RayAABoxHits(float3 origin, float3 direction, float3 boundsMin, float3 boundsMax) => Jolt.PInvoke.RayAABoxHits_2(origin, direction, boundsMin, 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
///
///
public static float RayCylinder(float3 rayOrigin, float3 rayDirection, float cylinderRadius) => Jolt.PInvoke.RayCylinder(rayOrigin, rayDirection, 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
///
///
public static float RayCylinder(float3 rayOrigin, float3 rayDirection, float cylinderHalfHeight, float cylinderRadius) => Jolt.PInvoke.RayCylinder_2(rayOrigin, rayDirection, cylinderHalfHeight, 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
///
///
public static float RaySphere(float3 rayOrigin, float3 rayDirection, float3 sphereCenter, float sphereRadius) => Jolt.PInvoke.RaySphere(rayOrigin, rayDirection, sphereCenter, 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
///
///
public static int RaySphere(float3 rayOrigin, float3 rayDirection, float3 sphereCenter, float sphereRadius, out float minFraction, out float maxFraction) => Jolt.PInvoke.RaySphere_2(rayOrigin, rayDirection, sphereCenter, sphereRadius, out minFraction, out 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
///
///
public static float RayCapsule(float3 rayOrigin, float3 rayDirection, float capsuleHalfHeight, float capsuleRadius) => Jolt.PInvoke.RayCapsule(rayOrigin, rayDirection, capsuleHalfHeight, 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
///
///
public static float RayTriangle(float3 origin, float3 direction, float3 v0, float3 v1, float3 v2) => Jolt.PInvoke.RayTriangle(origin, direction, v0, v1, 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)
///
///
public static float4 RayTriangle4(float3 origin, float3 direction, float4 v0X, float4 v0Y, float4 v0Z, float4 v1X, float4 v1Y, float4 v1Z, float4 v2X, float4 v2Y, float4 v2Z) => Jolt.PInvoke.RayTriangle4(origin, direction, v0X, v0Y, v0Z, v1X, v1Y, v1Z, v2X, v2Y, 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.
///
///
public static string GetLastError() => Marshal.PtrToStringUTF8(Jolt.PInvoke.GetLastError()) ?? string.Empty;
}
}