mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
653 lines
34 KiB
C#
653 lines
34 KiB
C#
// <auto-generated/>
|
|
// 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
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Memory.h#L35">Jolt/Core/Memory.h:35</see>
|
|
/// <br/>
|
|
/// <c>void RegisterDefaultAllocator()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Register platform default allocation / free functions
|
|
/// </para>
|
|
/// </remarks>
|
|
public static void RegisterDefaultAllocator() => Jolt.PInvoke.RegisterDefaultAllocator();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/HashCombine.h#L15">Jolt/Core/HashCombine.h:15</see>
|
|
/// <br/>
|
|
/// <c>inline uint64 HashBytes(const void *inData, uint inSize, uint64 inSeed = 0xcbf29ce484222325UL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe ulong HashBytes(Ptr data, ByteSize size, ulong seed) => Jolt.PInvoke.HashBytes(data, (uint)size, seed);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/HashCombine.h#L28">Jolt/Core/HashCombine.h:28</see>
|
|
/// <br/>
|
|
/// <c>constexpr uint64 HashString(const char *inString, uint64 inSeed = 0xcbf29ce484222325UL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Calculate the FNV-1a hash of inString.
|
|
/// @see https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe ulong HashString(RefString8 @string, ulong seed)
|
|
{
|
|
fixed (byte* @string_fixed = @string)
|
|
{
|
|
return Jolt.PInvoke.HashString(@string_fixed, seed);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/HashCombine.h#L43">Jolt/Core/HashCombine.h:43</see>
|
|
/// <br/>
|
|
/// <c>inline uint64 Hash64(uint64 inValue)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static ulong Hash64(ulong value) => Jolt.PInvoke.Hash64(value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L16">Jolt/Math/Math.h:16</see>
|
|
/// <br/>
|
|
/// <c>constexpr float DegreesToRadians(float inV)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Convert a value from degrees to radians
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float DegreesToRadians(float v) => Jolt.PInvoke.DegreesToRadians(v);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L22">Jolt/Math/Math.h:22</see>
|
|
/// <br/>
|
|
/// <c>constexpr float RadiansToDegrees(float inV)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Convert a value from radians to degrees
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float RadiansToDegrees(float v) => Jolt.PInvoke.RadiansToDegrees(v);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L28">Jolt/Math/Math.h:28</see>
|
|
/// <br/>
|
|
/// <c>inline float CenterAngleAroundZero(float inV)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Convert angle in radians to the range \f$[-\pi, \pi]\f$
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float CenterAngleAroundZero(float v) => Jolt.PInvoke.CenterAngleAroundZero(v);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L98">Jolt/Math/Math.h:98</see>
|
|
/// <br/>
|
|
/// <c>inline uint CountTrailingZeros(uint32 inValue)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Compute number of trailing zero bits (how many low bits are zero)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static uint CountTrailingZeros(uint value) => Jolt.PInvoke.CountTrailingZeros(value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L134">Jolt/Math/Math.h:134</see>
|
|
/// <br/>
|
|
/// <c>inline uint CountLeadingZeros(uint32 inValue)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Compute the number of leading zero bits (how many high bits are zero)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static uint CountLeadingZeros(uint value) => Jolt.PInvoke.CountLeadingZeros(value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L164">Jolt/Math/Math.h:164</see>
|
|
/// <br/>
|
|
/// <c>inline uint CountBits(uint32 inValue)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Count the number of 1 bits in a value
|
|
/// </para>
|
|
/// </remarks>
|
|
public static uint CountBits(uint value) => Jolt.PInvoke.CountBits(value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Math.h#L185">Jolt/Math/Math.h:185</see>
|
|
/// <br/>
|
|
/// <c>inline uint32 GetNextPowerOf2(uint32 inValue)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the next higher power of 2 of a value, or the value itself if the value is already a power of 2
|
|
/// </para>
|
|
/// </remarks>
|
|
public static uint GetNextPowerOf2(uint value) => Jolt.PInvoke.GetNextPowerOf2(value);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L12">Jolt/Math/Trigonometry.h:12</see>
|
|
/// <br/>
|
|
/// <c>float Sin(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Sine of x (input in radians)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float Sin(float x) => Jolt.PInvoke.Sin(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L20">Jolt/Math/Trigonometry.h:20</see>
|
|
/// <br/>
|
|
/// <c>float Cos(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Cosine of x (input in radians)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float Cos(float x) => Jolt.PInvoke.Cos(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L28">Jolt/Math/Trigonometry.h:28</see>
|
|
/// <br/>
|
|
/// <c>float Tan(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Tangent of x (input in radians)
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float Tan(float x) => Jolt.PInvoke.Tan(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L35">Jolt/Math/Trigonometry.h:35</see>
|
|
/// <br/>
|
|
/// <c>float ASin(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float ASin(float x) => Jolt.PInvoke.ASin(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L42">Jolt/Math/Trigonometry.h:42</see>
|
|
/// <br/>
|
|
/// <c>float ACos(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float ACos(float x) => Jolt.PInvoke.ACos(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L48">Jolt/Math/Trigonometry.h:48</see>
|
|
/// <br/>
|
|
/// <c>float ACosApproximate(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// An approximation of ACos, max error is 4.2e-3 over the entire range [-1, 1], is approximately 2.5x
|
|
/// faster than ACos
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float ACosApproximate(float x) => Jolt.PInvoke.ACosApproximate(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L68">Jolt/Math/Trigonometry.h:68</see>
|
|
/// <br/>
|
|
/// <c>float ATan(float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Arc tangent of x (returns value in the range [-PI / 2, PI / 2])
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float ATan(float x) => Jolt.PInvoke.ATan(x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Math/Trigonometry.h#L74">Jolt/Math/Trigonometry.h:74</see>
|
|
/// <br/>
|
|
/// <c>float ATan2(float inY, float inX)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Arc tangent of y / x using the signs of the arguments to determine the correct quadrant (returns value
|
|
/// in the range [-PI, PI])
|
|
/// </para>
|
|
/// </remarks>
|
|
public static float ATan2(float y, float x) => Jolt.PInvoke.ATan2(y, x);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/ConfigurationString.h#L10">Jolt/ConfigurationString.h:10</see>
|
|
/// <br/>
|
|
/// <c>inline const char *GetConfigurationString()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Construct a string that lists the most important configuration settings
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe RefString8 GetConfigurationString() => (Ptr<byte>)Jolt.PInvoke.GetConfigurationString();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/RegisterTypes.h#L10">Jolt/RegisterTypes.h:10</see>
|
|
/// <br/>
|
|
/// <c>extern bool VerifyJoltVersionIDInternal(uint64 inVersionID)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Internal helper function
|
|
/// </para>
|
|
/// </remarks>
|
|
public static bool VerifyJoltVersionIDInternal(ulong versionID) => Jolt.PInvoke.VerifyJoltVersionIDInternal(versionID);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/RegisterTypes.h#L16">Jolt/RegisterTypes.h:16</see>
|
|
/// <br/>
|
|
/// <c>bool VerifyJoltVersionID()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static bool VerifyJoltVersionID() => Jolt.PInvoke.VerifyJoltVersionID();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/RegisterTypes.h#L19">Jolt/RegisterTypes.h:19</see>
|
|
/// <br/>
|
|
/// <c>extern void RegisterTypesInternal(uint64 inVersionID)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Internal helper function
|
|
/// </para>
|
|
/// </remarks>
|
|
public static void RegisterTypesInternal(ulong versionID) => Jolt.PInvoke.RegisterTypesInternal(versionID);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/RegisterTypes.h#L24">Jolt/RegisterTypes.h:24</see>
|
|
/// <br/>
|
|
/// <c>void RegisterTypes()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static void RegisterTypes() => Jolt.PInvoke.RegisterTypes();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/RegisterTypes.h#L27">Jolt/RegisterTypes.h:27</see>
|
|
/// <br/>
|
|
/// <c>extern void UnregisterTypes()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Unregisters all types with the factory and cleans up the default material
|
|
/// </para>
|
|
/// </remarks>
|
|
public static void UnregisterTypes() => Jolt.PInvoke.UnregisterTypes();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/TickCounter.h#L28">Jolt/Core/TickCounter.h:28</see>
|
|
/// <br/>
|
|
/// <c>uint64 GetProcessorTickCount()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Functionality to get the processors cycle counter
|
|
/// </para>
|
|
/// </remarks>
|
|
public static ulong GetProcessorTickCount() => Jolt.PInvoke.GetProcessorTickCount();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/StringTools.h#L36">Jolt/Core/StringTools.h:36</see>
|
|
/// <br/>
|
|
/// <c>const char *NibbleToBinary(uint32 inNibble)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Converts the lower 4 bits of inNibble to a string that represents the number in binary format
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe RefString8 NibbleToBinary(uint nibble) => (Ptr<byte>)Jolt.PInvoke.NibbleToBinary(nibble);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/AABox4.h#L193">Jolt/Geometry/AABox4.h:193</see>
|
|
/// <br/>
|
|
/// <c>Vec4 AABox4DistanceSqToPoint(Vec4Arg inPointX, Vec4Arg inPointY, Vec4Arg inPointZ, Vec4Arg inBoxMinX, Vec4Arg inBoxMinY, Vec4Arg inBoxMinZ, Vec4Arg inBoxMaxX, Vec4Arg inBoxMaxY, Vec4Arg inBoxMaxZ)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the squared distance between 4 AABoxes and a point
|
|
/// </para>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/AABox4.h#L205">Jolt/Geometry/AABox4.h:205</see>
|
|
/// <br/>
|
|
/// <c>Vec4 AABox4DistanceSqToPoint(Vec3 inPoint, Vec4Arg inBoxMinX, Vec4Arg inBoxMinY, Vec4Arg inBoxMinZ, Vec4Arg inBoxMaxX, Vec4Arg inBoxMaxY, Vec4Arg inBoxMaxZ)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the squared distance between 4 AABoxes and a point
|
|
/// </para>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayAABox.h#L33">Jolt/Geometry/RayAABox.h:33</see>
|
|
/// <br/>
|
|
/// <c>float RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RayAABox(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax) => Jolt.PInvoke.RayAABox(origin, invDirection, boundsMin, boundsMax);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayAABox.h#L72">Jolt/Geometry/RayAABox.h:72</see>
|
|
/// <br/>
|
|
/// <c>Vec4 RayAABox4(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec4Arg inBoundsMinX, Vec4Arg inBoundsMinY, Vec4Arg inBoundsMinZ, Vec4Arg inBoundsMaxX, Vec4Arg inBoundsMaxY, Vec4Arg inBoundsMaxZ)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayAABox.h#L136">Jolt/Geometry/RayAABox.h:136</see>
|
|
/// <br/>
|
|
/// <c>void RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax, float &outMin, float &outMax)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayAABox.h#L175">Jolt/Geometry/RayAABox.h:175</see>
|
|
/// <br/>
|
|
/// <c>bool RayAABoxHits(Vec3Arg inOrigin, const RayInvDirection &inInvDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax, float inClosest)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Intersect AABB with ray, returns true if there is a hit closer than inClosest
|
|
/// </para>
|
|
/// </remarks>
|
|
public static bool RayAABoxHits(float3 origin, RayInvDirection invDirection, float3 boundsMin, float3 boundsMax, float closest) => Jolt.PInvoke.RayAABoxHits(origin, invDirection, boundsMin, boundsMax, closest);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayAABox.h#L216">Jolt/Geometry/RayAABox.h:216</see>
|
|
/// <br/>
|
|
/// <c>bool RayAABoxHits(Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inBoundsMin, Vec3Arg inBoundsMax)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Intersect AABB with ray without hit fraction, based on separating axis test
|
|
/// @see http://www.codercorner.com/RayAABB.cpp
|
|
/// </code>
|
|
/// </remarks>
|
|
public static bool RayAABoxHits(float3 origin, float3 direction, float3 boundsMin, float3 boundsMax) => Jolt.PInvoke.RayAABoxHits_2(origin, direction, boundsMin, boundsMax);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayCylinder.h#L17">Jolt/Geometry/RayCylinder.h:17</see>
|
|
/// <br/>
|
|
/// <c>float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderRadius)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RayCylinder(float3 rayOrigin, float3 rayDirection, float cylinderRadius) => Jolt.PInvoke.RayCylinder(rayOrigin, rayDirection, cylinderRadius);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayCylinder.h#L57">Jolt/Geometry/RayCylinder.h:57</see>
|
|
/// <br/>
|
|
/// <c>float RayCylinder(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCylinderHalfHeight, float inCylinderRadius)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RayCylinder(float3 rayOrigin, float3 rayDirection, float cylinderHalfHeight, float cylinderRadius) => Jolt.PInvoke.RayCylinder_2(rayOrigin, rayDirection, cylinderHalfHeight, cylinderRadius);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RaySphere.h#L17">Jolt/Geometry/RaySphere.h:17</see>
|
|
/// <br/>
|
|
/// <c>float RaySphere(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, Vec3Arg inSphereCenter, float inSphereRadius)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RaySphere(float3 rayOrigin, float3 rayDirection, float3 sphereCenter, float sphereRadius) => Jolt.PInvoke.RaySphere(rayOrigin, rayDirection, sphereCenter, sphereRadius);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RaySphere.h#L54">Jolt/Geometry/RaySphere.h:54</see>
|
|
/// <br/>
|
|
/// <c>int RaySphere(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, Vec3Arg inSphereCenter, float inSphereRadius, float &outMinFraction, float &outMaxFraction)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayCapsule.h#L19">Jolt/Geometry/RayCapsule.h:19</see>
|
|
/// <br/>
|
|
/// <c>float RayCapsule(Vec3Arg inRayOrigin, Vec3Arg inRayDirection, float inCapsuleHalfHeight, float inCapsuleRadius)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RayCapsule(float3 rayOrigin, float3 rayDirection, float capsuleHalfHeight, float capsuleRadius) => Jolt.PInvoke.RayCapsule(rayOrigin, rayDirection, capsuleHalfHeight, capsuleRadius);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayTriangle.h#L11">Jolt/Geometry/RayTriangle.h:11</see>
|
|
/// <br/>
|
|
/// <c>float RayTriangle(Vec3Arg inOrigin, Vec3Arg inDirection, Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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
|
|
/// </code>
|
|
/// </remarks>
|
|
public static float RayTriangle(float3 origin, float3 direction, float3 v0, float3 v1, float3 v2) => Jolt.PInvoke.RayTriangle(origin, direction, v0, v1, v2);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Geometry/RayTriangle.h#L76">Jolt/Geometry/RayTriangle.h:76</see>
|
|
/// <br/>
|
|
/// <c>Vec4 RayTriangle4(Vec3Arg inOrigin, Vec3Arg inDirection, Vec4Arg inV0X, Vec4Arg inV0Y, Vec4Arg inV0Z, Vec4Arg inV1X, Vec4Arg inV1Y, Vec4Arg inV1Z, Vec4Arg inV2X, Vec4Arg inV2Y, Vec4Arg inV2Z)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// 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)
|
|
/// </para>
|
|
/// </remarks>
|
|
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);
|
|
/// <summary>
|
|
/// <para>
|
|
/// The error message from the most recent failed Result-returning call on this thread, the text the
|
|
/// throwing wrappers (ShapeSettings.CreateShape and friends) report.
|
|
/// </para>
|
|
/// </summary>
|
|
public static string GetLastError() => Marshal.PtrToStringUTF8(Jolt.PInvoke.GetLastError()) ?? string.Empty;
|
|
}
|
|
}
|