mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
54 lines
2.1 KiB
C#
54 lines
2.1 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using System.Runtime.CompilerServices;
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/MortonCode.h#L11">Jolt/Geometry/MortonCode.h:11</see>
|
|
/// <br/>
|
|
/// <c>class MortonCode</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct MortonCode : IDisposable
|
|
{
|
|
public static MortonCode Create() => Jolt.PInvoke.MortonCode_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// First converts a floating point value in the range [0, 1] to a 10 bit fixed point integer. Then expands
|
|
/// a 10-bit integer into 30 bits by inserting 2 zeros after each bit.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/MortonCode.h#L16">Jolt/Geometry/MortonCode.h:16</see>
|
|
/// <br/>
|
|
/// <c>static uint32 sExpandBits(float inV)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint ExpandBits(float v) => Jolt.PInvoke.MortonCode_ExpandBits(v);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate the morton code for inVector, given that all vectors lie in inVectorBounds
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/MortonCode.h#L29">Jolt/Geometry/MortonCode.h:29</see>
|
|
/// <br/>
|
|
/// <c>static uint32 sGetMortonCode(Vec3Arg inVector, const AABox &inVectorBounds)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetMortonCode(float3 vector, in AABox vectorBounds) =>
|
|
Jolt.PInvoke.MortonCode_GetMortonCode(vector, in vectorBounds);
|
|
|
|
public void Dispose() => Jolt.PInvoke.MortonCode_Destroy(this);
|
|
}
|
|
}
|