diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0506908..a6df45f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,88 +20,150 @@ on: nuget-registry: description: 'NuGet registry' required: true - default: 'GitLab' + default: 'GitHub' type: choice options: - - GitLab + - GitHub - NuGet jobs: build: - runs-on: ${{ matrix.os }} + permissions: + packages: write + strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-13, windows-latest] + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 3.1.x - 5.0.x - 6.0.x - 7.0.x - 8.0.x - - - name: Set Version Suffix - shell: bash - run: | - if [ '${{ github.event.inputs.use-auto-generated-version }}' != 'false' ]; then - echo "NugetVersionSuffix=-dev-$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV - fi - - - name: Restore Dependencies - shell: bash - run: dotnet restore - - - name: Generate Bindings - shell: bash - run: dotnet run --project Box2D.NET.Bindgen - - - name: Build Projects - shell: bash - run: | - dotnet build -c Debug - dotnet build -c Release - - - name: Run Tests - shell: bash - run: dotnet test - - - name: Pack Nuget Packages - shell: bash - run: | - if [ '${{ github.event.inputs.nuget-registry }}' == 'NuGet' ]; then - dotnet pack --property:NugetVersionSuffix=$NugetVersionSuffix -c Debug - dotnet pack --property:NugetVersionSuffix=$NugetVersionSuffix -c Release - else - dotnet pack --property:NugetVersionSuffix=$NugetVersionSuffix --property:Box2DPackPdb=true -c Debug - dotnet pack --property:NugetVersionSuffix=$NugetVersionSuffix --property:Box2DPackPdb=true -c Release - fi - - - name: Upload Artifacts - if: matrix.os == 'ubuntu-latest' - uses: actions/upload-artifact@v3 - with: - name: Nuget Packages - path: | - **/Box2D.NET.*.nupkg - **/Box2D.NET.*.snupkg - - - name: Push NuGet Packages - if: matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' && github.event.inputs.push-packages == 'true' - shell: bash - run: | - if [ '${{ github.event.inputs.nuget-registry }}' == 'GitLab' ]; then - dotnet nuget push **/Box2D.NET.*.nupkg --api-key '${{ secrets.GITLAB_ACCESS_TOKEN }}' --source 'https://gitlab.com/api/v4/projects/53993416/packages/nuget/index.json' - elif [ '${{ github.event.inputs.nuget-registry }}' == 'NuGet' ]; then - dotnet nuget push **/Box2D.NET.*.nupkg --api-key '${{ secrets.NUGET_ACCESS_TOKEN }}' --source 'https://api.nuget.org/v3/index.json' - fi + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Set Version Suffix + shell: bash + run: | + if [ '${{ github.event.inputs.use-auto-generated-version }}' != 'false' ]; then + echo "BuildVersionSuffix=build.$(git rev-list --count HEAD)" >> $GITHUB_ENV + fi + + - name: Set IOS SDK Variables + if: matrix.os == 'macos-latest' + shell: bash + run: | + echo "IOS_SDK_SYSROOT=$(xcrun --sdk iphoneos --show-sdk-path)" >> $GITHUB_ENV + echo "IOS_SIMULATOR_SDK_SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path)" >> $GITHUB_ENV + + - name: Set Android NDK Variables + if: matrix.os == 'macos-latest' + shell: bash + run: | + echo "ANDROID_NDK=$(find "$ANDROID_SDK_ROOT/ndk/" -mindepth 1 -maxdepth 1 -type d | sort | head -n 1)" >> $GITHUB_ENV + echo "ANDROID_NDK_SYSROOT=$ANDROID_NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot" >> $GITHUB_ENV + + - name: Restore Dependencies + shell: bash + run: dotnet restore + + - name: Generate Bindings + shell: bash + run: dotnet run --project Box2D.NET.Bindgen + + - name: Build Projects + shell: bash + run: | + dotnet build -c Debug + dotnet build -c Release + + - name: Build Natives + shell: bash + if: matrix.os == 'macos-latest' + working-directory: Box2D.NET.Native + run: | + dotnet build -c Debug -r linux-x64 + dotnet build -c Debug -r linux-x86 + dotnet build -c Debug -r linux-arm64 + dotnet build -c Debug -r osx-x64 + dotnet build -c Debug -r osx-arm64 + dotnet build -c Debug -r win-x64 + dotnet build -c Debug -r win-x86 + dotnet build -c Debug -r win-arm64 + # dotnet build -c Debug -r browser-wasm + dotnet build -c Debug -r iossimulator-x64 + dotnet build -c Debug -r iossimulator-arm64 + dotnet build -c Debug -r ios-arm64 + dotnet build -c Debug -r android-arm64 + dotnet build -c Debug -r android-x64 + + dotnet build -c Release -r linux-x64 + dotnet build -c Release -r linux-x86 + dotnet build -c Release -r linux-arm64 + dotnet build -c Release -r osx-x64 + dotnet build -c Release -r osx-arm64 + dotnet build -c Release -r win-x64 + dotnet build -c Release -r win-x86 + dotnet build -c Release -r win-arm64 + # dotnet build -c Release -r browser-wasm + dotnet build -c Release -r iossimulator-x64 + dotnet build -c Release -r iossimulator-arm64 + dotnet build -c Release -r ios-arm64 + dotnet build -c Release -r android-arm64 + dotnet build -c Release -r android-x64 + + - name: Run Tests + shell: bash + run: dotnet test -p:SkipNatives=true + + - name: Pack Nuget Packages + shell: bash + run: | + dotnet pack --property:VersionSuffix=$BuildVersionSuffix -p:SkipNatives=true -p:BuildSelectorPackage=true + + if [ '${{ github.event.inputs.nuget-registry }}' == 'NuGet' ]; then + dotnet pack --property:VersionSuffix=$BuildVersionSuffix -p:SkipNatives=true -c Debug + dotnet pack --property:VersionSuffix=$BuildVersionSuffix -p:SkipNatives=true -c Release + else + dotnet pack --property:VersionSuffix=$BuildVersionSuffix --property:PackPdb=true -p:SkipNatives=true -c Debug + dotnet pack --property:VersionSuffix=$BuildVersionSuffix --property:PackPdb=true -p:SkipNatives=true -c Release + fi + + - name: Upload Artifacts + if: matrix.os == 'macos-latest' + uses: actions/upload-artifact@v4 + with: + name: Nuget Packages + path: | + **/Box2D.NET.*.nupkg + **/Box2D.NET.*.snupkg + + - name: Push NuGet Packages + if: > + matrix.os == 'macos-latest' && + github.repository_owner == 'BeanCheeseBurrito' && + ( + (github.event_name == 'workflow_dispatch' && github.event.inputs.push-packages == 'true') || + (github.event_name == 'push' && github.ref == 'refs/heads/main') + ) + shell: bash + run: | + if [ '${{ github.event_name }}' == 'workflow_dispatch' ]; then + if [ '${{ github.event.inputs.nuget-registry }}' == 'NuGet' ]; then + dotnet nuget push **/Box2D.NET.*.nupkg --skip-duplicate --api-key '${{ secrets.NUGET_ACCESS_TOKEN }}' --source 'https://api.nuget.org/v3/index.json' + elif [ '${{ github.event.inputs.nuget-registry }}' == 'GitHub' ]; then + dotnet nuget push **/Box2D.NET.*.nupkg --skip-duplicate --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' + fi + elif [ '${{ github.ref }}' == 'refs/heads/main' ]; then + dotnet nuget push **/Box2D.NET.*.nupkg --skip-duplicate --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' + fi diff --git a/Box2D.NET.Bindgen/Box2D.NET.Bindgen.csproj b/Box2D.NET.Bindgen/Box2D.NET.Bindgen.csproj index ec0391d..7a37e14 100644 --- a/Box2D.NET.Bindgen/Box2D.NET.Bindgen.csproj +++ b/Box2D.NET.Bindgen/Box2D.NET.Bindgen.csproj @@ -2,16 +2,33 @@ Exe - net7.0 + net8.0 enable enable false false + false $(NETCoreSdkRuntimeIdentifier) - + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/Box2D.NET.Bindgen/Program.cs b/Box2D.NET.Bindgen/Program.cs index c7b5576..6d844c6 100644 --- a/Box2D.NET.Bindgen/Program.cs +++ b/Box2D.NET.Bindgen/Program.cs @@ -1,39 +1,21 @@ using System.Runtime.CompilerServices; using Bindgen.NET; -const string library = "box2d"; - BindingOptions options = new() { Namespace = "Box2D.NET.Bindings", Class = "B2", - DllImportPath = library, - DllFilePaths = - { - library, - "lib" + library, - "runtimes/linux-x64/native/lib" + library, - "runtimes/linux-arm64/native/lib" + library, - "runtimes/osx-x64/native/lib" + library, - "runtimes/osx-arm64/native/lib" + library, - "runtimes/win-x64/native/" + library, - "runtimes/win-arm64/native/" + library - }, + DllImportPath = "box2d", - IncludeBuiltInClangHeaders = true, - IncludeDirectories = { GetNativeDirectory("include") }, + SystemIncludeDirectories = { Path.Combine(BuildConstants.ZigLibPath, "include") }, + IncludeDirectories = { GetIncludeDirectory() }, + OutputFile = GetOutputDirectory(), + InputFile = GetInputFile(), TreatInputFileAsRawSourceCode = true, - InputFile = """ - #include - #include - #include - #include - #include - #include - """, - OutputFile = GetOutputDirectory("B2.g.cs"), + + GenerateDisableRuntimeMarshallingAttribute = true, RemappedPrefixes = { @@ -55,11 +37,7 @@ ("b2World_", "World"), ("b2_", ""), ("b2", ""), - }, - - GenerateMacros = true, - GenerateExternVariables = true, - SuppressedWarnings = { "CS9084" } + } }; BindingGenerator.Generate(options); @@ -69,12 +47,22 @@ string GetCurrentFilePath([CallerFilePath] string filePath = "") return filePath; } -string GetNativeDirectory(string path) +string GetIncludeDirectory() { - return GetCurrentFilePath() + "/../../native/box2d/" + path; + return Path.GetFullPath(GetCurrentFilePath() + "/../../native/box2d/include"); } -string GetOutputDirectory(string fileName) +string GetOutputDirectory() { - return GetCurrentFilePath() + "/../../Box2D.NET.Bindings/" + fileName; + return GetCurrentFilePath() + "/../../Box2D.NET.Bindings/B2.g.cs"; +} + +// Generates an input file that includes all Box2D headers. +string GetInputFile() +{ + IEnumerable headerFiles = Directory + .EnumerateFiles(GetIncludeDirectory(), "*.h", SearchOption.AllDirectories) + .Select((string filePath) => $"#include <{Path.GetRelativePath(GetIncludeDirectory(), filePath)}>"); + + return string.Join('\n', headerFiles); } diff --git a/Box2D.NET.Bindings/B2.g.cs b/Box2D.NET.Bindings/B2.g.cs index 69ec726..06393a0 100644 --- a/Box2D.NET.Bindings/B2.g.cs +++ b/Box2D.NET.Bindings/B2.g.cs @@ -1,3157 +1,5841 @@ -#nullable enable -#pragma warning disable CS9084 -namespace Box2D.NET.Bindings -{ - public static unsafe partial class B2 - { - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Center", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 AABBCenter(AABB a); +#nullable enable +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; + +[assembly: DisableRuntimeMarshalling] +namespace Box2D.NET.Bindings; +public static unsafe partial class B2 +{ + public partial class BindgenInternal + { + public const string DllImportPath = @"box2d"; + } - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Contains", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte AABBContains(AABB a, AABB b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Center")] + public static extern Vec2 AABBCenter(AABB a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Extents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 AABBExtents(AABB a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Contains")] + public static extern bool AABBContains(AABB a, AABB b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte AABBIsValid(AABB aabb); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Extents")] + public static extern Vec2 AABBExtents(AABB a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Union", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB AABBUnion(AABB a, AABB b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Union")] + public static extern AABB AABBUnion(AABB a, AABB b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Abs", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Abs(Vec2 a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Abs")] + public static extern Vec2 Abs(Vec2 a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AbsFloat", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float AbsFloat(float a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AbsFloat")] + public static extern float AbsFloat(float a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AbsInt", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int AbsInt(int a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AbsInt")] + public static extern int AbsInt(int a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Add", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Add(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Add")] + public static extern Vec2 Add(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyAngularImpulse", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyAngularImpulse(BodyId bodyId, float impulse, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Atan2")] + public static extern float Atan2(float y, float x); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyForce(BodyId bodyId, Vec2 force, Vec2 point, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyAngularImpulse")] + public static extern void BodyApplyAngularImpulse(BodyId bodyId, float impulse, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyForceToCenter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyForceToCenter(BodyId bodyId, Vec2 force, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyForce")] + public static extern void BodyApplyForce(BodyId bodyId, Vec2 force, Vec2 point, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyLinearImpulse", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyLinearImpulse(BodyId bodyId, Vec2 impulse, Vec2 point, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyForceToCenter")] + public static extern void BodyApplyForceToCenter(BodyId bodyId, Vec2 force, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyLinearImpulseToCenter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyLinearImpulseToCenter(BodyId bodyId, Vec2 impulse, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyLinearImpulse")] + public static extern void BodyApplyLinearImpulse(BodyId bodyId, Vec2 impulse, Vec2 point, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyMassFromShapes", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyMassFromShapes(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyLinearImpulseToCenter")] + public static extern void BodyApplyLinearImpulseToCenter(BodyId bodyId, Vec2 impulse, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyApplyTorque(BodyId bodyId, float torque, byte wake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyMassFromShapes")] + public static extern void BodyApplyMassFromShapes(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ComputeAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB BodyComputeAABB(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyTorque")] + public static extern void BodyApplyTorque(BodyId bodyId, float torque, bool wake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_Disable", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyDisable(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ComputeAABB")] + public static extern AABB BodyComputeAABB(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_Enable", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyEnable(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_Disable")] + public static extern void BodyDisable(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableHitEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyEnableHitEvents(BodyId bodyId, byte enableHitEvents); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_Enable")] + public static extern void BodyEnable(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableSleep", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyEnableSleep(BodyId bodyId, byte enableSleep); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableContactEvents")] + public static extern void BodyEnableContactEvents(BodyId bodyId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAngularDamping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetAngularDamping(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableHitEvents")] + public static extern void BodyEnableHitEvents(BodyId bodyId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetAngularVelocity(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableSleep")] + public static extern void BodyEnableSleep(BodyId bodyId, bool enableSleep); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAutomaticMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyGetAutomaticMass(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAngularDamping")] + public static extern float BodyGetAngularDamping(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetContactCapacity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetContactCapacity(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAngularVelocity")] + public static extern float BodyGetAngularVelocity(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetContactData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetContactData(BodyId bodyId, ContactData* contactData, int capacity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetContactCapacity")] + public static extern int BodyGetContactCapacity(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetGravityScale", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetGravityScale(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetContactData")] + public static extern int BodyGetContactData(BodyId bodyId, ContactData* contactData, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetInertiaTensor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetInertiaTensor(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetGravityScale")] + public static extern float BodyGetGravityScale(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetJointCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetJointCount(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetJointCount")] + public static extern int BodyGetJointCount(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetJoints", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetJoints(BodyId bodyId, JointId* jointArray, int capacity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetJoints")] + public static extern int BodyGetJoints(BodyId bodyId, JointId* jointArray, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLinearDamping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetLinearDamping(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLinearDamping")] + public static extern float BodyGetLinearDamping(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLinearVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetLinearVelocity(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLinearVelocity")] + public static extern Vec2 BodyGetLinearVelocity(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalCenterOfMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetLocalCenterOfMass(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalCenterOfMass")] + public static extern Vec2 BodyGetLocalCenterOfMass(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetLocalPoint(BodyId bodyId, Vec2 worldPoint); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalPoint")] + public static extern Vec2 BodyGetLocalPoint(BodyId bodyId, Vec2 worldPoint); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetLocalVector(BodyId bodyId, Vec2 worldVector); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalPointVelocity")] + public static extern Vec2 BodyGetLocalPointVelocity(BodyId bodyId, Vec2 localPoint); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetMass(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalVector")] + public static extern Vec2 BodyGetLocalVector(BodyId bodyId, Vec2 worldVector); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetMassData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MassData BodyGetMassData(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetMass")] + public static extern float BodyGetMass(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetPosition", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetPosition(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetMassData")] + public static extern MassData BodyGetMassData(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot BodyGetRotation(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetName")] + public static extern byte* BodyGetName(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetShapeCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetShapeCount(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetPosition")] + public static extern Vec2 BodyGetPosition(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetShapes", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int BodyGetShapes(BodyId bodyId, ShapeId* shapeArray, int capacity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetRotation")] + public static extern Rot BodyGetRotation(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetSleepThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetSleepThreshold(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetRotationalInertia")] + public static extern float BodyGetRotationalInertia(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Transform BodyGetTransform(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetShapeCount")] + public static extern int BodyGetShapeCount(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetType", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyType BodyGetType(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetShapes")] + public static extern int BodyGetShapes(BodyId bodyId, ShapeId* shapeArray, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void* BodyGetUserData(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetSleepThreshold")] + public static extern float BodyGetSleepThreshold(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldCenterOfMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetWorldCenterOfMass(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetTransform")] + public static extern Transform BodyGetTransform(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetWorldPoint(BodyId bodyId, Vec2 localPoint); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetType")] + public static extern BodyType BodyGetType(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 BodyGetWorldVector(BodyId bodyId, Vec2 localVector); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetUserData")] + public static extern void* BodyGetUserData(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsAwake", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsAwake(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorld")] + public static extern WorldId BodyGetWorld(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsBullet", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsBullet(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldCenterOfMass")] + public static extern Vec2 BodyGetWorldCenterOfMass(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsEnabled(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldPoint")] + public static extern Vec2 BodyGetWorldPoint(BodyId bodyId, Vec2 localPoint); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsFixedRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsFixedRotation(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldPointVelocity")] + public static extern Vec2 BodyGetWorldPointVelocity(BodyId bodyId, Vec2 worldPoint); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsSleepEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsSleepEnabled(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldVector")] + public static extern Vec2 BodyGetWorldVector(BodyId bodyId, Vec2 localVector); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyIsValid(BodyId id); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsAwake")] + public static extern bool BodyIsAwake(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAngularDamping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetAngularDamping(BodyId bodyId, float angularDamping); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsBullet")] + public static extern bool BodyIsBullet(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetAngularVelocity(BodyId bodyId, float angularVelocity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsEnabled")] + public static extern bool BodyIsEnabled(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAutomaticMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetAutomaticMass(BodyId bodyId, byte automaticMass); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsFixedRotation")] + public static extern bool BodyIsFixedRotation(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAwake", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetAwake(BodyId bodyId, byte awake); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsSleepEnabled")] + public static extern bool BodyIsSleepEnabled(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetBullet", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetBullet(BodyId bodyId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsValid")] + public static extern bool BodyIsValid(BodyId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetFixedRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetFixedRotation(BodyId bodyId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAngularDamping")] + public static extern void BodySetAngularDamping(BodyId bodyId, float angularDamping); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetGravityScale", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetGravityScale(BodyId bodyId, float gravityScale); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAngularVelocity")] + public static extern void BodySetAngularVelocity(BodyId bodyId, float angularVelocity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetLinearDamping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetLinearDamping(BodyId bodyId, float linearDamping); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAwake")] + public static extern void BodySetAwake(BodyId bodyId, bool awake); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetLinearVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetLinearVelocity(BodyId bodyId, Vec2 linearVelocity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetBullet")] + public static extern void BodySetBullet(BodyId bodyId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetMassData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetMassData(BodyId bodyId, MassData massData); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetFixedRotation")] + public static extern void BodySetFixedRotation(BodyId bodyId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetSleepThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetSleepThreshold(BodyId bodyId, float sleepVelocity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetGravityScale")] + public static extern void BodySetGravityScale(BodyId bodyId, float gravityScale); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetTransform(BodyId bodyId, Vec2 position, Rot rotation); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetLinearDamping")] + public static extern void BodySetLinearDamping(BodyId bodyId, float linearDamping); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetType", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetType(BodyId bodyId, BodyType type); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetLinearVelocity")] + public static extern void BodySetLinearVelocity(BodyId bodyId, Vec2 linearVelocity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetUserData(BodyId bodyId, void* userData); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetMassData")] + public static extern void BodySetMassData(BodyId bodyId, MassData massData); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ChainIsValid(ChainId id); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetName")] + public static extern void BodySetName(BodyId bodyId, byte* name); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ChainSetFriction(ChainId chainId, float friction); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetSleepThreshold")] + public static extern void BodySetSleepThreshold(BodyId bodyId, float sleepThreshold); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ChainSetRestitution(ChainId chainId, float restitution); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetTargetTransform")] + public static extern void BodySetTargetTransform(BodyId bodyId, Transform target, float timeStep); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Clamp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Clamp(Vec2 v, Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetTransform")] + public static extern void BodySetTransform(BodyId bodyId, Vec2 position, Rot rotation); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClampFloat", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float ClampFloat(float a, float lower, float upper); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetType")] + public static extern void BodySetType(BodyId bodyId, BodyType type); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClampInt", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int ClampInt(int a, int lower, int upper); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetUserData")] + public static extern void BodySetUserData(BodyId bodyId, void* userData); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsuleAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideCapsuleAndCircle(Capsule* capsuleA, Transform xfA, Circle* circleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetFriction")] + public static extern float ChainGetFriction(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsules", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideCapsules(Capsule* capsuleA, Transform xfA, Capsule* capsuleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetMaterial")] + public static extern int ChainGetMaterial(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCircles", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideCircles(Circle* circleA, Transform xfA, Circle* circleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetRestitution")] + public static extern float ChainGetRestitution(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygonAndCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollidePolygonAndCapsule(Polygon* polygonA, Transform xfA, Capsule* capsuleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetSegmentCount")] + public static extern int ChainGetSegmentCount(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygonAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollidePolygonAndCircle(Polygon* polygonA, Transform xfA, Circle* circleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetSegments")] + public static extern int ChainGetSegments(ChainId chainId, ShapeId* segmentArray, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygons", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollidePolygons(Polygon* polygonA, Transform xfA, Polygon* polygonB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetWorld")] + public static extern WorldId ChainGetWorld(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSegmentAndCapsule(Segment* segmentA, Transform xfA, Capsule* capsuleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_IsValid")] + public static extern bool ChainIsValid(ChainId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSegmentAndCircle(Segment* segmentA, Transform xfA, Circle* circleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetFriction")] + public static extern void ChainSetFriction(ChainId chainId, float friction); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSegmentAndPolygon(Segment* segmentA, Transform xfA, Polygon* polygonB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetMaterial")] + public static extern void ChainSetMaterial(ChainId chainId, int material); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndCapsule(SmoothSegment* smoothSegmentA, Transform xfA, Capsule* capsuleB, Transform xfB, DistanceCache* cache); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetRestitution")] + public static extern void ChainSetRestitution(ChainId chainId, float restitution); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndCircle(SmoothSegment* smoothSegmentA, Transform xfA, Circle* circleB, Transform xfB); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Clamp")] + public static extern Vec2 Clamp(Vec2 v, Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndPolygon(SmoothSegment* smoothSegmentA, Transform xfA, Polygon* polygonB, Transform xfB, DistanceCache* cache); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClampFloat")] + public static extern float ClampFloat(float a, float lower, float upper); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float ComputeAngularVelocity(Rot q1, Rot q2, float inv_h); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClampInt")] + public static extern int ClampInt(int a, int lower, int upper); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCapsuleAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB ComputeCapsuleAABB(Capsule* shape, Transform transform); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClipVector")] + public static extern Vec2 ClipVector(Vec2 vector, CollisionPlane* planes, int count); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCapsuleMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MassData ComputeCapsuleMass(Capsule* shape, float density); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsuleAndCircle")] + public static extern Manifold CollideCapsuleAndCircle(Capsule* capsuleA, Transform xfA, Circle* circleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCircleAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB ComputeCircleAABB(Circle* shape, Transform transform); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsules")] + public static extern Manifold CollideCapsules(Capsule* capsuleA, Transform xfA, Capsule* capsuleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCircleMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MassData ComputeCircleMass(Circle* shape, float density); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndCapsule")] + public static extern Manifold CollideChainSegmentAndCapsule(ChainSegment* segmentA, Transform xfA, Capsule* capsuleB, Transform xfB, SimplexCache* cache); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeHull", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Hull ComputeHull(Vec2* points, int count); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndCircle")] + public static extern Manifold CollideChainSegmentAndCircle(ChainSegment* segmentA, Transform xfA, Circle* circleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputePolygonAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB ComputePolygonAABB(Polygon* shape, Transform transform); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndPolygon")] + public static extern Manifold CollideChainSegmentAndPolygon(ChainSegment* segmentA, Transform xfA, Polygon* polygonB, Transform xfB, SimplexCache* cache); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputePolygonMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MassData ComputePolygonMass(Polygon* shape, float density); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCircles")] + public static extern Manifold CollideCircles(Circle* circleA, Transform xfA, Circle* circleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeSegmentAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB ComputeSegmentAABB(Segment* shape, Transform transform); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygonAndCapsule")] + public static extern Manifold CollidePolygonAndCapsule(Polygon* polygonA, Transform xfA, Capsule* capsuleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateBody", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyId CreateBody(WorldId worldId, BodyDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygonAndCircle")] + public static extern Manifold CollidePolygonAndCircle(Polygon* polygonA, Transform xfA, Circle* circleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateCapsuleShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeId CreateCapsuleShape(BodyId bodyId, ShapeDef* def, Capsule* capsule); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollidePolygons")] + public static extern Manifold CollidePolygons(Polygon* polygonA, Transform xfA, Polygon* polygonB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateChain", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ChainId CreateChain(BodyId bodyId, ChainDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndCapsule")] + public static extern Manifold CollideSegmentAndCapsule(Segment* segmentA, Transform xfA, Capsule* capsuleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateCircleShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeId CreateCircleShape(BodyId bodyId, ShapeDef* def, Circle* circle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndCircle")] + public static extern Manifold CollideSegmentAndCircle(Segment* segmentA, Transform xfA, Circle* circleB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateDistanceJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateDistanceJoint(WorldId worldId, DistanceJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndPolygon")] + public static extern Manifold CollideSegmentAndPolygon(Segment* segmentA, Transform xfA, Polygon* polygonB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateMotorJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateMotorJoint(WorldId worldId, MotorJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeAngularVelocity")] + public static extern float ComputeAngularVelocity(Rot q1, Rot q2, float inv_h); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateMouseJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateMouseJoint(WorldId worldId, MouseJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCapsuleAABB")] + public static extern AABB ComputeCapsuleAABB(Capsule* shape, Transform transform); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreatePolygonShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeId CreatePolygonShape(BodyId bodyId, ShapeDef* def, Polygon* polygon); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCapsuleMass")] + public static extern MassData ComputeCapsuleMass(Capsule* shape, float density); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreatePrismaticJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreatePrismaticJoint(WorldId worldId, PrismaticJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCircleAABB")] + public static extern AABB ComputeCircleAABB(Circle* shape, Transform transform); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateRevoluteJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateRevoluteJoint(WorldId worldId, RevoluteJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCircleMass")] + public static extern MassData ComputeCircleMass(Circle* shape, float density); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateSegmentShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeId CreateSegmentShape(BodyId bodyId, ShapeDef* def, Segment* segment); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCosSin")] + public static extern CosSin ComputeCosSin(float radians); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateTimer", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Timer CreateTimer(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeHull")] + public static extern Hull ComputeHull(Vec2* points, int count); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWeldJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateWeldJoint(WorldId worldId, WeldJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputePolygonAABB")] + public static extern AABB ComputePolygonAABB(Polygon* shape, Transform transform); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWheelJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointId CreateWheelJoint(WorldId worldId, WheelJointDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputePolygonMass")] + public static extern MassData ComputePolygonMass(Polygon* shape, float density); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern WorldId CreateWorld(WorldDef* def); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeRotationBetweenUnitVectors")] + public static extern Rot ComputeRotationBetweenUnitVectors(Vec2 v1, Vec2 v2); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Cross", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float Cross(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeSegmentAABB")] + public static extern AABB ComputeSegmentAABB(Segment* shape, Transform transform); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CrossSV", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 CrossSV(float s, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateBody")] + public static extern BodyId CreateBody(WorldId worldId, BodyDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CrossVS", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 CrossVS(Vec2 v, float s); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateCapsuleShape")] + public static extern ShapeId CreateCapsuleShape(BodyId bodyId, ShapeDef* def, Capsule* capsule); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultBodyDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyDef DefaultBodyDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateChain")] + public static extern ChainId CreateChain(BodyId bodyId, ChainDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultChainDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ChainDef DefaultChainDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateCircleShape")] + public static extern ShapeId CreateCircleShape(BodyId bodyId, ShapeDef* def, Circle* circle); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultDistanceJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DistanceJointDef DefaultDistanceJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateDistanceJoint")] + public static extern JointId CreateDistanceJoint(WorldId worldId, DistanceJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Filter DefaultFilter(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateFilterJoint")] + public static extern JointId CreateFilterJoint(WorldId worldId, FilterJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultMotorJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MotorJointDef DefaultMotorJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateMotorJoint")] + public static extern JointId CreateMotorJoint(WorldId worldId, MotorJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultMouseJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern MouseJointDef DefaultMouseJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateMouseJoint")] + public static extern JointId CreateMouseJoint(WorldId worldId, MouseJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultPrismaticJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern PrismaticJointDef DefaultPrismaticJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreatePolygonShape")] + public static extern ShapeId CreatePolygonShape(BodyId bodyId, ShapeDef* def, Polygon* polygon); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultQueryFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern QueryFilter DefaultQueryFilter(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreatePrismaticJoint")] + public static extern JointId CreatePrismaticJoint(WorldId worldId, PrismaticJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultRevoluteJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern RevoluteJointDef DefaultRevoluteJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateRevoluteJoint")] + public static extern JointId CreateRevoluteJoint(WorldId worldId, RevoluteJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultShapeDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeDef DefaultShapeDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateSegmentShape")] + public static extern ShapeId CreateSegmentShape(BodyId bodyId, ShapeDef* def, Segment* segment); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWeldJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern WeldJointDef DefaultWeldJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWeldJoint")] + public static extern JointId CreateWeldJoint(WorldId worldId, WeldJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWheelJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern WheelJointDef DefaultWheelJointDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWheelJoint")] + public static extern JointId CreateWheelJoint(WorldId worldId, WheelJointDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWorldDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern WorldDef DefaultWorldDef(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWorld")] + public static extern WorldId CreateWorld(WorldDef* def); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyBody", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyBody(BodyId bodyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Cross")] + public static extern float Cross(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyChain", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyChain(ChainId chainId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CrossSV")] + public static extern Vec2 CrossSV(float s, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyJoint(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CrossVS")] + public static extern Vec2 CrossVS(Vec2 v, float s); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyShape(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultBodyDef")] + public static extern BodyDef DefaultBodyDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyWorld(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultChainDef")] + public static extern ChainDef DefaultChainDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Distance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float Distance(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultDebugDraw")] + public static extern DebugDraw DefaultDebugDraw(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointEnableLimit(JointId jointId, byte enableLimit); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultDistanceJointDef")] + public static extern DistanceJointDef DefaultDistanceJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableMotor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointEnableMotor(JointId jointId, byte enableMotor); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultExplosionDef")] + public static extern ExplosionDef DefaultExplosionDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableSpring", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointEnableSpring(JointId jointId, byte enableSpring); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultFilter")] + public static extern Filter DefaultFilter(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetCurrentLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetCurrentLength(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultFilterJointDef")] + public static extern FilterJointDef DefaultFilterJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultMotorJointDef")] + public static extern MotorJointDef DefaultMotorJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultMouseJointDef")] + public static extern MouseJointDef DefaultMouseJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetLength(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultPrismaticJointDef")] + public static extern PrismaticJointDef DefaultPrismaticJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMaxLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetMaxLength(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultQueryFilter")] + public static extern QueryFilter DefaultQueryFilter(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetMaxMotorForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultRevoluteJointDef")] + public static extern RevoluteJointDef DefaultRevoluteJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMinLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetMinLength(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultShapeDef")] + public static extern ShapeDef DefaultShapeDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetMotorForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultSurfaceMaterial")] + public static extern SurfaceMaterial DefaultSurfaceMaterial(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetMotorSpeed(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWeldJointDef")] + public static extern WeldJointDef DefaultWeldJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte DistanceJointIsLimitEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWheelJointDef")] + public static extern WheelJointDef DefaultWheelJointDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte DistanceJointIsMotorEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWorldDef")] + public static extern WorldDef DefaultWorldDef(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsSpringEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte DistanceJointIsSpringEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyBody")] + public static extern void DestroyBody(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetLength(JointId jointId, float length); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyChain")] + public static extern void DestroyChain(ChainId chainId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetLengthRange", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetLengthRange(JointId jointId, float minLength, float maxLength); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyJoint")] + public static extern void DestroyJoint(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetMaxMotorForce(JointId jointId, float force); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyShape")] + public static extern void DestroyShape(ShapeId shapeId, bool updateBodyMass); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetMotorSpeed(JointId jointId, float motorSpeed); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyWorld")] + public static extern void DestroyWorld(WorldId worldId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetSpringDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Distance")] + public static extern float Distance(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DistanceJointSetSpringHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableLimit")] + public static extern void DistanceJointEnableLimit(JointId jointId, bool enableLimit); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceSquared", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceSquared(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableMotor")] + public static extern void DistanceJointEnableMotor(JointId jointId, bool enableMotor); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Dot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float Dot(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_EnableSpring")] + public static extern void DistanceJointEnableSpring(JointId jointId, bool enableSpring); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Create", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DynamicTree DynamicTreeCreate(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetCurrentLength")] + public static extern float DistanceJointGetCurrentLength(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_CreateProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeCreateProxy(DynamicTree* tree, AABB aabb, uint categoryBits, int userData); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetLength")] + public static extern float DistanceJointGetLength(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Destroy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeDestroy(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMaxLength")] + public static extern float DistanceJointGetMaxLength(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_DestroyProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeDestroyProxy(DynamicTree* tree, int proxyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMaxMotorForce")] + public static extern float DistanceJointGetMaxMotorForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_EnlargeProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeEnlargeProxy(DynamicTree* tree, int proxyId, AABB aabb); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMinLength")] + public static extern float DistanceJointGetMinLength(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB DynamicTreeGetAABB(DynamicTree* tree, int proxyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMotorForce")] + public static extern float DistanceJointGetMotorForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetAreaRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DynamicTreeGetAreaRatio(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMotorSpeed")] + public static extern float DistanceJointGetMotorSpeed(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetByteCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetByteCount(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetSpringDampingRatio")] + public static extern float DistanceJointGetSpringDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetHeight", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetHeight(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetSpringHertz")] + public static extern float DistanceJointGetSpringHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetMaxBalance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetMaxBalance(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsLimitEnabled")] + public static extern bool DistanceJointIsLimitEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetProxyCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetProxyCount(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsMotorEnabled")] + public static extern bool DistanceJointIsMotorEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetUserData(DynamicTree* tree, int proxyId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsSpringEnabled")] + public static extern bool DistanceJointIsSpringEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_MoveProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeMoveProxy(DynamicTree* tree, int proxyId, AABB aabb); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetLength")] + public static extern void DistanceJointSetLength(JointId jointId, float length); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Query", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeQuery(DynamicTree* tree, AABB aabb, uint maskBits, System.IntPtr callback, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetLengthRange")] + public static extern void DistanceJointSetLengthRange(JointId jointId, float minLength, float maxLength); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_RayCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeRayCast(DynamicTree* tree, RayCastInput* input, uint maskBits, System.IntPtr callback, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetMaxMotorForce")] + public static extern void DistanceJointSetMaxMotorForce(JointId jointId, float force); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Rebuild", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeRebuild(DynamicTree* tree, byte fullBuild); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetMotorSpeed")] + public static extern void DistanceJointSetMotorSpeed(JointId jointId, float motorSpeed); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_RebuildBottomUp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeRebuildBottomUp(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetSpringDampingRatio")] + public static extern void DistanceJointSetSpringDampingRatio(JointId jointId, float dampingRatio); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ShapeCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeShapeCast(DynamicTree* tree, ShapeCastInput* input, uint maskBits, System.IntPtr callback, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_SetSpringHertz")] + public static extern void DistanceJointSetSpringHertz(JointId jointId, float hertz); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ShiftOrigin", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeShiftOrigin(DynamicTree* tree, Vec2 newOrigin); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceSquared")] + public static extern float DistanceSquared(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Validate", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeValidate(DynamicTree* tree); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Dot")] + public static extern float Dot(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetByteCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int GetByteCount(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Create")] + public static extern DynamicTree DynamicTreeCreate(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetInverse22", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Mat22 GetInverse22(Mat22 A); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_CreateProxy")] + public static extern int DynamicTreeCreateProxy(DynamicTree* tree, AABB aabb, ulong categoryBits, ulong userData); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetLengthAndNormalize", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 GetLengthAndNormalize(float* length, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Destroy")] + public static extern void DynamicTreeDestroy(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetLengthUnitsPerMeter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float GetLengthUnitsPerMeter(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_DestroyProxy")] + public static extern void DynamicTreeDestroyProxy(DynamicTree* tree, int proxyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMilliseconds", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float GetMilliseconds(Timer* timer); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_EnlargeProxy")] + public static extern void DynamicTreeEnlargeProxy(DynamicTree* tree, int proxyId, AABB aabb); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMillisecondsAndReset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float GetMillisecondsAndReset(Timer* timer); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetAABB")] + public static extern AABB DynamicTreeGetAABB(DynamicTree* tree, int proxyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetSweepTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Transform GetSweepTransform(Sweep* sweep, float time); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetAreaRatio")] + public static extern float DynamicTreeGetAreaRatio(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetTicks", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern long GetTicks(Timer* timer); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetByteCount")] + public static extern int DynamicTreeGetByteCount(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetVersion", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Version GetVersion(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetCategoryBits")] + public static extern ulong DynamicTreeGetCategoryBits(DynamicTree* tree, int proxyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IntegrateRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot IntegrateRotation(Rot q1, float deltaAngle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetHeight")] + public static extern int DynamicTreeGetHeight(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvMulRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot InvMulRot(Rot q, Rot r); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetProxyCount")] + public static extern int DynamicTreeGetProxyCount(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvMulTransforms", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Transform InvMulTransforms(Transform A, Transform B); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetRootBounds")] + public static extern AABB DynamicTreeGetRootBounds(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvRotateVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 InvRotateVector(Rot q, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetUserData")] + public static extern ulong DynamicTreeGetUserData(DynamicTree* tree, int proxyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvTransformPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 InvTransformPoint(Transform t, Vec2 p); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_MoveProxy")] + public static extern void DynamicTreeMoveProxy(DynamicTree* tree, int proxyId, AABB aabb); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsNormalized", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte IsNormalized(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Query")] + public static extern TreeStats DynamicTreeQuery(DynamicTree* tree, AABB aabb, ulong maskBits, delegate* unmanaged callback, void* context); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte IsValid(float a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_RayCast")] + public static extern TreeStats DynamicTreeRayCast(DynamicTree* tree, RayCastInput* input, ulong maskBits, delegate* unmanaged callback, void* context); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidRay", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte IsValidRay(RayCastInput* input); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Rebuild")] + public static extern int DynamicTreeRebuild(DynamicTree* tree, bool fullBuild); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetBodyA", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyId JointGetBodyA(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_SetCategoryBits")] + public static extern void DynamicTreeSetCategoryBits(DynamicTree* tree, int proxyId, ulong categoryBits); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetBodyB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyId JointGetBodyB(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ShapeCast")] + public static extern TreeStats DynamicTreeShapeCast(DynamicTree* tree, ShapeCastInput* input, ulong maskBits, delegate* unmanaged callback, void* context); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetCollideConnected", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte JointGetCollideConnected(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Validate")] + public static extern void DynamicTreeValidate(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetConstraintForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 JointGetConstraintForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ValidateNoEnlarged")] + public static extern void DynamicTreeValidateNoEnlarged(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetConstraintTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float JointGetConstraintTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetByteCount")] + public static extern int GetByteCount(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetLocalAnchorA", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 JointGetLocalAnchorA(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetInverse22")] + public static extern Mat22 GetInverse22(Mat22 A); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetLocalAnchorB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 JointGetLocalAnchorB(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetLengthAndNormalize")] + public static extern Vec2 GetLengthAndNormalize(float* length, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetType", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern JointType JointGetType(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetLengthUnitsPerMeter")] + public static extern float GetLengthUnitsPerMeter(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void* JointGetUserData(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMilliseconds")] + public static extern float GetMilliseconds(ulong ticks); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte JointIsValid(JointId id); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMillisecondsAndReset")] + public static extern float GetMillisecondsAndReset(ulong* ticks); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_SetCollideConnected", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void JointSetCollideConnected(JointId jointId, byte shouldCollide); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetSweepTransform")] + public static extern Transform GetSweepTransform(Sweep* sweep, float time); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void JointSetUserData(JointId jointId, void* userData); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetTicks")] + public static extern ulong GetTicks(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_WakeBodies", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void JointWakeBodies(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetVersion")] + public static extern Version GetVersion(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LeftPerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 LeftPerp(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Hash")] + public static extern uint Hash(uint hash, byte* data, int count); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Length", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float Length(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IntegrateRotation")] + public static extern Rot IntegrateRotation(Rot q1, float deltaAngle); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LengthSquared", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float LengthSquared(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InternalAssertFcn")] + public static extern int InternalAssertFcn(byte* condition, byte* fileName, int lineNumber); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Lerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Lerp(Vec2 a, Vec2 b, float t); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvMulRot")] + public static extern Rot InvMulRot(Rot q, Rot r); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeBox(float hx, float hy); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvMulTransforms")] + public static extern Transform InvMulTransforms(Transform A, Transform B); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeOffsetBox(float hx, float hy, Vec2 center, float angle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvRotateVector")] + public static extern Vec2 InvRotateVector(Rot q, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeOffsetPolygon(Hull* hull, float radius, Transform transform); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvTransformPoint")] + public static extern Vec2 InvTransformPoint(Transform t, Vec2 p); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakePolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakePolygon(Hull* hull, float radius); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsNormalized")] + public static extern bool IsNormalized(Vec2 a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DistanceProxy MakeProxy(Vec2* vertices, int count, float radius); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsNormalizedRot")] + public static extern bool IsNormalizedRot(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot MakeRot(float angle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidAABB")] + public static extern bool IsValidAABB(AABB aabb); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRoundedBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeRoundedBox(float hx, float hy, float radius); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidFloat")] + public static extern bool IsValidFloat(float a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeSquare", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeSquare(float h); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidPlane")] + public static extern bool IsValidPlane(Plane a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Max", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Max(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidRay")] + public static extern bool IsValidRay(RayCastInput* input); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MaxFloat", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MaxFloat(float a, float b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidRotation")] + public static extern bool IsValidRotation(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MaxInt", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int MaxInt(int a, int b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidVec2")] + public static extern bool IsValidVec2(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Min", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Min(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetBodyA")] + public static extern BodyId JointGetBodyA(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MinFloat", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MinFloat(float a, float b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetBodyB")] + public static extern BodyId JointGetBodyB(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MinInt", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int MinInt(int a, int b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetCollideConnected")] + public static extern bool JointGetCollideConnected(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetAngularOffset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MotorJointGetAngularOffset(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetConstraintForce")] + public static extern Vec2 JointGetConstraintForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetCorrectionFactor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MotorJointGetCorrectionFactor(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetConstraintTorque")] + public static extern float JointGetConstraintTorque(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetLinearOffset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MotorJointGetLinearOffset(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetLocalAnchorA")] + public static extern Vec2 JointGetLocalAnchorA(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetMaxForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MotorJointGetMaxForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetLocalAnchorB")] + public static extern Vec2 JointGetLocalAnchorB(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetMaxTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MotorJointGetMaxTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetType")] + public static extern JointType JointGetType(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetAngularOffset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MotorJointSetAngularOffset(JointId jointId, float angularOffset); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetUserData")] + public static extern void* JointGetUserData(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetCorrectionFactor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MotorJointSetCorrectionFactor(JointId jointId, float correctionFactor); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetWorld")] + public static extern WorldId JointGetWorld(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetLinearOffset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MotorJointSetLinearOffset(JointId jointId, Vec2 linearOffset); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_IsValid")] + public static extern bool JointIsValid(JointId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetMaxForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MotorJointSetMaxForce(JointId jointId, float maxForce); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_SetCollideConnected")] + public static extern void JointSetCollideConnected(JointId jointId, bool shouldCollide); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetMaxTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MotorJointSetMaxTorque(JointId jointId, float maxTorque); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_SetUserData")] + public static extern void JointSetUserData(JointId jointId, void* userData); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetMaxForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MouseJointGetMaxForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_WakeBodies")] + public static extern void JointWakeBodies(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MouseJointGetSpringDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LeftPerp")] + public static extern Vec2 LeftPerp(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float MouseJointGetSpringHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Length")] + public static extern float Length(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetTarget", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MouseJointGetTarget(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LengthSquared")] + public static extern float LengthSquared(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetMaxForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MouseJointSetMaxForce(JointId jointId, float maxForce); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Lerp")] + public static extern Vec2 Lerp(Vec2 a, Vec2 b, float t); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MouseJointSetSpringDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadBodyId")] + public static extern BodyId LoadBodyId(ulong x); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MouseJointSetSpringHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadChainId")] + public static extern ChainId LoadChainId(ulong x); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetTarget", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void MouseJointSetTarget(JointId jointId, Vec2 target); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadJointId")] + public static extern JointId LoadJointId(ulong x); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Mul", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Mul(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadShapeId")] + public static extern ShapeId LoadShapeId(ulong x); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulAdd", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MulAdd(Vec2 a, float s, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeAABB")] + public static extern AABB MakeAABB(Vec2* points, int count, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulMV", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MulMV(Mat22 A, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeBox")] + public static extern Polygon MakeBox(float halfWidth, float halfHeight); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot MulRot(Rot q, Rot r); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetBox")] + public static extern Polygon MakeOffsetBox(float halfWidth, float halfHeight, Vec2 center, Rot rotation); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulSub", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MulSub(Vec2 a, float s, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetPolygon")] + public static extern Polygon MakeOffsetPolygon(Hull* hull, Vec2 position, Rot rotation); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulSV", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 MulSV(float s, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetProxy")] + public static extern ShapeProxy MakeOffsetProxy(Vec2* points, int count, float radius, Vec2 position, Rot rotation); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulTransforms", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Transform MulTransforms(Transform A, Transform B); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetRoundedBox")] + public static extern Polygon MakeOffsetRoundedBox(float halfWidth, float halfHeight, Vec2 center, Rot rotation, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Neg", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Neg(Vec2 a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetRoundedPolygon")] + public static extern Polygon MakeOffsetRoundedPolygon(Hull* hull, Vec2 position, Rot rotation, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NLerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot NLerp(Rot q1, Rot q2, float t); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakePolygon")] + public static extern Polygon MakePolygon(Hull* hull, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Normalize", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Normalize(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeProxy")] + public static extern ShapeProxy MakeProxy(Vec2* points, int count, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NormalizeChecked", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 NormalizeChecked(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRot")] + public static extern Rot MakeRot(float radians); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NormalizeRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot NormalizeRot(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRoundedBox")] + public static extern Polygon MakeRoundedBox(float halfWidth, float halfHeight, float radius); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PointInCapsule(Vec2 point, Capsule* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeSquare")] + public static extern Polygon MakeSquare(float halfWidth); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PointInCircle(Vec2 point, Circle* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Max")] + public static extern Vec2 Max(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PointInPolygon(Vec2 point, Polygon* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MaxFloat")] + public static extern float MaxFloat(float a, float b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointEnableLimit(JointId jointId, byte enableLimit); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MaxInt")] + public static extern int MaxInt(int a, int b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableMotor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointEnableMotor(JointId jointId, byte enableMotor); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Min")] + public static extern Vec2 Min(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableSpring", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointEnableSpring(JointId jointId, byte enableSpring); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MinFloat")] + public static extern float MinFloat(float a, float b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetLowerLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MinInt")] + public static extern int MinInt(int a, int b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetMaxMotorForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetAngularOffset")] + public static extern float MotorJointGetAngularOffset(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetMotorForce(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetCorrectionFactor")] + public static extern float MotorJointGetCorrectionFactor(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetMotorSpeed(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetLinearOffset")] + public static extern Vec2 MotorJointGetLinearOffset(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetSpringDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetMaxForce")] + public static extern float MotorJointGetMaxForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetSpringHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_GetMaxTorque")] + public static extern float MotorJointGetMaxTorque(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float PrismaticJointGetUpperLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetAngularOffset")] + public static extern void MotorJointSetAngularOffset(JointId jointId, float angularOffset); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PrismaticJointIsLimitEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetCorrectionFactor")] + public static extern void MotorJointSetCorrectionFactor(JointId jointId, float correctionFactor); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PrismaticJointIsMotorEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetLinearOffset")] + public static extern void MotorJointSetLinearOffset(JointId jointId, Vec2 linearOffset); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsSpringEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte PrismaticJointIsSpringEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetMaxForce")] + public static extern void MotorJointSetMaxForce(JointId jointId, float maxForce); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointSetLimits(JointId jointId, float lower, float upper); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MotorJoint_SetMaxTorque")] + public static extern void MotorJointSetMaxTorque(JointId jointId, float maxTorque); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointSetMaxMotorForce(JointId jointId, float force); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetMaxForce")] + public static extern float MouseJointGetMaxForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointSetMotorSpeed(JointId jointId, float motorSpeed); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetSpringDampingRatio")] + public static extern float MouseJointGetSpringDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointSetSpringDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetSpringHertz")] + public static extern float MouseJointGetSpringHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void PrismaticJointSetSpringHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_GetTarget")] + public static extern Vec2 MouseJointGetTarget(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput RayCastCapsule(RayCastInput* input, Capsule* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetMaxForce")] + public static extern void MouseJointSetMaxForce(JointId jointId, float maxForce); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput RayCastCircle(RayCastInput* input, Circle* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetSpringDampingRatio")] + public static extern void MouseJointSetSpringDampingRatio(JointId jointId, float dampingRatio); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput RayCastPolygon(RayCastInput* input, Polygon* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetSpringHertz")] + public static extern void MouseJointSetSpringHertz(JointId jointId, float hertz); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput RayCastSegment(RayCastInput* input, Segment* shape, byte oneSided); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MouseJoint_SetTarget")] + public static extern void MouseJointSetTarget(JointId jointId, Vec2 target); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RelativeAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RelativeAngle(Rot b, Rot a); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Mul")] + public static extern Vec2 Mul(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointEnableLimit(JointId jointId, byte enableLimit); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulAdd")] + public static extern Vec2 MulAdd(Vec2 a, float s, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableMotor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointEnableMotor(JointId jointId, byte enableMotor); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulMV")] + public static extern Vec2 MulMV(Mat22 A, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableSpring", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointEnableSpring(JointId jointId, byte enableSpring); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulRot")] + public static extern Rot MulRot(Rot q, Rot r); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetAngle(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulSub")] + public static extern Vec2 MulSub(Vec2 a, float s, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetLowerLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulSV")] + public static extern Vec2 MulSV(float s, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetMaxMotorTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MulTransforms")] + public static extern Transform MulTransforms(Transform A, Transform B); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetMotorSpeed(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Neg")] + public static extern Vec2 Neg(Vec2 a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetMotorTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NLerp")] + public static extern Rot NLerp(Rot q1, Rot q2, float t); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetSpringDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Normalize")] + public static extern Vec2 Normalize(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetSpringHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NormalizeRot")] + public static extern Rot NormalizeRot(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RevoluteJointGetUpperLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PlaneSeparation")] + public static extern float PlaneSeparation(Plane plane, Vec2 point); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte RevoluteJointIsLimitEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInCapsule")] + public static extern bool PointInCapsule(Vec2 point, Capsule* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte RevoluteJointIsMotorEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInCircle")] + public static extern bool PointInCircle(Vec2 point, Circle* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointSetLimits(JointId jointId, float lower, float upper); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInPolygon")] + public static extern bool PointInPolygon(Vec2 point, Polygon* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointSetMaxMotorTorque(JointId jointId, float torque); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableLimit")] + public static extern void PrismaticJointEnableLimit(JointId jointId, bool enableLimit); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointSetMotorSpeed(JointId jointId, float motorSpeed); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableMotor")] + public static extern void PrismaticJointEnableMotor(JointId jointId, bool enableMotor); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointSetSpringDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_EnableSpring")] + public static extern void PrismaticJointEnableSpring(JointId jointId, bool enableSpring); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void RevoluteJointSetSpringHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetLowerLimit")] + public static extern float PrismaticJointGetLowerLimit(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RightPerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 RightPerp(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMaxMotorForce")] + public static extern float PrismaticJointGetMaxMotorForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float RotGetAngle(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMotorForce")] + public static extern float PrismaticJointGetMotorForce(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetXAxis", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 RotGetXAxis(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMotorSpeed")] + public static extern float PrismaticJointGetMotorSpeed(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetYAxis", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 RotGetYAxis(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpeed")] + public static extern float PrismaticJointGetSpeed(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte RotIsValid(Rot q); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringDampingRatio")] + public static extern float PrismaticJointGetSpringDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RotateVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 RotateVector(Rot q, Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringHertz")] + public static extern float PrismaticJointGetSpringHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SegmentDistance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern SegmentDistanceResult SegmentDistance(Vec2 p1, Vec2 q1, Vec2 p2, Vec2 q2); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetTranslation")] + public static extern float PrismaticJointGetTranslation(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetAllocator", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void SetAllocator(System.IntPtr allocFcn, System.IntPtr freeFcn); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetUpperLimit")] + public static extern float PrismaticJointGetUpperLimit(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetAssertFcn", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void SetAssertFcn(System.IntPtr assertFcn); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsLimitEnabled")] + public static extern bool PrismaticJointIsLimitEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetLengthUnitsPerMeter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void SetLengthUnitsPerMeter(float lengthUnits); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsMotorEnabled")] + public static extern bool PrismaticJointIsMotorEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreContactEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeAreContactEventsEnabled(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsSpringEnabled")] + public static extern bool PrismaticJointIsSpringEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreHitEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeAreHitEventsEnabled(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetLimits")] + public static extern void PrismaticJointSetLimits(JointId jointId, float lower, float upper); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_ArePreSolveEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeArePreSolveEventsEnabled(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetMaxMotorForce")] + public static extern void PrismaticJointSetMaxMotorForce(JointId jointId, float force); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreSensorEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeAreSensorEventsEnabled(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetMotorSpeed")] + public static extern void PrismaticJointSetMotorSpeed(JointId jointId, float motorSpeed); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableContactEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeEnableContactEvents(ShapeId shapeId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetSpringDampingRatio")] + public static extern void PrismaticJointSetSpringDampingRatio(JointId jointId, float dampingRatio); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableHitEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeEnableHitEvents(ShapeId shapeId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetSpringHertz")] + public static extern void PrismaticJointSetSpringHertz(JointId jointId, float hertz); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnablePreSolveEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeEnablePreSolveEvents(ShapeId shapeId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastCapsule")] + public static extern CastOutput RayCastCapsule(RayCastInput* input, Capsule* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableSensorEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeEnableSensorEvents(ShapeId shapeId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastCircle")] + public static extern CastOutput RayCastCircle(RayCastInput* input, Circle* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern AABB ShapeGetAABB(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastPolygon")] + public static extern CastOutput RayCastPolygon(RayCastInput* input, Polygon* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetBody", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyId ShapeGetBody(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RayCastSegment")] + public static extern CastOutput RayCastSegment(RayCastInput* input, Segment* shape, bool oneSided); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Capsule ShapeGetCapsule(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RelativeAngle")] + public static extern float RelativeAngle(Rot b, Rot a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Circle ShapeGetCircle(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableLimit")] + public static extern void RevoluteJointEnableLimit(JointId jointId, bool enableLimit); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetClosestPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 ShapeGetClosestPoint(ShapeId shapeId, Vec2 target); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableMotor")] + public static extern void RevoluteJointEnableMotor(JointId jointId, bool enableMotor); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetContactCapacity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int ShapeGetContactCapacity(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_EnableSpring")] + public static extern void RevoluteJointEnableSpring(JointId jointId, bool enableSpring); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetContactData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int ShapeGetContactData(ShapeId shapeId, ContactData* contactData, int capacity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetAngle")] + public static extern float RevoluteJointGetAngle(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetDensity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float ShapeGetDensity(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetLowerLimit")] + public static extern float RevoluteJointGetLowerLimit(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Filter ShapeGetFilter(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMaxMotorTorque")] + public static extern float RevoluteJointGetMaxMotorTorque(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float ShapeGetFriction(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMotorSpeed")] + public static extern float RevoluteJointGetMotorSpeed(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetParentChain", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ChainId ShapeGetParentChain(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMotorTorque")] + public static extern float RevoluteJointGetMotorTorque(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon ShapeGetPolygon(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetSpringDampingRatio")] + public static extern float RevoluteJointGetSpringDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float ShapeGetRestitution(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetSpringHertz")] + public static extern float RevoluteJointGetSpringHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Segment ShapeGetSegment(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetUpperLimit")] + public static extern float RevoluteJointGetUpperLimit(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSmoothSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern SmoothSegment ShapeGetSmoothSegment(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsLimitEnabled")] + public static extern bool RevoluteJointIsLimitEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetType", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ShapeType ShapeGetType(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsMotorEnabled")] + public static extern bool RevoluteJointIsMotorEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void* ShapeGetUserData(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsSpringEnabled")] + public static extern bool RevoluteJointIsSpringEnabled(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_IsSensor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeIsSensor(ShapeId shapeId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetLimits")] + public static extern void RevoluteJointSetLimits(JointId jointId, float lower, float upper); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeIsValid(ShapeId id); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetMaxMotorTorque")] + public static extern void RevoluteJointSetMaxMotorTorque(JointId jointId, float torque); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_RayCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeRayCast(ShapeId shapeId, Vec2 origin, Vec2 translation); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetMotorSpeed")] + public static extern void RevoluteJointSetMotorSpeed(JointId jointId, float motorSpeed); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetCapsule(ShapeId shapeId, Capsule* capsule); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetSpringDampingRatio")] + public static extern void RevoluteJointSetSpringDampingRatio(JointId jointId, float dampingRatio); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetCircle(ShapeId shapeId, Circle* circle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetSpringHertz")] + public static extern void RevoluteJointSetSpringHertz(JointId jointId, float hertz); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetDensity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetDensity(ShapeId shapeId, float density); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RightPerp")] + public static extern Vec2 RightPerp(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetFilter(ShapeId shapeId, Filter filter); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetAngle")] + public static extern float RotGetAngle(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetFriction(ShapeId shapeId, float friction); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetXAxis")] + public static extern Vec2 RotGetXAxis(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetPolygon(ShapeId shapeId, Polygon* polygon); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetYAxis")] + public static extern Vec2 RotGetYAxis(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetRestitution(ShapeId shapeId, float restitution); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RotateVector")] + public static extern Vec2 RotateVector(Rot q, Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetSegment(ShapeId shapeId, Segment* segment); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SegmentDistance")] + public static extern SegmentDistanceResult SegmentDistance(Vec2 p1, Vec2 q1, Vec2 p2, Vec2 q2); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetUserData(ShapeId shapeId, void* userData); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetAllocator")] + public static extern void SetAllocator(delegate* unmanaged allocFcn, delegate* unmanaged freeFcn); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_TestPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ShapeTestPoint(ShapeId shapeId, Vec2 point); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetAssertFcn")] + public static extern void SetAssertFcn(delegate* unmanaged assertFcn); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeCast(ShapeCastPairInput* input); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetLengthUnitsPerMeter")] + public static extern void SetLengthUnitsPerMeter(float lengthUnits); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeCastCapsule(ShapeCastInput* input, Capsule* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreContactEventsEnabled")] + public static extern bool ShapeAreContactEventsEnabled(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeCastCircle(ShapeCastInput* input, Circle* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreHitEventsEnabled")] + public static extern bool ShapeAreHitEventsEnabled(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeCastPolygon(ShapeCastInput* input, Polygon* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_ArePreSolveEventsEnabled")] + public static extern bool ShapeArePreSolveEventsEnabled(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeCastSegment(ShapeCastInput* input, Segment* shape); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreSensorEventsEnabled")] + public static extern bool ShapeAreSensorEventsEnabled(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeDistance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DistanceOutput ShapeDistance(DistanceCache* cache, DistanceInput* input, Simplex* simplexes, int simplexCapacity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableContactEvents")] + public static extern void ShapeEnableContactEvents(ShapeId shapeId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SleepMilliseconds", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void SleepMilliseconds(int milliseconds); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableHitEvents")] + public static extern void ShapeEnableHitEvents(ShapeId shapeId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Solve22", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Solve22(Mat22 A, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnablePreSolveEvents")] + public static extern void ShapeEnablePreSolveEvents(ShapeId shapeId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Sub", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 Sub(Vec2 a, Vec2 b); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableSensorEvents")] + public static extern void ShapeEnableSensorEvents(ShapeId shapeId, bool flag); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TimeOfImpact", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern TOIOutput TimeOfImpact(TOIInput* input); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetAABB")] + public static extern AABB ShapeGetAABB(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TransformPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 TransformPoint(Transform t, Vec2 p); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetBody")] + public static extern BodyId ShapeGetBody(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TransformPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon TransformPolygon(Transform transform, Polygon* polygon); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCapsule")] + public static extern Capsule ShapeGetCapsule(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2UnwindAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float UnwindAngle(float angle); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetChainSegment")] + public static extern ChainSegment ShapeGetChainSegment(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ValidateHull", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte ValidateHull(Hull* hull); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCircle")] + public static extern Circle ShapeGetCircle(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Vec2_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte Vec2IsValid(Vec2 v); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetClosestPoint")] + public static extern Vec2 ShapeGetClosestPoint(ShapeId shapeId, Vec2 target); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetAngularDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WeldJointGetAngularDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetContactCapacity")] + public static extern int ShapeGetContactCapacity(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetAngularHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WeldJointGetAngularHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetContactData")] + public static extern int ShapeGetContactData(ShapeId shapeId, ContactData* contactData, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetLinearDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WeldJointGetLinearDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetDensity")] + public static extern float ShapeGetDensity(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetLinearHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WeldJointGetLinearHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetFilter")] + public static extern Filter ShapeGetFilter(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetAngularDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WeldJointSetAngularDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetFriction")] + public static extern float ShapeGetFriction(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetAngularHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WeldJointSetAngularHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetMassData")] + public static extern MassData ShapeGetMassData(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetLinearDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WeldJointSetLinearDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetMaterial")] + public static extern int ShapeGetMaterial(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetLinearHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WeldJointSetLinearHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetParentChain")] + public static extern ChainId ShapeGetParentChain(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointEnableLimit(JointId jointId, byte enableLimit); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetPolygon")] + public static extern Polygon ShapeGetPolygon(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableMotor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointEnableMotor(JointId jointId, byte enableMotor); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetRestitution")] + public static extern float ShapeGetRestitution(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableSpring", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointEnableSpring(JointId jointId, byte enableSpring); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSegment")] + public static extern Segment ShapeGetSegment(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetLowerLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSensorCapacity")] + public static extern int ShapeGetSensorCapacity(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetMaxMotorTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSensorOverlaps")] + public static extern int ShapeGetSensorOverlaps(ShapeId shapeId, ShapeId* overlaps, int capacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetMotorSpeed(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetType")] + public static extern ShapeType ShapeGetType(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetMotorTorque(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetUserData")] + public static extern void* ShapeGetUserData(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetSpringDampingRatio(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetWorld")] + public static extern WorldId ShapeGetWorld(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetSpringHertz(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_IsSensor")] + public static extern bool ShapeIsSensor(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float WheelJointGetUpperLimit(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_IsValid")] + public static extern bool ShapeIsValid(ShapeId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte WheelJointIsLimitEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_RayCast")] + public static extern CastOutput ShapeRayCast(ShapeId shapeId, RayCastInput* input); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte WheelJointIsMotorEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCapsule")] + public static extern void ShapeSetCapsule(ShapeId shapeId, Capsule* capsule); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsSpringEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte WheelJointIsSpringEnabled(JointId jointId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCircle")] + public static extern void ShapeSetCircle(ShapeId shapeId, Circle* circle); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointSetLimits(JointId jointId, float lower, float upper); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetDensity")] + public static extern void ShapeSetDensity(ShapeId shapeId, float density, bool updateBodyMass); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointSetMaxMotorTorque(JointId jointId, float torque); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFilter")] + public static extern void ShapeSetFilter(ShapeId shapeId, Filter filter); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointSetMotorSpeed(JointId jointId, float motorSpeed); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFriction")] + public static extern void ShapeSetFriction(ShapeId shapeId, float friction); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointSetSpringDampingRatio(JointId jointId, float dampingRatio); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetMaterial")] + public static extern void ShapeSetMaterial(ShapeId shapeId, int material); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WheelJointSetSpringHertz(JointId jointId, float hertz); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetPolygon")] + public static extern void ShapeSetPolygon(ShapeId shapeId, Polygon* polygon); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastCapsule(WorldId worldId, Capsule* capsule, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetRestitution")] + public static extern void ShapeSetRestitution(ShapeId shapeId, float restitution); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastCircle(WorldId worldId, Circle* circle, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetSegment")] + public static extern void ShapeSetSegment(ShapeId shapeId, Segment* segment); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastPolygon(WorldId worldId, Polygon* polygon, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetUserData")] + public static extern void ShapeSetUserData(ShapeId shapeId, void* userData); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRay", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastRay(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_TestPoint")] + public static extern bool ShapeTestPoint(ShapeId shapeId, Vec2 point); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRayClosest", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern RayResult WorldCastRayClosest(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCast")] + public static extern CastOutput ShapeCast(ShapeCastPairInput* input); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Draw", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldDraw(WorldId worldId, DebugDraw* draw); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastCapsule")] + public static extern CastOutput ShapeCastCapsule(ShapeCastInput* input, Capsule* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_DumpMemoryStats", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldDumpMemoryStats(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastCircle")] + public static extern CastOutput ShapeCastCircle(ShapeCastInput* input, Circle* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableContinuous", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldEnableContinuous(WorldId worldId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastPolygon")] + public static extern CastOutput ShapeCastPolygon(ShapeCastInput* input, Polygon* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableSleeping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldEnableSleeping(WorldId worldId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeCastSegment")] + public static extern CastOutput ShapeCastSegment(ShapeCastInput* input, Segment* shape); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableWarmStarting", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldEnableWarmStarting(WorldId worldId, byte flag); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeDistance")] + public static extern DistanceOutput ShapeDistance(DistanceInput* input, SimplexCache* cache, Simplex* simplexes, int simplexCapacity); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Explode", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldExplode(WorldId worldId, Vec2 position, float radius, float impulse); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Solve22")] + public static extern Vec2 Solve22(Mat22 A, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetBodyEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern BodyEvents WorldGetBodyEvents(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SolvePlanes")] + public static extern PlaneSolverResult SolvePlanes(Vec2 position, CollisionPlane* planes, int count); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetContactEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern ContactEvents WorldGetContactEvents(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreBodyId")] + public static extern ulong StoreBodyId(BodyId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetCounters", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Counters WorldGetCounters(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreChainId")] + public static extern ulong StoreChainId(ChainId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetGravity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 WorldGetGravity(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreJointId")] + public static extern ulong StoreJointId(JointId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetProfile", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Profile WorldGetProfile(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreShapeId")] + public static extern ulong StoreShapeId(ShapeId id); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetSensorEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern SensorEvents WorldGetSensorEvents(WorldId worldId); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Sub")] + public static extern Vec2 Sub(Vec2 a, Vec2 b); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte WorldIsValid(WorldId id); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TimeOfImpact")] + public static extern TOIOutput TimeOfImpact(TOIInput* input); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapAABB(WorldId worldId, AABB aabb, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TransformPoint")] + public static extern Vec2 TransformPoint(Transform t, Vec2 p); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapCapsule(WorldId worldId, Capsule* capsule, Transform transform, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2TransformPolygon")] + public static extern Polygon TransformPolygon(Transform transform, Polygon* polygon); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapCircle(WorldId worldId, Circle* circle, Transform transform, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2UnwindAngle")] + public static extern float UnwindAngle(float radians); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapPolygon(WorldId worldId, Polygon* polygon, Transform transform, QueryFilter filter, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2UnwindLargeAngle")] + public static extern float UnwindLargeAngle(float radians); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetContactTuning", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetContactTuning(WorldId worldId, float hertz, float dampingRatio, float pushVelocity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ValidateHull")] + public static extern bool ValidateHull(Hull* hull); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetCustomFilterCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetCustomFilterCallback(WorldId worldId, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetAngularDampingRatio")] + public static extern float WeldJointGetAngularDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetGravity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetGravity(WorldId worldId, Vec2 gravity); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetAngularHertz")] + public static extern float WeldJointGetAngularHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetHitEventThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetHitEventThreshold(WorldId worldId, float value); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetLinearDampingRatio")] + public static extern float WeldJointGetLinearDampingRatio(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetPreSolveCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetPreSolveCallback(WorldId worldId, System.IntPtr fcn, void* context); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetLinearHertz")] + public static extern float WeldJointGetLinearHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetRestitutionThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetRestitutionThreshold(WorldId worldId, float value); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetReferenceAngle")] + public static extern float WeldJointGetReferenceAngle(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Step", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldStep(WorldId worldId, float timeStep, int subStepCount); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetAngularDampingRatio")] + public static extern void WeldJointSetAngularDampingRatio(JointId jointId, float dampingRatio); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Yield", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void Yield(); + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetAngularHertz")] + public static extern void WeldJointSetAngularHertz(JointId jointId, float hertz); - public partial struct AABB - { - public Vec2 lowerBound; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetLinearDampingRatio")] + public static extern void WeldJointSetLinearDampingRatio(JointId jointId, float dampingRatio); - public Vec2 upperBound; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetLinearHertz")] + public static extern void WeldJointSetLinearHertz(JointId jointId, float hertz); - public partial struct BodyDef - { - public BodyType type; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetReferenceAngle")] + public static extern void WeldJointSetReferenceAngle(JointId jointId, float angleInRadians); - public Vec2 position; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableLimit")] + public static extern void WheelJointEnableLimit(JointId jointId, bool enableLimit); - public Rot rotation; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableMotor")] + public static extern void WheelJointEnableMotor(JointId jointId, bool enableMotor); - public Vec2 linearVelocity; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableSpring")] + public static extern void WheelJointEnableSpring(JointId jointId, bool enableSpring); - public float angularVelocity; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetLowerLimit")] + public static extern float WheelJointGetLowerLimit(JointId jointId); - public float linearDamping; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMaxMotorTorque")] + public static extern float WheelJointGetMaxMotorTorque(JointId jointId); - public float angularDamping; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMotorSpeed")] + public static extern float WheelJointGetMotorSpeed(JointId jointId); - public float gravityScale; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMotorTorque")] + public static extern float WheelJointGetMotorTorque(JointId jointId); - public float sleepThreshold; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetSpringDampingRatio")] + public static extern float WheelJointGetSpringDampingRatio(JointId jointId); - public void* userData; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetSpringHertz")] + public static extern float WheelJointGetSpringHertz(JointId jointId); - public byte enableSleep; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetUpperLimit")] + public static extern float WheelJointGetUpperLimit(JointId jointId); - public byte isAwake; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsLimitEnabled")] + public static extern bool WheelJointIsLimitEnabled(JointId jointId); - public byte fixedRotation; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsMotorEnabled")] + public static extern bool WheelJointIsMotorEnabled(JointId jointId); - public byte isBullet; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsSpringEnabled")] + public static extern bool WheelJointIsSpringEnabled(JointId jointId); - public byte isEnabled; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetLimits")] + public static extern void WheelJointSetLimits(JointId jointId, float lower, float upper); - public byte automaticMass; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetMaxMotorTorque")] + public static extern void WheelJointSetMaxMotorTorque(JointId jointId, float torque); - public byte allowFastRotation; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetMotorSpeed")] + public static extern void WheelJointSetMotorSpeed(JointId jointId, float motorSpeed); - public int internalValue; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetSpringDampingRatio")] + public static extern void WheelJointSetSpringDampingRatio(JointId jointId, float dampingRatio); - public partial struct BodyEvents - { - public BodyMoveEvent* moveEvents; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetSpringHertz")] + public static extern void WheelJointSetSpringHertz(JointId jointId, float hertz); - public int moveCount; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastMover")] + public static extern float WorldCastMover(WorldId worldId, Capsule* mover, Vec2 translation, QueryFilter filter); - public partial struct BodyId - { - public int index1; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRay")] + public static extern TreeStats WorldCastRay(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter, delegate* unmanaged fcn, void* context); - public ushort world0; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRayClosest")] + public static extern RayResult WorldCastRayClosest(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter); - public ushort revision; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastShape")] + public static extern TreeStats WorldCastShape(WorldId worldId, ShapeProxy* proxy, Vec2 translation, QueryFilter filter, delegate* unmanaged fcn, void* context); - public partial struct BodyMoveEvent - { - public Transform transform; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CollideMover")] + public static extern void WorldCollideMover(WorldId worldId, Capsule* mover, QueryFilter filter, delegate* unmanaged fcn, void* context); - public BodyId bodyId; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Draw")] + public static extern void WorldDraw(WorldId worldId, DebugDraw* draw); - public void* userData; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_DumpMemoryStats")] + public static extern void WorldDumpMemoryStats(WorldId worldId); - public byte fellAsleep; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableContinuous")] + public static extern void WorldEnableContinuous(WorldId worldId, bool flag); - public partial struct Capsule - { - public Vec2 center1; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableSleeping")] + public static extern void WorldEnableSleeping(WorldId worldId, bool flag); - public Vec2 center2; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableSpeculative")] + public static extern void WorldEnableSpeculative(WorldId worldId, bool flag); - public float radius; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableWarmStarting")] + public static extern void WorldEnableWarmStarting(WorldId worldId, bool flag); - public partial struct CastOutput - { - public Vec2 normal; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Explode")] + public static extern void WorldExplode(WorldId worldId, ExplosionDef* explosionDef); - public Vec2 point; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetAwakeBodyCount")] + public static extern int WorldGetAwakeBodyCount(WorldId worldId); - public float fraction; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetBodyEvents")] + public static extern BodyEvents WorldGetBodyEvents(WorldId worldId); - public int iterations; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetContactEvents")] + public static extern ContactEvents WorldGetContactEvents(WorldId worldId); - public byte hit; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetCounters")] + public static extern Counters WorldGetCounters(WorldId worldId); - public partial struct ChainDef - { - public void* userData; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetGravity")] + public static extern Vec2 WorldGetGravity(WorldId worldId); - public Vec2* points; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetHitEventThreshold")] + public static extern float WorldGetHitEventThreshold(WorldId worldId); - public int count; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetMaximumLinearSpeed")] + public static extern float WorldGetMaximumLinearSpeed(WorldId worldId); - public float friction; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetProfile")] + public static extern Profile WorldGetProfile(WorldId worldId); - public float restitution; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetRestitutionThreshold")] + public static extern float WorldGetRestitutionThreshold(WorldId worldId); - public Filter filter; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetSensorEvents")] + public static extern SensorEvents WorldGetSensorEvents(WorldId worldId); - public byte isLoop; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetUserData")] + public static extern void* WorldGetUserData(WorldId worldId); - public int internalValue; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsContinuousEnabled")] + public static extern bool WorldIsContinuousEnabled(WorldId worldId); - public partial struct ChainId - { - public int index1; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsSleepingEnabled")] + public static extern bool WorldIsSleepingEnabled(WorldId worldId); - public ushort world0; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsValid")] + public static extern bool WorldIsValid(WorldId id); - public ushort revision; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsWarmStartingEnabled")] + public static extern bool WorldIsWarmStartingEnabled(WorldId worldId); - public partial struct Circle - { - public Vec2 center; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapAABB")] + public static extern TreeStats WorldOverlapAABB(WorldId worldId, AABB aabb, QueryFilter filter, delegate* unmanaged fcn, void* context); - public float radius; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapShape")] + public static extern TreeStats WorldOverlapShape(WorldId worldId, ShapeProxy* proxy, QueryFilter filter, delegate* unmanaged fcn, void* context); - public partial struct ContactBeginTouchEvent - { - public ShapeId shapeIdA; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_RebuildStaticTree")] + public static extern void WorldRebuildStaticTree(WorldId worldId); - public ShapeId shapeIdB; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetContactTuning")] + public static extern void WorldSetContactTuning(WorldId worldId, float hertz, float dampingRatio, float pushSpeed); - public partial struct ContactData - { - public ShapeId shapeIdA; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetCustomFilterCallback")] + public static extern void WorldSetCustomFilterCallback(WorldId worldId, delegate* unmanaged fcn, void* context); - public ShapeId shapeIdB; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetFrictionCallback")] + public static extern void WorldSetFrictionCallback(WorldId worldId, delegate* unmanaged callback); - public Manifold manifold; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetGravity")] + public static extern void WorldSetGravity(WorldId worldId, Vec2 gravity); - public partial struct ContactEndTouchEvent - { - public ShapeId shapeIdA; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetHitEventThreshold")] + public static extern void WorldSetHitEventThreshold(WorldId worldId, float value); - public ShapeId shapeIdB; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetJointTuning")] + public static extern void WorldSetJointTuning(WorldId worldId, float hertz, float dampingRatio); - public partial struct ContactEvents - { - public ContactBeginTouchEvent* beginEvents; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetMaximumLinearSpeed")] + public static extern void WorldSetMaximumLinearSpeed(WorldId worldId, float maximumLinearSpeed); - public ContactEndTouchEvent* endEvents; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetPreSolveCallback")] + public static extern void WorldSetPreSolveCallback(WorldId worldId, delegate* unmanaged fcn, void* context); - public ContactHitEvent* hitEvents; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetRestitutionCallback")] + public static extern void WorldSetRestitutionCallback(WorldId worldId, delegate* unmanaged callback); - public int beginCount; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetRestitutionThreshold")] + public static extern void WorldSetRestitutionThreshold(WorldId worldId, float value); - public int endCount; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetUserData")] + public static extern void WorldSetUserData(WorldId worldId, void* userData); - public int hitCount; - } + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Step")] + public static extern void WorldStep(WorldId worldId, float timeStep, int subStepCount); - public partial struct ContactHitEvent - { - public ShapeId shapeIdA; + [DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Yield")] + public static extern void Yield(); - public ShapeId shapeIdB; + public enum BodyType : uint + { + staticBody = 0, + kinematicBody = 1, + dynamicBody = 2, + bodyTypeCount = 3 + } - public Vec2 point; + public enum HexColor : uint + { + colorAliceBlue = 15792383, + colorAntiqueWhite = 16444375, + colorAqua = 65535, + colorAquamarine = 8388564, + colorAzure = 15794175, + colorBeige = 16119260, + colorBisque = 16770244, + colorBlack = 0, + colorBlanchedAlmond = 16772045, + colorBlue = 255, + colorBlueViolet = 9055202, + colorBrown = 10824234, + colorBurlywood = 14596231, + colorCadetBlue = 6266528, + colorChartreuse = 8388352, + colorChocolate = 13789470, + colorCoral = 16744272, + colorCornflowerBlue = 6591981, + colorCornsilk = 16775388, + colorCrimson = 14423100, + colorCyan = 65535, + colorDarkBlue = 139, + colorDarkCyan = 35723, + colorDarkGoldenRod = 12092939, + colorDarkGray = 11119017, + colorDarkGreen = 25600, + colorDarkKhaki = 12433259, + colorDarkMagenta = 9109643, + colorDarkOliveGreen = 5597999, + colorDarkOrange = 16747520, + colorDarkOrchid = 10040012, + colorDarkRed = 9109504, + colorDarkSalmon = 15308410, + colorDarkSeaGreen = 9419919, + colorDarkSlateBlue = 4734347, + colorDarkSlateGray = 3100495, + colorDarkTurquoise = 52945, + colorDarkViolet = 9699539, + colorDeepPink = 16716947, + colorDeepSkyBlue = 49151, + colorDimGray = 6908265, + colorDodgerBlue = 2003199, + colorFireBrick = 11674146, + colorFloralWhite = 16775920, + colorForestGreen = 2263842, + colorFuchsia = 16711935, + colorGainsboro = 14474460, + colorGhostWhite = 16316671, + colorGold = 16766720, + colorGoldenRod = 14329120, + colorGray = 8421504, + colorGreen = 32768, + colorGreenYellow = 11403055, + colorHoneyDew = 15794160, + colorHotPink = 16738740, + colorIndianRed = 13458524, + colorIndigo = 4915330, + colorIvory = 16777200, + colorKhaki = 15787660, + colorLavender = 15132410, + colorLavenderBlush = 16773365, + colorLawnGreen = 8190976, + colorLemonChiffon = 16775885, + colorLightBlue = 11393254, + colorLightCoral = 15761536, + colorLightCyan = 14745599, + colorLightGoldenRodYellow = 16448210, + colorLightGray = 13882323, + colorLightGreen = 9498256, + colorLightPink = 16758465, + colorLightSalmon = 16752762, + colorLightSeaGreen = 2142890, + colorLightSkyBlue = 8900346, + colorLightSlateGray = 7833753, + colorLightSteelBlue = 11584734, + colorLightYellow = 16777184, + colorLime = 65280, + colorLimeGreen = 3329330, + colorLinen = 16445670, + colorMagenta = 16711935, + colorMaroon = 8388608, + colorMediumAquaMarine = 6737322, + colorMediumBlue = 205, + colorMediumOrchid = 12211667, + colorMediumPurple = 9662683, + colorMediumSeaGreen = 3978097, + colorMediumSlateBlue = 8087790, + colorMediumSpringGreen = 64154, + colorMediumTurquoise = 4772300, + colorMediumVioletRed = 13047173, + colorMidnightBlue = 1644912, + colorMintCream = 16121850, + colorMistyRose = 16770273, + colorMoccasin = 16770229, + colorNavajoWhite = 16768685, + colorNavy = 128, + colorOldLace = 16643558, + colorOlive = 8421376, + colorOliveDrab = 7048739, + colorOrange = 16753920, + colorOrangeRed = 16729344, + colorOrchid = 14315734, + colorPaleGoldenRod = 15657130, + colorPaleGreen = 10025880, + colorPaleTurquoise = 11529966, + colorPaleVioletRed = 14381203, + colorPapayaWhip = 16773077, + colorPeachPuff = 16767673, + colorPeru = 13468991, + colorPink = 16761035, + colorPlum = 14524637, + colorPowderBlue = 11591910, + colorPurple = 8388736, + colorRebeccaPurple = 6697881, + colorRed = 16711680, + colorRosyBrown = 12357519, + colorRoyalBlue = 4286945, + colorSaddleBrown = 9127187, + colorSalmon = 16416882, + colorSandyBrown = 16032864, + colorSeaGreen = 3050327, + colorSeaShell = 16774638, + colorSienna = 10506797, + colorSilver = 12632256, + colorSkyBlue = 8900331, + colorSlateBlue = 6970061, + colorSlateGray = 7372944, + colorSnow = 16775930, + colorSpringGreen = 65407, + colorSteelBlue = 4620980, + colorTan = 13808780, + colorTeal = 32896, + colorThistle = 14204888, + colorTomato = 16737095, + colorTurquoise = 4251856, + colorViolet = 15631086, + colorWheat = 16113331, + colorWhite = 16777215, + colorWhiteSmoke = 16119285, + colorYellow = 16776960, + colorYellowGreen = 10145074, + colorBox2DRed = 14430514, + colorBox2DBlue = 3190463, + colorBox2DGreen = 9226532, + colorBox2DYellow = 16772748 + } - public Vec2 normal; + public enum JointType : uint + { + distanceJoint = 0, + filterJoint = 1, + motorJoint = 2, + mouseJoint = 3, + prismaticJoint = 4, + revoluteJoint = 5, + weldJoint = 6, + wheelJoint = 7 + } - public float approachSpeed; - } + public enum ShapeType : uint + { + circleShape = 0, + capsuleShape = 1, + segmentShape = 2, + polygonShape = 3, + chainSegmentShape = 4, + shapeTypeCount = 5 + } - public partial struct Counters - { - public int staticBodyCount; + public enum TOIState : uint + { + toiStateUnknown = 0, + toiStateFailed = 1, + toiStateOverlapped = 2, + toiStateHit = 3, + toiStateSeparated = 4 + } - public int bodyCount; + public const BodyType staticBody = BodyType.staticBody; - public int shapeCount; + public const BodyType kinematicBody = BodyType.kinematicBody; - public int contactCount; + public const BodyType dynamicBody = BodyType.dynamicBody; - public int jointCount; + public const BodyType bodyTypeCount = BodyType.bodyTypeCount; - public int islandCount; + public const HexColor colorAliceBlue = HexColor.colorAliceBlue; - public int stackUsed; + public const HexColor colorAntiqueWhite = HexColor.colorAntiqueWhite; - public int staticTreeHeight; + public const HexColor colorAqua = HexColor.colorAqua; - public int treeHeight; + public const HexColor colorAquamarine = HexColor.colorAquamarine; - public int byteCount; + public const HexColor colorAzure = HexColor.colorAzure; - public int taskCount; + public const HexColor colorBeige = HexColor.colorBeige; - public fixed int colorCounts[12]; - } + public const HexColor colorBisque = HexColor.colorBisque; - public partial struct DebugDraw - { - public System.IntPtr DrawPolygon; // delegate* + public const HexColor colorBlack = HexColor.colorBlack; - public System.IntPtr DrawSolidPolygon; // delegate* + public const HexColor colorBlanchedAlmond = HexColor.colorBlanchedAlmond; - public System.IntPtr DrawCircle; // delegate* + public const HexColor colorBlue = HexColor.colorBlue; - public System.IntPtr DrawSolidCircle; // delegate* + public const HexColor colorBlueViolet = HexColor.colorBlueViolet; - public System.IntPtr DrawCapsule; // delegate* + public const HexColor colorBrown = HexColor.colorBrown; - public System.IntPtr DrawSolidCapsule; // delegate* + public const HexColor colorBurlywood = HexColor.colorBurlywood; - public System.IntPtr DrawSegment; // delegate* + public const HexColor colorCadetBlue = HexColor.colorCadetBlue; - public System.IntPtr DrawTransform; // delegate* + public const HexColor colorChartreuse = HexColor.colorChartreuse; - public System.IntPtr DrawPoint; // delegate* + public const HexColor colorChocolate = HexColor.colorChocolate; - public System.IntPtr DrawString; // delegate* + public const HexColor colorCoral = HexColor.colorCoral; - public AABB drawingBounds; + public const HexColor colorCornflowerBlue = HexColor.colorCornflowerBlue; - public byte useDrawingBounds; + public const HexColor colorCornsilk = HexColor.colorCornsilk; - public byte drawShapes; + public const HexColor colorCrimson = HexColor.colorCrimson; - public byte drawJoints; + public const HexColor colorCyan = HexColor.colorCyan; - public byte drawJointExtras; + public const HexColor colorDarkBlue = HexColor.colorDarkBlue; - public byte drawAABBs; + public const HexColor colorDarkCyan = HexColor.colorDarkCyan; - public byte drawMass; + public const HexColor colorDarkGoldenRod = HexColor.colorDarkGoldenRod; - public byte drawContacts; + public const HexColor colorDarkGray = HexColor.colorDarkGray; - public byte drawGraphColors; + public const HexColor colorDarkGreen = HexColor.colorDarkGreen; - public byte drawContactNormals; + public const HexColor colorDarkKhaki = HexColor.colorDarkKhaki; - public byte drawContactImpulses; + public const HexColor colorDarkMagenta = HexColor.colorDarkMagenta; - public byte drawFrictionImpulses; + public const HexColor colorDarkOliveGreen = HexColor.colorDarkOliveGreen; - public void* context; - } + public const HexColor colorDarkOrange = HexColor.colorDarkOrange; - public partial struct DistanceCache - { - public ushort count; + public const HexColor colorDarkOrchid = HexColor.colorDarkOrchid; - public fixed byte indexA[3]; + public const HexColor colorDarkRed = HexColor.colorDarkRed; - public fixed byte indexB[3]; - } + public const HexColor colorDarkSalmon = HexColor.colorDarkSalmon; - public partial struct DistanceInput - { - public DistanceProxy proxyA; + public const HexColor colorDarkSeaGreen = HexColor.colorDarkSeaGreen; - public DistanceProxy proxyB; + public const HexColor colorDarkSlateBlue = HexColor.colorDarkSlateBlue; - public Transform transformA; + public const HexColor colorDarkSlateGray = HexColor.colorDarkSlateGray; - public Transform transformB; + public const HexColor colorDarkTurquoise = HexColor.colorDarkTurquoise; - public byte useRadii; - } + public const HexColor colorDarkViolet = HexColor.colorDarkViolet; - public partial struct DistanceJointDef - { - public BodyId bodyIdA; + public const HexColor colorDeepPink = HexColor.colorDeepPink; - public BodyId bodyIdB; + public const HexColor colorDeepSkyBlue = HexColor.colorDeepSkyBlue; - public Vec2 localAnchorA; + public const HexColor colorDimGray = HexColor.colorDimGray; - public Vec2 localAnchorB; + public const HexColor colorDodgerBlue = HexColor.colorDodgerBlue; - public float length; + public const HexColor colorFireBrick = HexColor.colorFireBrick; - public byte enableSpring; + public const HexColor colorFloralWhite = HexColor.colorFloralWhite; - public float hertz; + public const HexColor colorForestGreen = HexColor.colorForestGreen; - public float dampingRatio; + public const HexColor colorFuchsia = HexColor.colorFuchsia; - public byte enableLimit; + public const HexColor colorGainsboro = HexColor.colorGainsboro; - public float minLength; + public const HexColor colorGhostWhite = HexColor.colorGhostWhite; - public float maxLength; + public const HexColor colorGold = HexColor.colorGold; - public byte enableMotor; + public const HexColor colorGoldenRod = HexColor.colorGoldenRod; - public float maxMotorForce; + public const HexColor colorGray = HexColor.colorGray; - public float motorSpeed; + public const HexColor colorGreen = HexColor.colorGreen; - public byte collideConnected; + public const HexColor colorGreenYellow = HexColor.colorGreenYellow; - public void* userData; + public const HexColor colorHoneyDew = HexColor.colorHoneyDew; - public int internalValue; - } + public const HexColor colorHotPink = HexColor.colorHotPink; - public partial struct DistanceOutput - { - public Vec2 pointA; + public const HexColor colorIndianRed = HexColor.colorIndianRed; - public Vec2 pointB; + public const HexColor colorIndigo = HexColor.colorIndigo; - public float distance; + public const HexColor colorIvory = HexColor.colorIvory; - public int iterations; + public const HexColor colorKhaki = HexColor.colorKhaki; - public int simplexCount; - } + public const HexColor colorLavender = HexColor.colorLavender; - public partial struct DistanceProxy - { - public points_FixedBuffer points; + public const HexColor colorLavenderBlush = HexColor.colorLavenderBlush; - public int count; + public const HexColor colorLawnGreen = HexColor.colorLawnGreen; - public float radius; + public const HexColor colorLemonChiffon = HexColor.colorLemonChiffon; - public partial struct points_FixedBuffer - { - public Vec2 Item0; + public const HexColor colorLightBlue = HexColor.colorLightBlue; - public Vec2 Item1; + public const HexColor colorLightCoral = HexColor.colorLightCoral; - public Vec2 Item2; + public const HexColor colorLightCyan = HexColor.colorLightCyan; - public Vec2 Item3; + public const HexColor colorLightGoldenRodYellow = HexColor.colorLightGoldenRodYellow; - public Vec2 Item4; + public const HexColor colorLightGray = HexColor.colorLightGray; - public Vec2 Item5; + public const HexColor colorLightGreen = HexColor.colorLightGreen; - public Vec2 Item6; + public const HexColor colorLightPink = HexColor.colorLightPink; - public Vec2 Item7; + public const HexColor colorLightSalmon = HexColor.colorLightSalmon; - public ref Vec2 this[int index] => ref AsSpan()[index]; + public const HexColor colorLightSeaGreen = HexColor.colorLightSeaGreen; - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } - } + public const HexColor colorLightSkyBlue = HexColor.colorLightSkyBlue; - public partial struct DynamicTree - { - public TreeNode* nodes; + public const HexColor colorLightSlateGray = HexColor.colorLightSlateGray; - public int root; + public const HexColor colorLightSteelBlue = HexColor.colorLightSteelBlue; - public int nodeCount; + public const HexColor colorLightYellow = HexColor.colorLightYellow; - public int nodeCapacity; + public const HexColor colorLime = HexColor.colorLime; - public int freeList; + public const HexColor colorLimeGreen = HexColor.colorLimeGreen; - public int proxyCount; + public const HexColor colorLinen = HexColor.colorLinen; - public int* leafIndices; + public const HexColor colorMagenta = HexColor.colorMagenta; - public AABB* leafBoxes; + public const HexColor colorMaroon = HexColor.colorMaroon; - public Vec2* leafCenters; + public const HexColor colorMediumAquaMarine = HexColor.colorMediumAquaMarine; - public int* binIndices; + public const HexColor colorMediumBlue = HexColor.colorMediumBlue; - public int rebuildCapacity; - } + public const HexColor colorMediumOrchid = HexColor.colorMediumOrchid; - public partial struct Filter - { - public uint categoryBits; + public const HexColor colorMediumPurple = HexColor.colorMediumPurple; - public uint maskBits; + public const HexColor colorMediumSeaGreen = HexColor.colorMediumSeaGreen; - public int groupIndex; - } + public const HexColor colorMediumSlateBlue = HexColor.colorMediumSlateBlue; - public partial struct Hull - { - public points_FixedBuffer points; + public const HexColor colorMediumSpringGreen = HexColor.colorMediumSpringGreen; - public int count; + public const HexColor colorMediumTurquoise = HexColor.colorMediumTurquoise; - public partial struct points_FixedBuffer - { - public Vec2 Item0; + public const HexColor colorMediumVioletRed = HexColor.colorMediumVioletRed; - public Vec2 Item1; + public const HexColor colorMidnightBlue = HexColor.colorMidnightBlue; - public Vec2 Item2; + public const HexColor colorMintCream = HexColor.colorMintCream; - public Vec2 Item3; + public const HexColor colorMistyRose = HexColor.colorMistyRose; - public Vec2 Item4; + public const HexColor colorMoccasin = HexColor.colorMoccasin; - public Vec2 Item5; + public const HexColor colorNavajoWhite = HexColor.colorNavajoWhite; - public Vec2 Item6; + public const HexColor colorNavy = HexColor.colorNavy; - public Vec2 Item7; + public const HexColor colorOldLace = HexColor.colorOldLace; - public ref Vec2 this[int index] => ref AsSpan()[index]; + public const HexColor colorOlive = HexColor.colorOlive; - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } - } + public const HexColor colorOliveDrab = HexColor.colorOliveDrab; - public partial struct JointId - { - public int index1; + public const HexColor colorOrange = HexColor.colorOrange; - public ushort world0; + public const HexColor colorOrangeRed = HexColor.colorOrangeRed; - public ushort revision; - } + public const HexColor colorOrchid = HexColor.colorOrchid; - public partial struct Manifold - { - public points_FixedBuffer points; + public const HexColor colorPaleGoldenRod = HexColor.colorPaleGoldenRod; - public Vec2 normal; + public const HexColor colorPaleGreen = HexColor.colorPaleGreen; - public int pointCount; + public const HexColor colorPaleTurquoise = HexColor.colorPaleTurquoise; - public partial struct points_FixedBuffer - { - public ManifoldPoint Item0; + public const HexColor colorPaleVioletRed = HexColor.colorPaleVioletRed; - public ManifoldPoint Item1; + public const HexColor colorPapayaWhip = HexColor.colorPapayaWhip; - public ref ManifoldPoint this[int index] => ref AsSpan()[index]; + public const HexColor colorPeachPuff = HexColor.colorPeachPuff; - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 2); - } - } + public const HexColor colorPeru = HexColor.colorPeru; - public partial struct ManifoldPoint - { - public Vec2 point; + public const HexColor colorPink = HexColor.colorPink; - public Vec2 anchorA; + public const HexColor colorPlum = HexColor.colorPlum; - public Vec2 anchorB; + public const HexColor colorPowderBlue = HexColor.colorPowderBlue; - public float separation; + public const HexColor colorPurple = HexColor.colorPurple; - public float normalImpulse; + public const HexColor colorRebeccaPurple = HexColor.colorRebeccaPurple; - public float tangentImpulse; + public const HexColor colorRed = HexColor.colorRed; - public float maxNormalImpulse; + public const HexColor colorRosyBrown = HexColor.colorRosyBrown; - public float normalVelocity; + public const HexColor colorRoyalBlue = HexColor.colorRoyalBlue; - public ushort id; + public const HexColor colorSaddleBrown = HexColor.colorSaddleBrown; - public byte persisted; - } + public const HexColor colorSalmon = HexColor.colorSalmon; - public partial struct MassData - { - public float mass; + public const HexColor colorSandyBrown = HexColor.colorSandyBrown; - public Vec2 center; + public const HexColor colorSeaGreen = HexColor.colorSeaGreen; - public float rotationalInertia; - } + public const HexColor colorSeaShell = HexColor.colorSeaShell; - public partial struct Mat22 - { - public Vec2 cx; + public const HexColor colorSienna = HexColor.colorSienna; - public Vec2 cy; - } + public const HexColor colorSilver = HexColor.colorSilver; - public partial struct MotorJointDef - { - public BodyId bodyIdA; + public const HexColor colorSkyBlue = HexColor.colorSkyBlue; - public BodyId bodyIdB; + public const HexColor colorSlateBlue = HexColor.colorSlateBlue; - public Vec2 linearOffset; + public const HexColor colorSlateGray = HexColor.colorSlateGray; - public float angularOffset; + public const HexColor colorSnow = HexColor.colorSnow; - public float maxForce; + public const HexColor colorSpringGreen = HexColor.colorSpringGreen; - public float maxTorque; + public const HexColor colorSteelBlue = HexColor.colorSteelBlue; - public float correctionFactor; + public const HexColor colorTan = HexColor.colorTan; - public byte collideConnected; + public const HexColor colorTeal = HexColor.colorTeal; - public void* userData; + public const HexColor colorThistle = HexColor.colorThistle; - public int internalValue; - } + public const HexColor colorTomato = HexColor.colorTomato; - public partial struct MouseJointDef - { - public BodyId bodyIdA; + public const HexColor colorTurquoise = HexColor.colorTurquoise; - public BodyId bodyIdB; + public const HexColor colorViolet = HexColor.colorViolet; - public Vec2 target; + public const HexColor colorWheat = HexColor.colorWheat; - public float hertz; + public const HexColor colorWhite = HexColor.colorWhite; - public float dampingRatio; + public const HexColor colorWhiteSmoke = HexColor.colorWhiteSmoke; - public float maxForce; + public const HexColor colorYellow = HexColor.colorYellow; - public byte collideConnected; + public const HexColor colorYellowGreen = HexColor.colorYellowGreen; - public void* userData; + public const HexColor colorBox2DRed = HexColor.colorBox2DRed; - public int internalValue; - } + public const HexColor colorBox2DBlue = HexColor.colorBox2DBlue; - public partial struct Polygon - { - public vertices_FixedBuffer vertices; + public const HexColor colorBox2DGreen = HexColor.colorBox2DGreen; - public normals_FixedBuffer normals; + public const HexColor colorBox2DYellow = HexColor.colorBox2DYellow; - public Vec2 centroid; + public const JointType distanceJoint = JointType.distanceJoint; - public float radius; + public const JointType filterJoint = JointType.filterJoint; - public int count; + public const JointType motorJoint = JointType.motorJoint; - public partial struct vertices_FixedBuffer - { - public Vec2 Item0; + public const JointType mouseJoint = JointType.mouseJoint; - public Vec2 Item1; + public const JointType prismaticJoint = JointType.prismaticJoint; - public Vec2 Item2; + public const JointType revoluteJoint = JointType.revoluteJoint; - public Vec2 Item3; + public const JointType weldJoint = JointType.weldJoint; - public Vec2 Item4; + public const JointType wheelJoint = JointType.wheelJoint; - public Vec2 Item5; + public const ShapeType circleShape = ShapeType.circleShape; - public Vec2 Item6; + public const ShapeType capsuleShape = ShapeType.capsuleShape; - public Vec2 Item7; + public const ShapeType segmentShape = ShapeType.segmentShape; - public ref Vec2 this[int index] => ref AsSpan()[index]; + public const ShapeType polygonShape = ShapeType.polygonShape; - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } + public const ShapeType chainSegmentShape = ShapeType.chainSegmentShape; - public partial struct normals_FixedBuffer - { - public Vec2 Item0; + public const ShapeType shapeTypeCount = ShapeType.shapeTypeCount; - public Vec2 Item1; + public const TOIState toiStateUnknown = TOIState.toiStateUnknown; - public Vec2 Item2; + public const TOIState toiStateFailed = TOIState.toiStateFailed; - public Vec2 Item3; + public const TOIState toiStateOverlapped = TOIState.toiStateOverlapped; - public Vec2 Item4; + public const TOIState toiStateHit = TOIState.toiStateHit; - public Vec2 Item5; + public const TOIState toiStateSeparated = TOIState.toiStateSeparated; - public Vec2 Item6; + public partial struct Version + { + public int major; - public Vec2 Item7; + public int minor; - public ref Vec2 this[int index] => ref AsSpan()[index]; + public int revision; + } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } - } + public partial struct Vec2 + { + public float x; - public partial struct PrismaticJointDef - { - public BodyId bodyIdA; + public float y; + } - public BodyId bodyIdB; + public partial struct CosSin + { + public float cosine; - public Vec2 localAnchorA; + public float sine; + } - public Vec2 localAnchorB; + public partial struct Rot + { + public float c; - public Vec2 localAxisA; + public float s; + } - public float referenceAngle; + public partial struct Transform + { + public Vec2 p; - public byte enableSpring; + public Rot q; + } - public float hertz; + public partial struct Mat22 + { + public Vec2 cx; - public float dampingRatio; + public Vec2 cy; + } - public byte enableLimit; + public partial struct AABB + { + public Vec2 lowerBound; - public float lowerTranslation; + public Vec2 upperBound; + } - public float upperTranslation; + public partial struct Plane + { + public Vec2 normal; - public byte enableMotor; + public float offset; + } - public float maxMotorForce; + public partial struct SimplexCache + { + public ushort count; - public float motorSpeed; + public InlineArrays.byte_3 indexA; - public byte collideConnected; + public InlineArrays.byte_3 indexB; + } - public void* userData; + public partial struct Hull + { + public InlineArrays.Vec2_8 points; - public int internalValue; - } + public int count; + } - public partial struct Profile - { - public float step; + public partial struct RayCastInput + { + public Vec2 origin; - public float pairs; + public Vec2 translation; - public float collide; + public float maxFraction; + } - public float solve; + public partial struct ShapeProxy + { + public InlineArrays.Vec2_8 points; - public float buildIslands; + public int count; - public float solveConstraints; + public float radius; + } - public float prepareTasks; + public partial struct ShapeCastInput + { + public ShapeProxy proxy; - public float solverTasks; + public Vec2 translation; - public float prepareConstraints; + public float maxFraction; - public float integrateVelocities; + public bool canEncroach; + } - public float warmStart; + public partial struct CastOutput + { + public Vec2 normal; - public float solveVelocities; + public Vec2 point; - public float integratePositions; + public float fraction; - public float relaxVelocities; + public int iterations; - public float applyRestitution; + public bool hit; + } - public float storeImpulses; + public partial struct MassData + { + public float mass; - public float finalizeBodies; + public Vec2 center; - public float splitIslands; + public float rotationalInertia; + } - public float sleepIslands; + public partial struct Circle + { + public Vec2 center; - public float hitEvents; + public float radius; + } - public float broadphase; + public partial struct Capsule + { + public Vec2 center1; - public float continuous; - } + public Vec2 center2; - public partial struct QueryFilter - { - public uint categoryBits; + public float radius; + } - public uint maskBits; - } + public partial struct Polygon + { + public InlineArrays.Vec2_8 vertices; - public partial struct RayCastInput - { - public Vec2 origin; + public InlineArrays.Vec2_8 normals; - public Vec2 translation; + public Vec2 centroid; - public float maxFraction; - } + public float radius; - public partial struct RayResult - { - public ShapeId shapeId; + public int count; + } - public Vec2 point; + public partial struct Segment + { + public Vec2 point1; - public Vec2 normal; + public Vec2 point2; + } - public float fraction; + public partial struct ChainSegment + { + public Vec2 ghost1; - public byte hit; - } + public Segment segment; - public partial struct RevoluteJointDef - { - public BodyId bodyIdA; + public Vec2 ghost2; - public BodyId bodyIdB; + public int chainId; + } - public Vec2 localAnchorA; + public partial struct SegmentDistanceResult + { + public Vec2 closest1; - public Vec2 localAnchorB; + public Vec2 closest2; - public float referenceAngle; + public float fraction1; - public byte enableSpring; + public float fraction2; - public float hertz; + public float distanceSquared; + } - public float dampingRatio; + public partial struct DistanceInput + { + public ShapeProxy proxyA; - public byte enableLimit; + public ShapeProxy proxyB; - public float lowerAngle; + public Transform transformA; - public float upperAngle; + public Transform transformB; - public byte enableMotor; + public bool useRadii; + } - public float maxMotorTorque; + public partial struct DistanceOutput + { + public Vec2 pointA; - public float motorSpeed; + public Vec2 pointB; - public float drawSize; + public Vec2 normal; - public byte collideConnected; + public float distance; - public void* userData; + public int iterations; - public int internalValue; - } + public int simplexCount; + } - public partial struct Rot - { - public float c; + public partial struct SimplexVertex + { + public Vec2 wA; - public float s; - } + public Vec2 wB; - public partial struct Segment - { - public Vec2 point1; + public Vec2 w; - public Vec2 point2; - } + public float a; - public partial struct SegmentDistanceResult - { - public Vec2 closest1; + public int indexA; - public Vec2 closest2; + public int indexB; + } - public float fraction1; + public partial struct Simplex + { + public SimplexVertex v1; - public float fraction2; + public SimplexVertex v2; - public float distanceSquared; - } + public SimplexVertex v3; - public partial struct SensorBeginTouchEvent - { - public ShapeId sensorShapeId; + public int count; + } - public ShapeId visitorShapeId; - } + public partial struct ShapeCastPairInput + { + public ShapeProxy proxyA; - public partial struct SensorEndTouchEvent - { - public ShapeId sensorShapeId; + public ShapeProxy proxyB; - public ShapeId visitorShapeId; - } + public Transform transformA; - public partial struct SensorEvents - { - public SensorBeginTouchEvent* beginEvents; + public Transform transformB; - public SensorEndTouchEvent* endEvents; + public Vec2 translationB; - public int beginCount; + public float maxFraction; - public int endCount; - } + public bool canEncroach; + } - public partial struct ShapeCastInput - { - public points_FixedBuffer points; + public partial struct Sweep + { + public Vec2 localCenter; - public int count; + public Vec2 c1; - public float radius; + public Vec2 c2; - public Vec2 translation; + public Rot q1; - public float maxFraction; + public Rot q2; + } - public partial struct points_FixedBuffer - { - public Vec2 Item0; + public partial struct TOIInput + { + public ShapeProxy proxyA; - public Vec2 Item1; + public ShapeProxy proxyB; - public Vec2 Item2; + public Sweep sweepA; - public Vec2 Item3; + public Sweep sweepB; - public Vec2 Item4; + public float maxFraction; + } - public Vec2 Item5; + public partial struct TOIOutput + { + public TOIState state; - public Vec2 Item6; + public float fraction; + } - public Vec2 Item7; + public partial struct ManifoldPoint + { + public Vec2 point; - public ref Vec2 this[int index] => ref AsSpan()[index]; + public Vec2 anchorA; - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } - } + public Vec2 anchorB; - public partial struct ShapeCastPairInput - { - public DistanceProxy proxyA; + public float separation; - public DistanceProxy proxyB; + public float normalImpulse; - public Transform transformA; + public float tangentImpulse; - public Transform transformB; + public float totalNormalImpulse; - public Vec2 translationB; + public float normalVelocity; - public float maxFraction; - } + public ushort id; - public partial struct ShapeDef - { - public void* userData; + public bool persisted; + } - public float friction; + public partial struct Manifold + { + public Vec2 normal; - public float restitution; + public float rollingImpulse; - public float density; + public InlineArrays.ManifoldPoint_2 points; - public Filter filter; + public int pointCount; + } - public uint customColor; + public partial struct DynamicTree + { + public TreeNode* nodes; - public byte isSensor; + public int root; - public byte enableSensorEvents; + public int nodeCount; - public byte enableContactEvents; + public int nodeCapacity; - public byte enableHitEvents; + public int freeList; - public byte enablePreSolveEvents; + public int proxyCount; - public byte forceContactCreation; + public int* leafIndices; - public int internalValue; - } + public AABB* leafBoxes; - public partial struct ShapeId - { - public int index1; + public Vec2* leafCenters; - public ushort world0; + public int* binIndices; - public ushort revision; - } + public int rebuildCapacity; + } - public partial struct Simplex - { - public SimplexVertex v1; + public partial struct TreeNode + { + } - public SimplexVertex v2; + public partial struct TreeStats + { + public int nodeVisits; - public SimplexVertex v3; + public int leafVisits; + } - public int count; - } + public partial struct PlaneResult + { + public Plane plane; - public partial struct SimplexVertex - { - public Vec2 wA; + public bool hit; + } - public Vec2 wB; + public partial struct CollisionPlane + { + public Plane plane; - public Vec2 w; + public float pushLimit; - public float a; + public float push; - public int indexA; + public bool clipVelocity; + } - public int indexB; - } + public partial struct PlaneSolverResult + { + public Vec2 position; - public partial struct SmoothSegment - { - public Vec2 ghost1; + public int iterationCount; + } - public Segment segment; + public partial struct WorldId + { + public ushort index1; - public Vec2 ghost2; + public ushort generation; + } - public int chainId; - } + public partial struct BodyId + { + public int index1; - public partial struct Sweep - { - public Vec2 localCenter; + public ushort world0; - public Vec2 c1; + public ushort generation; + } - public Vec2 c2; + public partial struct ShapeId + { + public int index1; - public Rot q1; + public ushort world0; - public Rot q2; - } + public ushort generation; + } - public partial struct Timer - { - public ulong start_sec; + public partial struct ChainId + { + public int index1; - public ulong start_usec; - } + public ushort world0; - public partial struct TOIInput - { - public DistanceProxy proxyA; + public ushort generation; + } - public DistanceProxy proxyB; + public partial struct JointId + { + public int index1; - public Sweep sweepA; + public ushort world0; - public Sweep sweepB; + public ushort generation; + } - public float tMax; - } + public partial struct RayResult + { + public ShapeId shapeId; - public partial struct TOIOutput - { - public TOIState state; + public Vec2 point; - public float t; - } + public Vec2 normal; - public partial struct Transform - { - public Vec2 p; + public float fraction; - public Rot q; - } + public int nodeVisits; - public partial struct TreeNode - { - public AABB aabb; + public int leafVisits; - public uint categoryBits; + public bool hit; + } - public AnonymousRecord_collision_L608_C2 AnonymousRecord_collision_L608_C2_Field; + public partial struct WorldDef + { + public Vec2 gravity; - public int child1; + public float restitutionThreshold; - public int child2; + public float hitEventThreshold; - public int userData; + public float contactHertz; - public short height; + public float contactDampingRatio; - public byte enlarged; + public float maxContactPushSpeed; - public fixed byte pad[9]; + public float jointHertz; - public ref int parent => ref AnonymousRecord_collision_L608_C2_Field.parent; + public float jointDampingRatio; - public ref int next => ref AnonymousRecord_collision_L608_C2_Field.next; + public float maximumLinearSpeed; - [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)] - public partial struct AnonymousRecord_collision_L608_C2 - { - [System.Runtime.InteropServices.FieldOffset(0)] - public int parent; + public delegate* unmanaged frictionCallback; - [System.Runtime.InteropServices.FieldOffset(0)] - public int next; - } - } + public delegate* unmanaged restitutionCallback; - public partial struct Vec2 - { - public float x; + public bool enableSleep; - public float y; - } + public bool enableContinuous; - public partial struct Version - { - public int major; + public int workerCount; - public int minor; + public delegate* unmanaged , int, int, void*, void*, void*> enqueueTask; - public int revision; - } + public delegate* unmanaged finishTask; - public partial struct WeldJointDef - { - public BodyId bodyIdA; + public void* userTaskContext; - public BodyId bodyIdB; + public void* userData; - public Vec2 localAnchorA; + public int internalValue; + } - public Vec2 localAnchorB; + public partial struct BodyDef + { + public BodyType type; - public float referenceAngle; + public Vec2 position; - public float linearHertz; + public Rot rotation; - public float angularHertz; + public Vec2 linearVelocity; - public float linearDampingRatio; + public float angularVelocity; - public float angularDampingRatio; + public float linearDamping; - public byte collideConnected; + public float angularDamping; - public void* userData; + public float gravityScale; - public int internalValue; - } + public float sleepThreshold; - public partial struct WheelJointDef - { - public BodyId bodyIdA; + public byte* name; - public BodyId bodyIdB; + public void* userData; - public Vec2 localAnchorA; + public bool enableSleep; - public Vec2 localAnchorB; + public bool isAwake; - public Vec2 localAxisA; + public bool fixedRotation; - public byte enableSpring; + public bool isBullet; - public float hertz; + public bool isEnabled; - public float dampingRatio; + public bool allowFastRotation; - public byte enableLimit; + public int internalValue; + } - public float lowerTranslation; + public partial struct Filter + { + public ulong categoryBits; - public float upperTranslation; + public ulong maskBits; - public byte enableMotor; + public int groupIndex; + } - public float maxMotorTorque; + public partial struct QueryFilter + { + public ulong categoryBits; - public float motorSpeed; + public ulong maskBits; + } - public byte collideConnected; + public partial struct SurfaceMaterial + { + public float friction; - public void* userData; + public float restitution; - public int internalValue; - } + public float rollingResistance; - public partial struct WorldDef - { - public Vec2 gravity; + public float tangentSpeed; - public float restitutionThreshold; + public int userMaterialId; - public float contactPushoutVelocity; + public uint customColor; + } - public float hitEventThreshold; + public partial struct ShapeDef + { + public void* userData; - public float contactHertz; + public SurfaceMaterial material; - public float contactDampingRatio; + public float density; - public float jointHertz; + public Filter filter; - public float jointDampingRatio; + public bool isSensor; - public float maximumLinearVelocity; + public bool enableSensorEvents; - public byte enableSleep; + public bool enableContactEvents; - public byte enableContinous; + public bool enableHitEvents; - public int workerCount; + public bool enablePreSolveEvents; - public System.IntPtr enqueueTask; // delegate* + public bool invokeContactCreation; - public System.IntPtr finishTask; // delegate* + public bool updateBodyMass; - public void* userTaskContext; + public int internalValue; + } - public int internalValue; - } + public partial struct ChainDef + { + public void* userData; - public partial struct WorldId - { - public ushort index1; + public Vec2* points; - public ushort revision; - } + public int count; - public enum BodyType : uint - { - staticBody = 0, - kinematicBody = 1, - dynamicBody = 2, - bodyTypeCount = 3 - } - - public enum HexColor : uint - { - colorAliceBlue = 15792383, - colorAntiqueWhite = 16444375, - colorAqua = 65535, - colorAquamarine = 8388564, - colorAzure = 15794175, - colorBeige = 16119260, - colorBisque = 16770244, - colorBlack = 0, - colorBlanchedAlmond = 16772045, - colorBlue = 255, - colorBlueViolet = 9055202, - colorBrown = 10824234, - colorBurlywood = 14596231, - colorCadetBlue = 6266528, - colorChartreuse = 8388352, - colorChocolate = 13789470, - colorCoral = 16744272, - colorCornflowerBlue = 6591981, - colorCornsilk = 16775388, - colorCrimson = 14423100, - colorCyan = 65535, - colorDarkBlue = 139, - colorDarkCyan = 35723, - colorDarkGoldenrod = 12092939, - colorDarkGray = 11119017, - colorDarkGreen = 25600, - colorDarkKhaki = 12433259, - colorDarkMagenta = 9109643, - colorDarkOliveGreen = 5597999, - colorDarkOrange = 16747520, - colorDarkOrchid = 10040012, - colorDarkRed = 9109504, - colorDarkSalmon = 15308410, - colorDarkSeaGreen = 9419919, - colorDarkSlateBlue = 4734347, - colorDarkSlateGray = 3100495, - colorDarkTurquoise = 52945, - colorDarkViolet = 9699539, - colorDeepPink = 16716947, - colorDeepSkyBlue = 49151, - colorDimGray = 6908265, - colorDodgerBlue = 2003199, - colorFirebrick = 11674146, - colorFloralWhite = 16775920, - colorForestGreen = 2263842, - colorFuchsia = 16711935, - colorGainsboro = 14474460, - colorGhostWhite = 16316671, - colorGold = 16766720, - colorGoldenrod = 14329120, - colorGray = 12500670, - colorGray1 = 1710618, - colorGray2 = 3355443, - colorGray3 = 5066061, - colorGray4 = 6710886, - colorGray5 = 8355711, - colorGray6 = 10066329, - colorGray7 = 11776947, - colorGray8 = 13421772, - colorGray9 = 15066597, - colorGreen = 65280, - colorGreenYellow = 11403055, - colorHoneydew = 15794160, - colorHotPink = 16738740, - colorIndianRed = 13458524, - colorIndigo = 4915330, - colorIvory = 16777200, - colorKhaki = 15787660, - colorLavender = 15132410, - colorLavenderBlush = 16773365, - colorLawnGreen = 8190976, - colorLemonChiffon = 16775885, - colorLightBlue = 11393254, - colorLightCoral = 15761536, - colorLightCyan = 14745599, - colorLightGoldenrod = 15654274, - colorLightGoldenrodYellow = 16448210, - colorLightGray = 13882323, - colorLightGreen = 9498256, - colorLightPink = 16758465, - colorLightSalmon = 16752762, - colorLightSeaGreen = 2142890, - colorLightSkyBlue = 8900346, - colorLightSlateBlue = 8679679, - colorLightSlateGray = 7833753, - colorLightSteelBlue = 11584734, - colorLightYellow = 16777184, - colorLime = 65280, - colorLimeGreen = 3329330, - colorLinen = 16445670, - colorMagenta = 16711935, - colorMaroon = 11546720, - colorMediumAquamarine = 6737322, - colorMediumBlue = 205, - colorMediumOrchid = 12211667, - colorMediumPurple = 9662683, - colorMediumSeaGreen = 3978097, - colorMediumSlateBlue = 8087790, - colorMediumSpringGreen = 64154, - colorMediumTurquoise = 4772300, - colorMediumVioletRed = 13047173, - colorMidnightBlue = 1644912, - colorMintCream = 16121850, - colorMistyRose = 16770273, - colorMoccasin = 16770229, - colorNavajoWhite = 16768685, - colorNavy = 128, - colorNavyBlue = 128, - colorOldLace = 16643558, - colorOlive = 8421376, - colorOliveDrab = 7048739, - colorOrange = 16753920, - colorOrangeRed = 16729344, - colorOrchid = 14315734, - colorPaleGoldenrod = 15657130, - colorPaleGreen = 10025880, - colorPaleTurquoise = 11529966, - colorPaleVioletRed = 14381203, - colorPapayaWhip = 16773077, - colorPeachPuff = 16767673, - colorPeru = 13468991, - colorPink = 16761035, - colorPlum = 14524637, - colorPowderBlue = 11591910, - colorPurple = 10494192, - colorRebeccaPurple = 6697881, - colorRed = 16711680, - colorRosyBrown = 12357519, - colorRoyalBlue = 4286945, - colorSaddleBrown = 9127187, - colorSalmon = 16416882, - colorSandyBrown = 16032864, - colorSeaGreen = 3050327, - colorSeashell = 16774638, - colorSienna = 10506797, - colorSilver = 12632256, - colorSkyBlue = 8900331, - colorSlateBlue = 6970061, - colorSlateGray = 7372944, - colorSnow = 16775930, - colorSpringGreen = 65407, - colorSteelBlue = 4620980, - colorTan = 13808780, - colorTeal = 32896, - colorThistle = 14204888, - colorTomato = 16737095, - colorTurquoise = 4251856, - colorViolet = 15631086, - colorVioletRed = 13639824, - colorWheat = 16113331, - colorWhite = 16777215, - colorWhiteSmoke = 16119285, - colorYellow = 16776960, - colorYellowGreen = 10145074, - colorBox2DRed = 14430514, - colorBox2DBlue = 3190463, - colorBox2DGreen = 9226532, - colorBox2DYellow = 16772748 - } - - public enum JointType : uint - { - distanceJoint = 0, - motorJoint = 1, - mouseJoint = 2, - prismaticJoint = 3, - revoluteJoint = 4, - weldJoint = 5, - wheelJoint = 6 - } - - public enum ShapeType : uint - { - circleShape = 0, - capsuleShape = 1, - segmentShape = 2, - polygonShape = 3, - smoothSegmentShape = 4, - shapeTypeCount = 5 - } + public SurfaceMaterial* materials; - public enum TOIState : uint - { - toiStateUnknown = 0, - toiStateFailed = 1, - toiStateOverlapped = 2, - toiStateHit = 3, - toiStateSeparated = 4 - } + public int materialCount; - public const BodyType staticBody = BodyType.staticBody; + public Filter filter; - public const BodyType kinematicBody = BodyType.kinematicBody; + public bool isLoop; - public const BodyType dynamicBody = BodyType.dynamicBody; + public bool enableSensorEvents; - public const BodyType bodyTypeCount = BodyType.bodyTypeCount; + public int internalValue; + } + + public partial struct Profile + { + public float step; + + public float pairs; + + public float collide; + + public float solve; + + public float mergeIslands; + + public float prepareStages; + + public float solveConstraints; - public const HexColor colorAliceBlue = HexColor.colorAliceBlue; + public float prepareConstraints; - public const HexColor colorAntiqueWhite = HexColor.colorAntiqueWhite; + public float integrateVelocities; - public const HexColor colorAqua = HexColor.colorAqua; + public float warmStart; - public const HexColor colorAquamarine = HexColor.colorAquamarine; + public float solveImpulses; - public const HexColor colorAzure = HexColor.colorAzure; + public float integratePositions; - public const HexColor colorBeige = HexColor.colorBeige; + public float relaxImpulses; - public const HexColor colorBisque = HexColor.colorBisque; + public float applyRestitution; - public const HexColor colorBlack = HexColor.colorBlack; + public float storeImpulses; - public const HexColor colorBlanchedAlmond = HexColor.colorBlanchedAlmond; + public float splitIslands; - public const HexColor colorBlue = HexColor.colorBlue; + public float transforms; - public const HexColor colorBlueViolet = HexColor.colorBlueViolet; + public float hitEvents; - public const HexColor colorBrown = HexColor.colorBrown; + public float refit; - public const HexColor colorBurlywood = HexColor.colorBurlywood; + public float bullets; - public const HexColor colorCadetBlue = HexColor.colorCadetBlue; + public float sleepIslands; - public const HexColor colorChartreuse = HexColor.colorChartreuse; + public float sensors; + } + + public partial struct Counters + { + public int bodyCount; - public const HexColor colorChocolate = HexColor.colorChocolate; + public int shapeCount; - public const HexColor colorCoral = HexColor.colorCoral; + public int contactCount; - public const HexColor colorCornflowerBlue = HexColor.colorCornflowerBlue; + public int jointCount; - public const HexColor colorCornsilk = HexColor.colorCornsilk; + public int islandCount; - public const HexColor colorCrimson = HexColor.colorCrimson; + public int stackUsed; - public const HexColor colorCyan = HexColor.colorCyan; + public int staticTreeHeight; - public const HexColor colorDarkBlue = HexColor.colorDarkBlue; + public int treeHeight; - public const HexColor colorDarkCyan = HexColor.colorDarkCyan; + public int byteCount; - public const HexColor colorDarkGoldenrod = HexColor.colorDarkGoldenrod; + public int taskCount; + + public InlineArrays.int_12 colorCounts; + } - public const HexColor colorDarkGray = HexColor.colorDarkGray; + public partial struct DistanceJointDef + { + public BodyId bodyIdA; - public const HexColor colorDarkGreen = HexColor.colorDarkGreen; + public BodyId bodyIdB; - public const HexColor colorDarkKhaki = HexColor.colorDarkKhaki; + public Vec2 localAnchorA; - public const HexColor colorDarkMagenta = HexColor.colorDarkMagenta; + public Vec2 localAnchorB; - public const HexColor colorDarkOliveGreen = HexColor.colorDarkOliveGreen; + public float length; - public const HexColor colorDarkOrange = HexColor.colorDarkOrange; + public bool enableSpring; - public const HexColor colorDarkOrchid = HexColor.colorDarkOrchid; + public float hertz; - public const HexColor colorDarkRed = HexColor.colorDarkRed; + public float dampingRatio; - public const HexColor colorDarkSalmon = HexColor.colorDarkSalmon; + public bool enableLimit; - public const HexColor colorDarkSeaGreen = HexColor.colorDarkSeaGreen; + public float minLength; - public const HexColor colorDarkSlateBlue = HexColor.colorDarkSlateBlue; + public float maxLength; - public const HexColor colorDarkSlateGray = HexColor.colorDarkSlateGray; + public bool enableMotor; - public const HexColor colorDarkTurquoise = HexColor.colorDarkTurquoise; + public float maxMotorForce; - public const HexColor colorDarkViolet = HexColor.colorDarkViolet; + public float motorSpeed; - public const HexColor colorDeepPink = HexColor.colorDeepPink; + public bool collideConnected; - public const HexColor colorDeepSkyBlue = HexColor.colorDeepSkyBlue; + public void* userData; - public const HexColor colorDimGray = HexColor.colorDimGray; + public int internalValue; + } - public const HexColor colorDodgerBlue = HexColor.colorDodgerBlue; + public partial struct MotorJointDef + { + public BodyId bodyIdA; - public const HexColor colorFirebrick = HexColor.colorFirebrick; + public BodyId bodyIdB; - public const HexColor colorFloralWhite = HexColor.colorFloralWhite; + public Vec2 linearOffset; - public const HexColor colorForestGreen = HexColor.colorForestGreen; + public float angularOffset; - public const HexColor colorFuchsia = HexColor.colorFuchsia; + public float maxForce; - public const HexColor colorGainsboro = HexColor.colorGainsboro; + public float maxTorque; - public const HexColor colorGhostWhite = HexColor.colorGhostWhite; + public float correctionFactor; - public const HexColor colorGold = HexColor.colorGold; + public bool collideConnected; - public const HexColor colorGoldenrod = HexColor.colorGoldenrod; + public void* userData; - public const HexColor colorGray = HexColor.colorGray; + public int internalValue; + } - public const HexColor colorGray1 = HexColor.colorGray1; + public partial struct MouseJointDef + { + public BodyId bodyIdA; - public const HexColor colorGray2 = HexColor.colorGray2; + public BodyId bodyIdB; - public const HexColor colorGray3 = HexColor.colorGray3; + public Vec2 target; - public const HexColor colorGray4 = HexColor.colorGray4; + public float hertz; - public const HexColor colorGray5 = HexColor.colorGray5; + public float dampingRatio; - public const HexColor colorGray6 = HexColor.colorGray6; + public float maxForce; - public const HexColor colorGray7 = HexColor.colorGray7; + public bool collideConnected; - public const HexColor colorGray8 = HexColor.colorGray8; + public void* userData; - public const HexColor colorGray9 = HexColor.colorGray9; + public int internalValue; + } - public const HexColor colorGreen = HexColor.colorGreen; + public partial struct FilterJointDef + { + public BodyId bodyIdA; - public const HexColor colorGreenYellow = HexColor.colorGreenYellow; + public BodyId bodyIdB; - public const HexColor colorHoneydew = HexColor.colorHoneydew; + public void* userData; - public const HexColor colorHotPink = HexColor.colorHotPink; + public int internalValue; + } - public const HexColor colorIndianRed = HexColor.colorIndianRed; + public partial struct PrismaticJointDef + { + public BodyId bodyIdA; - public const HexColor colorIndigo = HexColor.colorIndigo; + public BodyId bodyIdB; - public const HexColor colorIvory = HexColor.colorIvory; + public Vec2 localAnchorA; - public const HexColor colorKhaki = HexColor.colorKhaki; + public Vec2 localAnchorB; - public const HexColor colorLavender = HexColor.colorLavender; + public Vec2 localAxisA; - public const HexColor colorLavenderBlush = HexColor.colorLavenderBlush; + public float referenceAngle; - public const HexColor colorLawnGreen = HexColor.colorLawnGreen; + public bool enableSpring; - public const HexColor colorLemonChiffon = HexColor.colorLemonChiffon; + public float hertz; - public const HexColor colorLightBlue = HexColor.colorLightBlue; + public float dampingRatio; - public const HexColor colorLightCoral = HexColor.colorLightCoral; + public bool enableLimit; - public const HexColor colorLightCyan = HexColor.colorLightCyan; + public float lowerTranslation; - public const HexColor colorLightGoldenrod = HexColor.colorLightGoldenrod; + public float upperTranslation; - public const HexColor colorLightGoldenrodYellow = HexColor.colorLightGoldenrodYellow; + public bool enableMotor; - public const HexColor colorLightGray = HexColor.colorLightGray; + public float maxMotorForce; - public const HexColor colorLightGreen = HexColor.colorLightGreen; + public float motorSpeed; - public const HexColor colorLightPink = HexColor.colorLightPink; + public bool collideConnected; - public const HexColor colorLightSalmon = HexColor.colorLightSalmon; + public void* userData; - public const HexColor colorLightSeaGreen = HexColor.colorLightSeaGreen; + public int internalValue; + } - public const HexColor colorLightSkyBlue = HexColor.colorLightSkyBlue; + public partial struct RevoluteJointDef + { + public BodyId bodyIdA; - public const HexColor colorLightSlateBlue = HexColor.colorLightSlateBlue; + public BodyId bodyIdB; - public const HexColor colorLightSlateGray = HexColor.colorLightSlateGray; + public Vec2 localAnchorA; - public const HexColor colorLightSteelBlue = HexColor.colorLightSteelBlue; + public Vec2 localAnchorB; - public const HexColor colorLightYellow = HexColor.colorLightYellow; + public float referenceAngle; - public const HexColor colorLime = HexColor.colorLime; + public bool enableSpring; - public const HexColor colorLimeGreen = HexColor.colorLimeGreen; + public float hertz; - public const HexColor colorLinen = HexColor.colorLinen; + public float dampingRatio; - public const HexColor colorMagenta = HexColor.colorMagenta; + public bool enableLimit; - public const HexColor colorMaroon = HexColor.colorMaroon; + public float lowerAngle; - public const HexColor colorMediumAquamarine = HexColor.colorMediumAquamarine; + public float upperAngle; - public const HexColor colorMediumBlue = HexColor.colorMediumBlue; + public bool enableMotor; - public const HexColor colorMediumOrchid = HexColor.colorMediumOrchid; + public float maxMotorTorque; - public const HexColor colorMediumPurple = HexColor.colorMediumPurple; + public float motorSpeed; - public const HexColor colorMediumSeaGreen = HexColor.colorMediumSeaGreen; + public float drawSize; - public const HexColor colorMediumSlateBlue = HexColor.colorMediumSlateBlue; + public bool collideConnected; - public const HexColor colorMediumSpringGreen = HexColor.colorMediumSpringGreen; + public void* userData; - public const HexColor colorMediumTurquoise = HexColor.colorMediumTurquoise; + public int internalValue; + } - public const HexColor colorMediumVioletRed = HexColor.colorMediumVioletRed; + public partial struct WeldJointDef + { + public BodyId bodyIdA; - public const HexColor colorMidnightBlue = HexColor.colorMidnightBlue; + public BodyId bodyIdB; - public const HexColor colorMintCream = HexColor.colorMintCream; + public Vec2 localAnchorA; - public const HexColor colorMistyRose = HexColor.colorMistyRose; + public Vec2 localAnchorB; - public const HexColor colorMoccasin = HexColor.colorMoccasin; + public float referenceAngle; - public const HexColor colorNavajoWhite = HexColor.colorNavajoWhite; + public float linearHertz; - public const HexColor colorNavy = HexColor.colorNavy; + public float angularHertz; - public const HexColor colorNavyBlue = HexColor.colorNavyBlue; + public float linearDampingRatio; - public const HexColor colorOldLace = HexColor.colorOldLace; + public float angularDampingRatio; - public const HexColor colorOlive = HexColor.colorOlive; + public bool collideConnected; - public const HexColor colorOliveDrab = HexColor.colorOliveDrab; + public void* userData; - public const HexColor colorOrange = HexColor.colorOrange; + public int internalValue; + } - public const HexColor colorOrangeRed = HexColor.colorOrangeRed; + public partial struct WheelJointDef + { + public BodyId bodyIdA; - public const HexColor colorOrchid = HexColor.colorOrchid; + public BodyId bodyIdB; - public const HexColor colorPaleGoldenrod = HexColor.colorPaleGoldenrod; + public Vec2 localAnchorA; - public const HexColor colorPaleGreen = HexColor.colorPaleGreen; + public Vec2 localAnchorB; - public const HexColor colorPaleTurquoise = HexColor.colorPaleTurquoise; + public Vec2 localAxisA; - public const HexColor colorPaleVioletRed = HexColor.colorPaleVioletRed; + public bool enableSpring; - public const HexColor colorPapayaWhip = HexColor.colorPapayaWhip; + public float hertz; - public const HexColor colorPeachPuff = HexColor.colorPeachPuff; + public float dampingRatio; - public const HexColor colorPeru = HexColor.colorPeru; + public bool enableLimit; - public const HexColor colorPink = HexColor.colorPink; + public float lowerTranslation; - public const HexColor colorPlum = HexColor.colorPlum; + public float upperTranslation; - public const HexColor colorPowderBlue = HexColor.colorPowderBlue; + public bool enableMotor; - public const HexColor colorPurple = HexColor.colorPurple; + public float maxMotorTorque; - public const HexColor colorRebeccaPurple = HexColor.colorRebeccaPurple; + public float motorSpeed; - public const HexColor colorRed = HexColor.colorRed; + public bool collideConnected; - public const HexColor colorRosyBrown = HexColor.colorRosyBrown; + public void* userData; - public const HexColor colorRoyalBlue = HexColor.colorRoyalBlue; + public int internalValue; + } - public const HexColor colorSaddleBrown = HexColor.colorSaddleBrown; + public partial struct ExplosionDef + { + public ulong maskBits; - public const HexColor colorSalmon = HexColor.colorSalmon; + public Vec2 position; - public const HexColor colorSandyBrown = HexColor.colorSandyBrown; + public float radius; - public const HexColor colorSeaGreen = HexColor.colorSeaGreen; + public float falloff; - public const HexColor colorSeashell = HexColor.colorSeashell; + public float impulsePerLength; + } - public const HexColor colorSienna = HexColor.colorSienna; + public partial struct SensorBeginTouchEvent + { + public ShapeId sensorShapeId; - public const HexColor colorSilver = HexColor.colorSilver; + public ShapeId visitorShapeId; + } - public const HexColor colorSkyBlue = HexColor.colorSkyBlue; + public partial struct SensorEndTouchEvent + { + public ShapeId sensorShapeId; - public const HexColor colorSlateBlue = HexColor.colorSlateBlue; + public ShapeId visitorShapeId; + } - public const HexColor colorSlateGray = HexColor.colorSlateGray; + public partial struct SensorEvents + { + public SensorBeginTouchEvent* beginEvents; - public const HexColor colorSnow = HexColor.colorSnow; + public SensorEndTouchEvent* endEvents; - public const HexColor colorSpringGreen = HexColor.colorSpringGreen; + public int beginCount; - public const HexColor colorSteelBlue = HexColor.colorSteelBlue; + public int endCount; + } - public const HexColor colorTan = HexColor.colorTan; + public partial struct ContactBeginTouchEvent + { + public ShapeId shapeIdA; - public const HexColor colorTeal = HexColor.colorTeal; + public ShapeId shapeIdB; - public const HexColor colorThistle = HexColor.colorThistle; + public Manifold manifold; + } - public const HexColor colorTomato = HexColor.colorTomato; + public partial struct ContactEndTouchEvent + { + public ShapeId shapeIdA; - public const HexColor colorTurquoise = HexColor.colorTurquoise; + public ShapeId shapeIdB; + } - public const HexColor colorViolet = HexColor.colorViolet; + public partial struct ContactHitEvent + { + public ShapeId shapeIdA; - public const HexColor colorVioletRed = HexColor.colorVioletRed; + public ShapeId shapeIdB; - public const HexColor colorWheat = HexColor.colorWheat; + public Vec2 point; - public const HexColor colorWhite = HexColor.colorWhite; + public Vec2 normal; - public const HexColor colorWhiteSmoke = HexColor.colorWhiteSmoke; + public float approachSpeed; + } - public const HexColor colorYellow = HexColor.colorYellow; + public partial struct ContactEvents + { + public ContactBeginTouchEvent* beginEvents; - public const HexColor colorYellowGreen = HexColor.colorYellowGreen; + public ContactEndTouchEvent* endEvents; - public const HexColor colorBox2DRed = HexColor.colorBox2DRed; + public ContactHitEvent* hitEvents; - public const HexColor colorBox2DBlue = HexColor.colorBox2DBlue; + public int beginCount; - public const HexColor colorBox2DGreen = HexColor.colorBox2DGreen; + public int endCount; - public const HexColor colorBox2DYellow = HexColor.colorBox2DYellow; + public int hitCount; + } - public const JointType distanceJoint = JointType.distanceJoint; + public partial struct BodyMoveEvent + { + public Transform transform; - public const JointType motorJoint = JointType.motorJoint; + public BodyId bodyId; - public const JointType mouseJoint = JointType.mouseJoint; + public void* userData; - public const JointType prismaticJoint = JointType.prismaticJoint; + public bool fellAsleep; + } - public const JointType revoluteJoint = JointType.revoluteJoint; + public partial struct BodyEvents + { + public BodyMoveEvent* moveEvents; - public const JointType weldJoint = JointType.weldJoint; + public int moveCount; + } - public const JointType wheelJoint = JointType.wheelJoint; + public partial struct ContactData + { + public ShapeId shapeIdA; - public const ShapeType circleShape = ShapeType.circleShape; + public ShapeId shapeIdB; - public const ShapeType capsuleShape = ShapeType.capsuleShape; + public Manifold manifold; + } - public const ShapeType segmentShape = ShapeType.segmentShape; + public partial struct DebugDraw + { + public delegate* unmanaged DrawPolygonFcn; - public const ShapeType polygonShape = ShapeType.polygonShape; + public delegate* unmanaged DrawSolidPolygonFcn; - public const ShapeType smoothSegmentShape = ShapeType.smoothSegmentShape; + public delegate* unmanaged DrawCircleFcn; - public const ShapeType shapeTypeCount = ShapeType.shapeTypeCount; + public delegate* unmanaged DrawSolidCircleFcn; - public const TOIState toiStateUnknown = TOIState.toiStateUnknown; + public delegate* unmanaged DrawSolidCapsuleFcn; - public const TOIState toiStateFailed = TOIState.toiStateFailed; + public delegate* unmanaged DrawSegmentFcn; - public const TOIState toiStateOverlapped = TOIState.toiStateOverlapped; + public delegate* unmanaged DrawTransformFcn; - public const TOIState toiStateHit = TOIState.toiStateHit; + public delegate* unmanaged DrawPointFcn; - public const TOIState toiStateSeparated = TOIState.toiStateSeparated; + public delegate* unmanaged DrawStringFcn; - public const int defaultCategoryBits = 1; + public AABB drawingBounds; - public const uint defaultMaskBits = 4294967295; + public bool useDrawingBounds; - public const int maxPolygonVertices = 8; + public bool drawShapes; - public const float pi = 3.1415927f; + public bool drawJoints; - public partial class BindgenInternal - { - public const string DllImportPath = "box2d"; + public bool drawJointExtras; - static BindgenInternal() - { - DllFilePaths = new System.Collections.Generic.List - { - "box2d", - "libbox2d", - "runtimes/linux-x64/native/libbox2d", - "runtimes/linux-arm64/native/libbox2d", - "runtimes/osx-x64/native/libbox2d", - "runtimes/osx-arm64/native/libbox2d", - "runtimes/win-x64/native/box2d", - "runtimes/win-arm64/native/box2d" - }; - } + public bool drawBounds; + + public bool drawMass; + + public bool drawBodyNames; + + public bool drawContacts; + + public bool drawGraphColors; + + public bool drawContactNormals; + + public bool drawContactImpulses; + + public bool drawContactFeatures; + + public bool drawFrictionImpulses; + + public bool drawIslands; + + public void* context; + } + + public partial struct InlineArrays + { + [InlineArray(8)] + public partial struct Vec2_8 + { + public Vec2 Item0; + } + } + + public partial struct InlineArrays + { + [InlineArray(3)] + public partial struct byte_3 + { + public byte Item0; + } + } + + public partial struct InlineArrays + { + [InlineArray(2)] + public partial struct ManifoldPoint_2 + { + public ManifoldPoint Item0; + } + } + + public partial struct InlineArrays + { + [InlineArray(12)] + public partial struct int_12 + { + public int Item0; + } + } + + public const int B2_DEFAULT_CATEGORY_BITS = 1; + + public const ulong B2_DEFAULT_MASK_BITS = 18446744073709551615; + + public const int B2_HASH_INIT = 5381; + + public const int B2_MAX_POLYGON_VERTICES = 8; + + public const float B2_PI = 3.1415927f; + + public partial struct Version : IEquatable + { + public bool Equals(Version other) + { + fixed (Version* __self = &this) + { + return new Span(__self, sizeof(Version)).SequenceEqual(new Span(&other, sizeof(Version))); + } + } + + public override bool Equals(object? obj) + { + return obj is Version other && Equals(other); + } + + public static bool operator ==(Version left, Version right) + { + return left.Equals(right); + } + + public static bool operator !=(Version left, Version right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Version* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Version))); + return hash.ToHashCode(); + } + } + } + + public partial struct Vec2 : IEquatable + { + public bool Equals(Vec2 other) + { + fixed (Vec2* __self = &this) + { + return new Span(__self, sizeof(Vec2)).SequenceEqual(new Span(&other, sizeof(Vec2))); + } + } + + public override bool Equals(object? obj) + { + return obj is Vec2 other && Equals(other); + } + + public static bool operator ==(Vec2 left, Vec2 right) + { + return left.Equals(right); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "SYSLIB1054")] - public partial class BindgenInternal - { - public static readonly System.Collections.Generic.List DllFilePaths; + public static bool operator !=(Vec2 left, Vec2 right) + { + return !(left == right); + } - public static System.IntPtr LibraryHandle = System.IntPtr.Zero; + public override int GetHashCode() + { + fixed (Vec2* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Vec2))); + return hash.ToHashCode(); + } + } + } - public static readonly object Lock = new object (); + public partial struct CosSin : IEquatable + { + public bool Equals(CosSin other) + { + fixed (CosSin* __self = &this) + { + return new Span(__self, sizeof(CosSin)).SequenceEqual(new Span(&other, sizeof(CosSin))); + } + } - public static bool IsLinux => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); + public override bool Equals(object? obj) + { + return obj is CosSin other && Equals(other); + } - public static bool IsOsx => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX); + public static bool operator ==(CosSin left, CosSin right) + { + return left.Equals(right); + } - public static bool IsWindows => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows); + public static bool operator !=(CosSin left, CosSin right) + { + return !(left == right); + } - [System.Runtime.InteropServices.DllImport("libc", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlopen")] - public static extern System.IntPtr LoadLibraryLinux(string? path, int flags); + public override int GetHashCode() + { + fixed (CosSin* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(CosSin))); + return hash.ToHashCode(); + } + } + } - [System.Runtime.InteropServices.DllImport("libdl", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlopen")] - public static extern System.IntPtr LoadLibraryOsx(string? path, int flags); + public partial struct Rot : IEquatable + { + public bool Equals(Rot other) + { + fixed (Rot* __self = &this) + { + return new Span(__self, sizeof(Rot)).SequenceEqual(new Span(&other, sizeof(Rot))); + } + } - [System.Runtime.InteropServices.DllImport("kernel32", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "LoadLibrary")] - public static extern System.IntPtr LoadLibraryWindows(string path); + public override bool Equals(object? obj) + { + return obj is Rot other && Equals(other); + } - [System.Runtime.InteropServices.DllImport("kernel32", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "GetModuleHandle")] - public static extern System.IntPtr GetModuleHandle(string? name); + public static bool operator ==(Rot left, Rot right) + { + return left.Equals(right); + } - [System.Runtime.InteropServices.DllImport("libc", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlsym")] - public static extern System.IntPtr GetExportLinux(System.IntPtr handle, string name); + public static bool operator !=(Rot left, Rot right) + { + return !(left == right); + } - [System.Runtime.InteropServices.DllImport("libdl", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlsym")] - public static extern System.IntPtr GetExportOsx(System.IntPtr handle, string name); + public override int GetHashCode() + { + fixed (Rot* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Rot))); + return hash.ToHashCode(); + } + } + } - [System.Runtime.InteropServices.DllImport("kernel32", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "GetProcAddress")] - public static extern System.IntPtr GetExportWindows(System.IntPtr handle, string name); + public partial struct Transform : IEquatable + { + public bool Equals(Transform other) + { + fixed (Transform* __self = &this) + { + return new Span(__self, sizeof(Transform)).SequenceEqual(new Span(&other, sizeof(Transform))); + } + } - [System.Runtime.InteropServices.DllImport("libc", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlerror")] - public static extern byte* GetLastErrorLinux(); + public override bool Equals(object? obj) + { + return obj is Transform other && Equals(other); + } - [System.Runtime.InteropServices.DllImport("libdl", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "dlerror")] - public static extern byte* GetLastErrorOsx(); + public static bool operator ==(Transform left, Transform right) + { + return left.Equals(right); + } - [System.Runtime.InteropServices.DllImport("kernel32", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, CharSet = System.Runtime.InteropServices.CharSet.Ansi, EntryPoint = "GetLastError")] - public static extern int GetLastErrorWindows(); + public static bool operator !=(Transform left, Transform right) + { + return !(left == right); + } - public static bool TryLoad(string path, out System.IntPtr handle) - { -#if NETCOREAPP3_0_OR_GREATER - return System.Runtime.InteropServices.NativeLibrary.TryLoad(path, System.Reflection.Assembly.GetExecutingAssembly(), null, out handle); -#else - handle = System.IntPtr.Zero; - if (IsLinux) - handle = LoadLibraryLinux(path, 0x101); - else if (IsOsx) - handle = LoadLibraryOsx(path, 0x101); - else if (IsWindows) - handle = LoadLibraryWindows(path); - return handle != System.IntPtr.Zero; -#endif - } + public override int GetHashCode() + { + fixed (Transform* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Transform))); + return hash.ToHashCode(); + } + } + } - public static System.IntPtr GetExport(string symbol) - { -#if NETCOREAPP3_0_OR_GREATER - return System.Runtime.InteropServices.NativeLibrary.GetExport(LibraryHandle, symbol); -#else - if (IsLinux) - { - GetLastErrorLinux(); - System.IntPtr handle = GetExportLinux(LibraryHandle, symbol); - if (handle != System.IntPtr.Zero) - return handle; - byte* errorResult = GetLastErrorLinux(); - if (errorResult == null) - return handle; - string errorMessage = System.Runtime.InteropServices.Marshal.PtrToStringAnsi((System.IntPtr)errorResult)!; - throw new System.EntryPointNotFoundException(errorMessage); - } - - if (IsOsx) - { - GetLastErrorOsx(); - System.IntPtr handle = GetExportOsx(LibraryHandle, symbol); - if (handle != System.IntPtr.Zero) - return handle; - byte* errorResult = GetLastErrorOsx(); - if (errorResult == null) - return handle; - string errorMessage = System.Runtime.InteropServices.Marshal.PtrToStringAnsi((System.IntPtr)errorResult)!; - throw new System.EntryPointNotFoundException(errorMessage); - } - - if (IsWindows) - { - System.IntPtr handle = GetExportWindows(LibraryHandle, symbol); - if (handle != System.IntPtr.Zero) - return handle; - int errorCode = GetLastErrorWindows(); - string errorMessage = new System.ComponentModel.Win32Exception(errorCode).Message; - throw new System.EntryPointNotFoundException($"{errorMessage} \"{symbol}\" not found."); - } - - throw new System.InvalidOperationException($"Failed to export symbol \"{symbol}\" from dll. Platform is not linux, mac, or windows."); -#endif - } + public partial struct Mat22 : IEquatable + { + public bool Equals(Mat22 other) + { + fixed (Mat22* __self = &this) + { + return new Span(__self, sizeof(Mat22)).SequenceEqual(new Span(&other, sizeof(Mat22))); + } + } - public static void ResolveLibrary() - { - System.IntPtr handle = default; -#if NETCOREAPP3_0_OR_GREATER - foreach (string dllFilePath in DllFilePaths) - { - if (TryLoad(dllFilePath, out handle)) - goto Return; - } -#else - string fileExtension; - if (IsLinux) - fileExtension = ".so"; - else if (IsOsx) - fileExtension = ".dylib"; - else if (IsWindows) - fileExtension = ".dll"; - else - throw new System.InvalidOperationException("Can't determine native library file extension for the current system."); - foreach (string dllFilePath in DllFilePaths) - { - string fileName = System.IO.Path.GetFileName(dllFilePath); - string parentDir = $"{dllFilePath}/.."; - string exeDir = System.IO.Path.GetFullPath(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)!); - string searchDir = System.IO.Path.IsPathRooted(dllFilePath) ? System.IO.Path.GetFullPath(parentDir) + "/" : System.IO.Path.GetFullPath($"{exeDir}/{parentDir}") + "/"; - if (TryLoad($"{searchDir}{fileName}", out handle)) - goto Return; - if (TryLoad($"{searchDir}{fileName}{fileExtension}", out handle)) - goto Return; - if (TryLoad($"{searchDir}lib{fileName}", out handle)) - goto Return; - if (TryLoad($"{searchDir}lib{fileName}{fileExtension}", out handle)) - goto Return; - if (!fileName.StartsWith("lib") || fileName == "lib") - continue; - string unprefixed = fileName.Substring(4); - if (TryLoad($"{searchDir}{unprefixed}", out handle)) - goto Return; - if (TryLoad($"{searchDir}{unprefixed}{fileExtension}", out handle)) - goto Return; - } - -#endif -#if NET7_0_OR_GREATER - handle = System.Runtime.InteropServices.NativeLibrary.GetMainProgramHandle(); -#else - if (IsLinux) - handle = LoadLibraryLinux(null, 0x101); - else if (IsOsx) - handle = LoadLibraryOsx(null, 0x101); - else if (IsWindows) - handle = GetModuleHandle(null); -#endif - Return: - LibraryHandle = handle; - } + public override bool Equals(object? obj) + { + return obj is Mat22 other && Equals(other); + } - public static void* LoadDllSymbol(string variableSymbol, out void* field) - { - lock (Lock) - { - if (LibraryHandle == System.IntPtr.Zero) - ResolveLibrary(); - return field = (void*)GetExport(variableSymbol); - } - } + public static bool operator ==(Mat22 left, Mat22 right) + { + return left.Equals(right); + } + + public static bool operator !=(Mat22 left, Mat22 right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Mat22* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Mat22))); + return hash.ToHashCode(); + } + } + } + + public partial struct AABB : IEquatable + { + public bool Equals(AABB other) + { + fixed (AABB* __self = &this) + { + return new Span(__self, sizeof(AABB)).SequenceEqual(new Span(&other, sizeof(AABB))); + } + } + + public override bool Equals(object? obj) + { + return obj is AABB other && Equals(other); + } + + public static bool operator ==(AABB left, AABB right) + { + return left.Equals(right); + } + + public static bool operator !=(AABB left, AABB right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (AABB* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(AABB))); + return hash.ToHashCode(); + } + } + } + + public partial struct Plane : IEquatable + { + public bool Equals(Plane other) + { + fixed (Plane* __self = &this) + { + return new Span(__self, sizeof(Plane)).SequenceEqual(new Span(&other, sizeof(Plane))); + } + } + + public override bool Equals(object? obj) + { + return obj is Plane other && Equals(other); + } + + public static bool operator ==(Plane left, Plane right) + { + return left.Equals(right); + } + + public static bool operator !=(Plane left, Plane right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Plane* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Plane))); + return hash.ToHashCode(); + } + } + } + + public partial struct SimplexCache : IEquatable + { + public bool Equals(SimplexCache other) + { + fixed (SimplexCache* __self = &this) + { + return new Span(__self, sizeof(SimplexCache)).SequenceEqual(new Span(&other, sizeof(SimplexCache))); + } + } + + public override bool Equals(object? obj) + { + return obj is SimplexCache other && Equals(other); + } + + public static bool operator ==(SimplexCache left, SimplexCache right) + { + return left.Equals(right); + } + + public static bool operator !=(SimplexCache left, SimplexCache right) + { + return !(left == right); } + + public override int GetHashCode() + { + fixed (SimplexCache* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SimplexCache))); + return hash.ToHashCode(); + } + } } -} -#pragma warning restore CS9084 -#nullable disable + + public partial struct Hull : IEquatable + { + public bool Equals(Hull other) + { + fixed (Hull* __self = &this) + { + return new Span(__self, sizeof(Hull)).SequenceEqual(new Span(&other, sizeof(Hull))); + } + } + + public override bool Equals(object? obj) + { + return obj is Hull other && Equals(other); + } + + public static bool operator ==(Hull left, Hull right) + { + return left.Equals(right); + } + + public static bool operator !=(Hull left, Hull right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Hull* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Hull))); + return hash.ToHashCode(); + } + } + } + + public partial struct RayCastInput : IEquatable + { + public bool Equals(RayCastInput other) + { + fixed (RayCastInput* __self = &this) + { + return new Span(__self, sizeof(RayCastInput)).SequenceEqual(new Span(&other, sizeof(RayCastInput))); + } + } + + public override bool Equals(object? obj) + { + return obj is RayCastInput other && Equals(other); + } + + public static bool operator ==(RayCastInput left, RayCastInput right) + { + return left.Equals(right); + } + + public static bool operator !=(RayCastInput left, RayCastInput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (RayCastInput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(RayCastInput))); + return hash.ToHashCode(); + } + } + } + + public partial struct ShapeProxy : IEquatable + { + public bool Equals(ShapeProxy other) + { + fixed (ShapeProxy* __self = &this) + { + return new Span(__self, sizeof(ShapeProxy)).SequenceEqual(new Span(&other, sizeof(ShapeProxy))); + } + } + + public override bool Equals(object? obj) + { + return obj is ShapeProxy other && Equals(other); + } + + public static bool operator ==(ShapeProxy left, ShapeProxy right) + { + return left.Equals(right); + } + + public static bool operator !=(ShapeProxy left, ShapeProxy right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ShapeProxy* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ShapeProxy))); + return hash.ToHashCode(); + } + } + } + + public partial struct ShapeCastInput : IEquatable + { + public bool Equals(ShapeCastInput other) + { + fixed (ShapeCastInput* __self = &this) + { + return new Span(__self, sizeof(ShapeCastInput)).SequenceEqual(new Span(&other, sizeof(ShapeCastInput))); + } + } + + public override bool Equals(object? obj) + { + return obj is ShapeCastInput other && Equals(other); + } + + public static bool operator ==(ShapeCastInput left, ShapeCastInput right) + { + return left.Equals(right); + } + + public static bool operator !=(ShapeCastInput left, ShapeCastInput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ShapeCastInput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ShapeCastInput))); + return hash.ToHashCode(); + } + } + } + + public partial struct CastOutput : IEquatable + { + public bool Equals(CastOutput other) + { + fixed (CastOutput* __self = &this) + { + return new Span(__self, sizeof(CastOutput)).SequenceEqual(new Span(&other, sizeof(CastOutput))); + } + } + + public override bool Equals(object? obj) + { + return obj is CastOutput other && Equals(other); + } + + public static bool operator ==(CastOutput left, CastOutput right) + { + return left.Equals(right); + } + + public static bool operator !=(CastOutput left, CastOutput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (CastOutput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(CastOutput))); + return hash.ToHashCode(); + } + } + } + + public partial struct MassData : IEquatable + { + public bool Equals(MassData other) + { + fixed (MassData* __self = &this) + { + return new Span(__self, sizeof(MassData)).SequenceEqual(new Span(&other, sizeof(MassData))); + } + } + + public override bool Equals(object? obj) + { + return obj is MassData other && Equals(other); + } + + public static bool operator ==(MassData left, MassData right) + { + return left.Equals(right); + } + + public static bool operator !=(MassData left, MassData right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (MassData* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(MassData))); + return hash.ToHashCode(); + } + } + } + + public partial struct Circle : IEquatable + { + public bool Equals(Circle other) + { + fixed (Circle* __self = &this) + { + return new Span(__self, sizeof(Circle)).SequenceEqual(new Span(&other, sizeof(Circle))); + } + } + + public override bool Equals(object? obj) + { + return obj is Circle other && Equals(other); + } + + public static bool operator ==(Circle left, Circle right) + { + return left.Equals(right); + } + + public static bool operator !=(Circle left, Circle right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Circle* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Circle))); + return hash.ToHashCode(); + } + } + } + + public partial struct Capsule : IEquatable + { + public bool Equals(Capsule other) + { + fixed (Capsule* __self = &this) + { + return new Span(__self, sizeof(Capsule)).SequenceEqual(new Span(&other, sizeof(Capsule))); + } + } + + public override bool Equals(object? obj) + { + return obj is Capsule other && Equals(other); + } + + public static bool operator ==(Capsule left, Capsule right) + { + return left.Equals(right); + } + + public static bool operator !=(Capsule left, Capsule right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Capsule* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Capsule))); + return hash.ToHashCode(); + } + } + } + + public partial struct Polygon : IEquatable + { + public bool Equals(Polygon other) + { + fixed (Polygon* __self = &this) + { + return new Span(__self, sizeof(Polygon)).SequenceEqual(new Span(&other, sizeof(Polygon))); + } + } + + public override bool Equals(object? obj) + { + return obj is Polygon other && Equals(other); + } + + public static bool operator ==(Polygon left, Polygon right) + { + return left.Equals(right); + } + + public static bool operator !=(Polygon left, Polygon right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Polygon* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Polygon))); + return hash.ToHashCode(); + } + } + } + + public partial struct Segment : IEquatable + { + public bool Equals(Segment other) + { + fixed (Segment* __self = &this) + { + return new Span(__self, sizeof(Segment)).SequenceEqual(new Span(&other, sizeof(Segment))); + } + } + + public override bool Equals(object? obj) + { + return obj is Segment other && Equals(other); + } + + public static bool operator ==(Segment left, Segment right) + { + return left.Equals(right); + } + + public static bool operator !=(Segment left, Segment right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Segment* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Segment))); + return hash.ToHashCode(); + } + } + } + + public partial struct ChainSegment : IEquatable + { + public bool Equals(ChainSegment other) + { + fixed (ChainSegment* __self = &this) + { + return new Span(__self, sizeof(ChainSegment)).SequenceEqual(new Span(&other, sizeof(ChainSegment))); + } + } + + public override bool Equals(object? obj) + { + return obj is ChainSegment other && Equals(other); + } + + public static bool operator ==(ChainSegment left, ChainSegment right) + { + return left.Equals(right); + } + + public static bool operator !=(ChainSegment left, ChainSegment right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ChainSegment* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ChainSegment))); + return hash.ToHashCode(); + } + } + } + + public partial struct SegmentDistanceResult : IEquatable + { + public bool Equals(SegmentDistanceResult other) + { + fixed (SegmentDistanceResult* __self = &this) + { + return new Span(__self, sizeof(SegmentDistanceResult)).SequenceEqual(new Span(&other, sizeof(SegmentDistanceResult))); + } + } + + public override bool Equals(object? obj) + { + return obj is SegmentDistanceResult other && Equals(other); + } + + public static bool operator ==(SegmentDistanceResult left, SegmentDistanceResult right) + { + return left.Equals(right); + } + + public static bool operator !=(SegmentDistanceResult left, SegmentDistanceResult right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SegmentDistanceResult* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SegmentDistanceResult))); + return hash.ToHashCode(); + } + } + } + + public partial struct DistanceInput : IEquatable + { + public bool Equals(DistanceInput other) + { + fixed (DistanceInput* __self = &this) + { + return new Span(__self, sizeof(DistanceInput)).SequenceEqual(new Span(&other, sizeof(DistanceInput))); + } + } + + public override bool Equals(object? obj) + { + return obj is DistanceInput other && Equals(other); + } + + public static bool operator ==(DistanceInput left, DistanceInput right) + { + return left.Equals(right); + } + + public static bool operator !=(DistanceInput left, DistanceInput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (DistanceInput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(DistanceInput))); + return hash.ToHashCode(); + } + } + } + + public partial struct DistanceOutput : IEquatable + { + public bool Equals(DistanceOutput other) + { + fixed (DistanceOutput* __self = &this) + { + return new Span(__self, sizeof(DistanceOutput)).SequenceEqual(new Span(&other, sizeof(DistanceOutput))); + } + } + + public override bool Equals(object? obj) + { + return obj is DistanceOutput other && Equals(other); + } + + public static bool operator ==(DistanceOutput left, DistanceOutput right) + { + return left.Equals(right); + } + + public static bool operator !=(DistanceOutput left, DistanceOutput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (DistanceOutput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(DistanceOutput))); + return hash.ToHashCode(); + } + } + } + + public partial struct SimplexVertex : IEquatable + { + public bool Equals(SimplexVertex other) + { + fixed (SimplexVertex* __self = &this) + { + return new Span(__self, sizeof(SimplexVertex)).SequenceEqual(new Span(&other, sizeof(SimplexVertex))); + } + } + + public override bool Equals(object? obj) + { + return obj is SimplexVertex other && Equals(other); + } + + public static bool operator ==(SimplexVertex left, SimplexVertex right) + { + return left.Equals(right); + } + + public static bool operator !=(SimplexVertex left, SimplexVertex right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SimplexVertex* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SimplexVertex))); + return hash.ToHashCode(); + } + } + } + + public partial struct Simplex : IEquatable + { + public bool Equals(Simplex other) + { + fixed (Simplex* __self = &this) + { + return new Span(__self, sizeof(Simplex)).SequenceEqual(new Span(&other, sizeof(Simplex))); + } + } + + public override bool Equals(object? obj) + { + return obj is Simplex other && Equals(other); + } + + public static bool operator ==(Simplex left, Simplex right) + { + return left.Equals(right); + } + + public static bool operator !=(Simplex left, Simplex right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Simplex* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Simplex))); + return hash.ToHashCode(); + } + } + } + + public partial struct ShapeCastPairInput : IEquatable + { + public bool Equals(ShapeCastPairInput other) + { + fixed (ShapeCastPairInput* __self = &this) + { + return new Span(__self, sizeof(ShapeCastPairInput)).SequenceEqual(new Span(&other, sizeof(ShapeCastPairInput))); + } + } + + public override bool Equals(object? obj) + { + return obj is ShapeCastPairInput other && Equals(other); + } + + public static bool operator ==(ShapeCastPairInput left, ShapeCastPairInput right) + { + return left.Equals(right); + } + + public static bool operator !=(ShapeCastPairInput left, ShapeCastPairInput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ShapeCastPairInput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ShapeCastPairInput))); + return hash.ToHashCode(); + } + } + } + + public partial struct Sweep : IEquatable + { + public bool Equals(Sweep other) + { + fixed (Sweep* __self = &this) + { + return new Span(__self, sizeof(Sweep)).SequenceEqual(new Span(&other, sizeof(Sweep))); + } + } + + public override bool Equals(object? obj) + { + return obj is Sweep other && Equals(other); + } + + public static bool operator ==(Sweep left, Sweep right) + { + return left.Equals(right); + } + + public static bool operator !=(Sweep left, Sweep right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Sweep* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Sweep))); + return hash.ToHashCode(); + } + } + } + + public partial struct TOIInput : IEquatable + { + public bool Equals(TOIInput other) + { + fixed (TOIInput* __self = &this) + { + return new Span(__self, sizeof(TOIInput)).SequenceEqual(new Span(&other, sizeof(TOIInput))); + } + } + + public override bool Equals(object? obj) + { + return obj is TOIInput other && Equals(other); + } + + public static bool operator ==(TOIInput left, TOIInput right) + { + return left.Equals(right); + } + + public static bool operator !=(TOIInput left, TOIInput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (TOIInput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(TOIInput))); + return hash.ToHashCode(); + } + } + } + + public partial struct TOIOutput : IEquatable + { + public bool Equals(TOIOutput other) + { + fixed (TOIOutput* __self = &this) + { + return new Span(__self, sizeof(TOIOutput)).SequenceEqual(new Span(&other, sizeof(TOIOutput))); + } + } + + public override bool Equals(object? obj) + { + return obj is TOIOutput other && Equals(other); + } + + public static bool operator ==(TOIOutput left, TOIOutput right) + { + return left.Equals(right); + } + + public static bool operator !=(TOIOutput left, TOIOutput right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (TOIOutput* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(TOIOutput))); + return hash.ToHashCode(); + } + } + } + + public partial struct ManifoldPoint : IEquatable + { + public bool Equals(ManifoldPoint other) + { + fixed (ManifoldPoint* __self = &this) + { + return new Span(__self, sizeof(ManifoldPoint)).SequenceEqual(new Span(&other, sizeof(ManifoldPoint))); + } + } + + public override bool Equals(object? obj) + { + return obj is ManifoldPoint other && Equals(other); + } + + public static bool operator ==(ManifoldPoint left, ManifoldPoint right) + { + return left.Equals(right); + } + + public static bool operator !=(ManifoldPoint left, ManifoldPoint right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ManifoldPoint* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ManifoldPoint))); + return hash.ToHashCode(); + } + } + } + + public partial struct Manifold : IEquatable + { + public bool Equals(Manifold other) + { + fixed (Manifold* __self = &this) + { + return new Span(__self, sizeof(Manifold)).SequenceEqual(new Span(&other, sizeof(Manifold))); + } + } + + public override bool Equals(object? obj) + { + return obj is Manifold other && Equals(other); + } + + public static bool operator ==(Manifold left, Manifold right) + { + return left.Equals(right); + } + + public static bool operator !=(Manifold left, Manifold right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Manifold* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Manifold))); + return hash.ToHashCode(); + } + } + } + + public partial struct DynamicTree : IEquatable + { + public bool Equals(DynamicTree other) + { + fixed (DynamicTree* __self = &this) + { + return new Span(__self, sizeof(DynamicTree)).SequenceEqual(new Span(&other, sizeof(DynamicTree))); + } + } + + public override bool Equals(object? obj) + { + return obj is DynamicTree other && Equals(other); + } + + public static bool operator ==(DynamicTree left, DynamicTree right) + { + return left.Equals(right); + } + + public static bool operator !=(DynamicTree left, DynamicTree right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (DynamicTree* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(DynamicTree))); + return hash.ToHashCode(); + } + } + } + + public partial struct TreeNode : IEquatable + { + public bool Equals(TreeNode other) + { + fixed (TreeNode* __self = &this) + { + return new Span(__self, sizeof(TreeNode)).SequenceEqual(new Span(&other, sizeof(TreeNode))); + } + } + + public override bool Equals(object? obj) + { + return obj is TreeNode other && Equals(other); + } + + public static bool operator ==(TreeNode left, TreeNode right) + { + return left.Equals(right); + } + + public static bool operator !=(TreeNode left, TreeNode right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (TreeNode* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(TreeNode))); + return hash.ToHashCode(); + } + } + } + + public partial struct TreeStats : IEquatable + { + public bool Equals(TreeStats other) + { + fixed (TreeStats* __self = &this) + { + return new Span(__self, sizeof(TreeStats)).SequenceEqual(new Span(&other, sizeof(TreeStats))); + } + } + + public override bool Equals(object? obj) + { + return obj is TreeStats other && Equals(other); + } + + public static bool operator ==(TreeStats left, TreeStats right) + { + return left.Equals(right); + } + + public static bool operator !=(TreeStats left, TreeStats right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (TreeStats* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(TreeStats))); + return hash.ToHashCode(); + } + } + } + + public partial struct PlaneResult : IEquatable + { + public bool Equals(PlaneResult other) + { + fixed (PlaneResult* __self = &this) + { + return new Span(__self, sizeof(PlaneResult)).SequenceEqual(new Span(&other, sizeof(PlaneResult))); + } + } + + public override bool Equals(object? obj) + { + return obj is PlaneResult other && Equals(other); + } + + public static bool operator ==(PlaneResult left, PlaneResult right) + { + return left.Equals(right); + } + + public static bool operator !=(PlaneResult left, PlaneResult right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (PlaneResult* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(PlaneResult))); + return hash.ToHashCode(); + } + } + } + + public partial struct CollisionPlane : IEquatable + { + public bool Equals(CollisionPlane other) + { + fixed (CollisionPlane* __self = &this) + { + return new Span(__self, sizeof(CollisionPlane)).SequenceEqual(new Span(&other, sizeof(CollisionPlane))); + } + } + + public override bool Equals(object? obj) + { + return obj is CollisionPlane other && Equals(other); + } + + public static bool operator ==(CollisionPlane left, CollisionPlane right) + { + return left.Equals(right); + } + + public static bool operator !=(CollisionPlane left, CollisionPlane right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (CollisionPlane* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(CollisionPlane))); + return hash.ToHashCode(); + } + } + } + + public partial struct PlaneSolverResult : IEquatable + { + public bool Equals(PlaneSolverResult other) + { + fixed (PlaneSolverResult* __self = &this) + { + return new Span(__self, sizeof(PlaneSolverResult)).SequenceEqual(new Span(&other, sizeof(PlaneSolverResult))); + } + } + + public override bool Equals(object? obj) + { + return obj is PlaneSolverResult other && Equals(other); + } + + public static bool operator ==(PlaneSolverResult left, PlaneSolverResult right) + { + return left.Equals(right); + } + + public static bool operator !=(PlaneSolverResult left, PlaneSolverResult right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (PlaneSolverResult* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(PlaneSolverResult))); + return hash.ToHashCode(); + } + } + } + + public partial struct WorldId : IEquatable + { + public bool Equals(WorldId other) + { + fixed (WorldId* __self = &this) + { + return new Span(__self, sizeof(WorldId)).SequenceEqual(new Span(&other, sizeof(WorldId))); + } + } + + public override bool Equals(object? obj) + { + return obj is WorldId other && Equals(other); + } + + public static bool operator ==(WorldId left, WorldId right) + { + return left.Equals(right); + } + + public static bool operator !=(WorldId left, WorldId right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (WorldId* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(WorldId))); + return hash.ToHashCode(); + } + } + } + + public partial struct BodyId : IEquatable + { + public bool Equals(BodyId other) + { + fixed (BodyId* __self = &this) + { + return new Span(__self, sizeof(BodyId)).SequenceEqual(new Span(&other, sizeof(BodyId))); + } + } + + public override bool Equals(object? obj) + { + return obj is BodyId other && Equals(other); + } + + public static bool operator ==(BodyId left, BodyId right) + { + return left.Equals(right); + } + + public static bool operator !=(BodyId left, BodyId right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (BodyId* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(BodyId))); + return hash.ToHashCode(); + } + } + } + + public partial struct ShapeId : IEquatable + { + public bool Equals(ShapeId other) + { + fixed (ShapeId* __self = &this) + { + return new Span(__self, sizeof(ShapeId)).SequenceEqual(new Span(&other, sizeof(ShapeId))); + } + } + + public override bool Equals(object? obj) + { + return obj is ShapeId other && Equals(other); + } + + public static bool operator ==(ShapeId left, ShapeId right) + { + return left.Equals(right); + } + + public static bool operator !=(ShapeId left, ShapeId right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ShapeId* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ShapeId))); + return hash.ToHashCode(); + } + } + } + + public partial struct ChainId : IEquatable + { + public bool Equals(ChainId other) + { + fixed (ChainId* __self = &this) + { + return new Span(__self, sizeof(ChainId)).SequenceEqual(new Span(&other, sizeof(ChainId))); + } + } + + public override bool Equals(object? obj) + { + return obj is ChainId other && Equals(other); + } + + public static bool operator ==(ChainId left, ChainId right) + { + return left.Equals(right); + } + + public static bool operator !=(ChainId left, ChainId right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ChainId* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ChainId))); + return hash.ToHashCode(); + } + } + } + + public partial struct JointId : IEquatable + { + public bool Equals(JointId other) + { + fixed (JointId* __self = &this) + { + return new Span(__self, sizeof(JointId)).SequenceEqual(new Span(&other, sizeof(JointId))); + } + } + + public override bool Equals(object? obj) + { + return obj is JointId other && Equals(other); + } + + public static bool operator ==(JointId left, JointId right) + { + return left.Equals(right); + } + + public static bool operator !=(JointId left, JointId right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (JointId* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(JointId))); + return hash.ToHashCode(); + } + } + } + + public partial struct RayResult : IEquatable + { + public bool Equals(RayResult other) + { + fixed (RayResult* __self = &this) + { + return new Span(__self, sizeof(RayResult)).SequenceEqual(new Span(&other, sizeof(RayResult))); + } + } + + public override bool Equals(object? obj) + { + return obj is RayResult other && Equals(other); + } + + public static bool operator ==(RayResult left, RayResult right) + { + return left.Equals(right); + } + + public static bool operator !=(RayResult left, RayResult right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (RayResult* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(RayResult))); + return hash.ToHashCode(); + } + } + } + + public partial struct WorldDef : IEquatable + { + public bool Equals(WorldDef other) + { + fixed (WorldDef* __self = &this) + { + return new Span(__self, sizeof(WorldDef)).SequenceEqual(new Span(&other, sizeof(WorldDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is WorldDef other && Equals(other); + } + + public static bool operator ==(WorldDef left, WorldDef right) + { + return left.Equals(right); + } + + public static bool operator !=(WorldDef left, WorldDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (WorldDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(WorldDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct BodyDef : IEquatable + { + public bool Equals(BodyDef other) + { + fixed (BodyDef* __self = &this) + { + return new Span(__self, sizeof(BodyDef)).SequenceEqual(new Span(&other, sizeof(BodyDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is BodyDef other && Equals(other); + } + + public static bool operator ==(BodyDef left, BodyDef right) + { + return left.Equals(right); + } + + public static bool operator !=(BodyDef left, BodyDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (BodyDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(BodyDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct Filter : IEquatable + { + public bool Equals(Filter other) + { + fixed (Filter* __self = &this) + { + return new Span(__self, sizeof(Filter)).SequenceEqual(new Span(&other, sizeof(Filter))); + } + } + + public override bool Equals(object? obj) + { + return obj is Filter other && Equals(other); + } + + public static bool operator ==(Filter left, Filter right) + { + return left.Equals(right); + } + + public static bool operator !=(Filter left, Filter right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Filter* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Filter))); + return hash.ToHashCode(); + } + } + } + + public partial struct QueryFilter : IEquatable + { + public bool Equals(QueryFilter other) + { + fixed (QueryFilter* __self = &this) + { + return new Span(__self, sizeof(QueryFilter)).SequenceEqual(new Span(&other, sizeof(QueryFilter))); + } + } + + public override bool Equals(object? obj) + { + return obj is QueryFilter other && Equals(other); + } + + public static bool operator ==(QueryFilter left, QueryFilter right) + { + return left.Equals(right); + } + + public static bool operator !=(QueryFilter left, QueryFilter right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (QueryFilter* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(QueryFilter))); + return hash.ToHashCode(); + } + } + } + + public partial struct SurfaceMaterial : IEquatable + { + public bool Equals(SurfaceMaterial other) + { + fixed (SurfaceMaterial* __self = &this) + { + return new Span(__self, sizeof(SurfaceMaterial)).SequenceEqual(new Span(&other, sizeof(SurfaceMaterial))); + } + } + + public override bool Equals(object? obj) + { + return obj is SurfaceMaterial other && Equals(other); + } + + public static bool operator ==(SurfaceMaterial left, SurfaceMaterial right) + { + return left.Equals(right); + } + + public static bool operator !=(SurfaceMaterial left, SurfaceMaterial right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SurfaceMaterial* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SurfaceMaterial))); + return hash.ToHashCode(); + } + } + } + + public partial struct ShapeDef : IEquatable + { + public bool Equals(ShapeDef other) + { + fixed (ShapeDef* __self = &this) + { + return new Span(__self, sizeof(ShapeDef)).SequenceEqual(new Span(&other, sizeof(ShapeDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is ShapeDef other && Equals(other); + } + + public static bool operator ==(ShapeDef left, ShapeDef right) + { + return left.Equals(right); + } + + public static bool operator !=(ShapeDef left, ShapeDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ShapeDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ShapeDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct ChainDef : IEquatable + { + public bool Equals(ChainDef other) + { + fixed (ChainDef* __self = &this) + { + return new Span(__self, sizeof(ChainDef)).SequenceEqual(new Span(&other, sizeof(ChainDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is ChainDef other && Equals(other); + } + + public static bool operator ==(ChainDef left, ChainDef right) + { + return left.Equals(right); + } + + public static bool operator !=(ChainDef left, ChainDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ChainDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ChainDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct Profile : IEquatable + { + public bool Equals(Profile other) + { + fixed (Profile* __self = &this) + { + return new Span(__self, sizeof(Profile)).SequenceEqual(new Span(&other, sizeof(Profile))); + } + } + + public override bool Equals(object? obj) + { + return obj is Profile other && Equals(other); + } + + public static bool operator ==(Profile left, Profile right) + { + return left.Equals(right); + } + + public static bool operator !=(Profile left, Profile right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Profile* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Profile))); + return hash.ToHashCode(); + } + } + } + + public partial struct Counters : IEquatable + { + public bool Equals(Counters other) + { + fixed (Counters* __self = &this) + { + return new Span(__self, sizeof(Counters)).SequenceEqual(new Span(&other, sizeof(Counters))); + } + } + + public override bool Equals(object? obj) + { + return obj is Counters other && Equals(other); + } + + public static bool operator ==(Counters left, Counters right) + { + return left.Equals(right); + } + + public static bool operator !=(Counters left, Counters right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Counters* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Counters))); + return hash.ToHashCode(); + } + } + } + + public partial struct DistanceJointDef : IEquatable + { + public bool Equals(DistanceJointDef other) + { + fixed (DistanceJointDef* __self = &this) + { + return new Span(__self, sizeof(DistanceJointDef)).SequenceEqual(new Span(&other, sizeof(DistanceJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is DistanceJointDef other && Equals(other); + } + + public static bool operator ==(DistanceJointDef left, DistanceJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(DistanceJointDef left, DistanceJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (DistanceJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(DistanceJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct MotorJointDef : IEquatable + { + public bool Equals(MotorJointDef other) + { + fixed (MotorJointDef* __self = &this) + { + return new Span(__self, sizeof(MotorJointDef)).SequenceEqual(new Span(&other, sizeof(MotorJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is MotorJointDef other && Equals(other); + } + + public static bool operator ==(MotorJointDef left, MotorJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(MotorJointDef left, MotorJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (MotorJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(MotorJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct MouseJointDef : IEquatable + { + public bool Equals(MouseJointDef other) + { + fixed (MouseJointDef* __self = &this) + { + return new Span(__self, sizeof(MouseJointDef)).SequenceEqual(new Span(&other, sizeof(MouseJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is MouseJointDef other && Equals(other); + } + + public static bool operator ==(MouseJointDef left, MouseJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(MouseJointDef left, MouseJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (MouseJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(MouseJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct FilterJointDef : IEquatable + { + public bool Equals(FilterJointDef other) + { + fixed (FilterJointDef* __self = &this) + { + return new Span(__self, sizeof(FilterJointDef)).SequenceEqual(new Span(&other, sizeof(FilterJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is FilterJointDef other && Equals(other); + } + + public static bool operator ==(FilterJointDef left, FilterJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(FilterJointDef left, FilterJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (FilterJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(FilterJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct PrismaticJointDef : IEquatable + { + public bool Equals(PrismaticJointDef other) + { + fixed (PrismaticJointDef* __self = &this) + { + return new Span(__self, sizeof(PrismaticJointDef)).SequenceEqual(new Span(&other, sizeof(PrismaticJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is PrismaticJointDef other && Equals(other); + } + + public static bool operator ==(PrismaticJointDef left, PrismaticJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(PrismaticJointDef left, PrismaticJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (PrismaticJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(PrismaticJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct RevoluteJointDef : IEquatable + { + public bool Equals(RevoluteJointDef other) + { + fixed (RevoluteJointDef* __self = &this) + { + return new Span(__self, sizeof(RevoluteJointDef)).SequenceEqual(new Span(&other, sizeof(RevoluteJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is RevoluteJointDef other && Equals(other); + } + + public static bool operator ==(RevoluteJointDef left, RevoluteJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(RevoluteJointDef left, RevoluteJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (RevoluteJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(RevoluteJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct WeldJointDef : IEquatable + { + public bool Equals(WeldJointDef other) + { + fixed (WeldJointDef* __self = &this) + { + return new Span(__self, sizeof(WeldJointDef)).SequenceEqual(new Span(&other, sizeof(WeldJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is WeldJointDef other && Equals(other); + } + + public static bool operator ==(WeldJointDef left, WeldJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(WeldJointDef left, WeldJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (WeldJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(WeldJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct WheelJointDef : IEquatable + { + public bool Equals(WheelJointDef other) + { + fixed (WheelJointDef* __self = &this) + { + return new Span(__self, sizeof(WheelJointDef)).SequenceEqual(new Span(&other, sizeof(WheelJointDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is WheelJointDef other && Equals(other); + } + + public static bool operator ==(WheelJointDef left, WheelJointDef right) + { + return left.Equals(right); + } + + public static bool operator !=(WheelJointDef left, WheelJointDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (WheelJointDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(WheelJointDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct ExplosionDef : IEquatable + { + public bool Equals(ExplosionDef other) + { + fixed (ExplosionDef* __self = &this) + { + return new Span(__self, sizeof(ExplosionDef)).SequenceEqual(new Span(&other, sizeof(ExplosionDef))); + } + } + + public override bool Equals(object? obj) + { + return obj is ExplosionDef other && Equals(other); + } + + public static bool operator ==(ExplosionDef left, ExplosionDef right) + { + return left.Equals(right); + } + + public static bool operator !=(ExplosionDef left, ExplosionDef right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ExplosionDef* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ExplosionDef))); + return hash.ToHashCode(); + } + } + } + + public partial struct SensorBeginTouchEvent : IEquatable + { + public bool Equals(SensorBeginTouchEvent other) + { + fixed (SensorBeginTouchEvent* __self = &this) + { + return new Span(__self, sizeof(SensorBeginTouchEvent)).SequenceEqual(new Span(&other, sizeof(SensorBeginTouchEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is SensorBeginTouchEvent other && Equals(other); + } + + public static bool operator ==(SensorBeginTouchEvent left, SensorBeginTouchEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(SensorBeginTouchEvent left, SensorBeginTouchEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SensorBeginTouchEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SensorBeginTouchEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct SensorEndTouchEvent : IEquatable + { + public bool Equals(SensorEndTouchEvent other) + { + fixed (SensorEndTouchEvent* __self = &this) + { + return new Span(__self, sizeof(SensorEndTouchEvent)).SequenceEqual(new Span(&other, sizeof(SensorEndTouchEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is SensorEndTouchEvent other && Equals(other); + } + + public static bool operator ==(SensorEndTouchEvent left, SensorEndTouchEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(SensorEndTouchEvent left, SensorEndTouchEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SensorEndTouchEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SensorEndTouchEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct SensorEvents : IEquatable + { + public bool Equals(SensorEvents other) + { + fixed (SensorEvents* __self = &this) + { + return new Span(__self, sizeof(SensorEvents)).SequenceEqual(new Span(&other, sizeof(SensorEvents))); + } + } + + public override bool Equals(object? obj) + { + return obj is SensorEvents other && Equals(other); + } + + public static bool operator ==(SensorEvents left, SensorEvents right) + { + return left.Equals(right); + } + + public static bool operator !=(SensorEvents left, SensorEvents right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (SensorEvents* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(SensorEvents))); + return hash.ToHashCode(); + } + } + } + + public partial struct ContactBeginTouchEvent : IEquatable + { + public bool Equals(ContactBeginTouchEvent other) + { + fixed (ContactBeginTouchEvent* __self = &this) + { + return new Span(__self, sizeof(ContactBeginTouchEvent)).SequenceEqual(new Span(&other, sizeof(ContactBeginTouchEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is ContactBeginTouchEvent other && Equals(other); + } + + public static bool operator ==(ContactBeginTouchEvent left, ContactBeginTouchEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(ContactBeginTouchEvent left, ContactBeginTouchEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ContactBeginTouchEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ContactBeginTouchEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct ContactEndTouchEvent : IEquatable + { + public bool Equals(ContactEndTouchEvent other) + { + fixed (ContactEndTouchEvent* __self = &this) + { + return new Span(__self, sizeof(ContactEndTouchEvent)).SequenceEqual(new Span(&other, sizeof(ContactEndTouchEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is ContactEndTouchEvent other && Equals(other); + } + + public static bool operator ==(ContactEndTouchEvent left, ContactEndTouchEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(ContactEndTouchEvent left, ContactEndTouchEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ContactEndTouchEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ContactEndTouchEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct ContactHitEvent : IEquatable + { + public bool Equals(ContactHitEvent other) + { + fixed (ContactHitEvent* __self = &this) + { + return new Span(__self, sizeof(ContactHitEvent)).SequenceEqual(new Span(&other, sizeof(ContactHitEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is ContactHitEvent other && Equals(other); + } + + public static bool operator ==(ContactHitEvent left, ContactHitEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(ContactHitEvent left, ContactHitEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ContactHitEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ContactHitEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct ContactEvents : IEquatable + { + public bool Equals(ContactEvents other) + { + fixed (ContactEvents* __self = &this) + { + return new Span(__self, sizeof(ContactEvents)).SequenceEqual(new Span(&other, sizeof(ContactEvents))); + } + } + + public override bool Equals(object? obj) + { + return obj is ContactEvents other && Equals(other); + } + + public static bool operator ==(ContactEvents left, ContactEvents right) + { + return left.Equals(right); + } + + public static bool operator !=(ContactEvents left, ContactEvents right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ContactEvents* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ContactEvents))); + return hash.ToHashCode(); + } + } + } + + public partial struct BodyMoveEvent : IEquatable + { + public bool Equals(BodyMoveEvent other) + { + fixed (BodyMoveEvent* __self = &this) + { + return new Span(__self, sizeof(BodyMoveEvent)).SequenceEqual(new Span(&other, sizeof(BodyMoveEvent))); + } + } + + public override bool Equals(object? obj) + { + return obj is BodyMoveEvent other && Equals(other); + } + + public static bool operator ==(BodyMoveEvent left, BodyMoveEvent right) + { + return left.Equals(right); + } + + public static bool operator !=(BodyMoveEvent left, BodyMoveEvent right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (BodyMoveEvent* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(BodyMoveEvent))); + return hash.ToHashCode(); + } + } + } + + public partial struct BodyEvents : IEquatable + { + public bool Equals(BodyEvents other) + { + fixed (BodyEvents* __self = &this) + { + return new Span(__self, sizeof(BodyEvents)).SequenceEqual(new Span(&other, sizeof(BodyEvents))); + } + } + + public override bool Equals(object? obj) + { + return obj is BodyEvents other && Equals(other); + } + + public static bool operator ==(BodyEvents left, BodyEvents right) + { + return left.Equals(right); + } + + public static bool operator !=(BodyEvents left, BodyEvents right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (BodyEvents* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(BodyEvents))); + return hash.ToHashCode(); + } + } + } + + public partial struct ContactData : IEquatable + { + public bool Equals(ContactData other) + { + fixed (ContactData* __self = &this) + { + return new Span(__self, sizeof(ContactData)).SequenceEqual(new Span(&other, sizeof(ContactData))); + } + } + + public override bool Equals(object? obj) + { + return obj is ContactData other && Equals(other); + } + + public static bool operator ==(ContactData left, ContactData right) + { + return left.Equals(right); + } + + public static bool operator !=(ContactData left, ContactData right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ContactData* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ContactData))); + return hash.ToHashCode(); + } + } + } + + public partial struct DebugDraw : IEquatable + { + public bool Equals(DebugDraw other) + { + fixed (DebugDraw* __self = &this) + { + return new Span(__self, sizeof(DebugDraw)).SequenceEqual(new Span(&other, sizeof(DebugDraw))); + } + } + + public override bool Equals(object? obj) + { + return obj is DebugDraw other && Equals(other); + } + + public static bool operator ==(DebugDraw left, DebugDraw right) + { + return left.Equals(right); + } + + public static bool operator !=(DebugDraw left, DebugDraw right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (DebugDraw* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(DebugDraw))); + return hash.ToHashCode(); + } + } + } + + public partial struct InlineArrays + { + public partial struct Vec2_8 : IEquatable + { + public bool Equals(Vec2_8 other) + { + fixed (Vec2_8* __self = &this) + { + return new Span(__self, sizeof(Vec2_8)).SequenceEqual(new Span(&other, sizeof(Vec2_8))); + } + } + + public override bool Equals(object? obj) + { + return obj is Vec2_8 other && Equals(other); + } + + public static bool operator ==(Vec2_8 left, Vec2_8 right) + { + return left.Equals(right); + } + + public static bool operator !=(Vec2_8 left, Vec2_8 right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (Vec2_8* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(Vec2_8))); + return hash.ToHashCode(); + } + } + } + } + + public partial struct InlineArrays + { + public partial struct byte_3 : IEquatable + { + public bool Equals(byte_3 other) + { + fixed (byte_3* __self = &this) + { + return new Span(__self, sizeof(byte_3)).SequenceEqual(new Span(&other, sizeof(byte_3))); + } + } + + public override bool Equals(object? obj) + { + return obj is byte_3 other && Equals(other); + } + + public static bool operator ==(byte_3 left, byte_3 right) + { + return left.Equals(right); + } + + public static bool operator !=(byte_3 left, byte_3 right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (byte_3* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(byte_3))); + return hash.ToHashCode(); + } + } + } + } + + public partial struct InlineArrays + { + public partial struct ManifoldPoint_2 : IEquatable + { + public bool Equals(ManifoldPoint_2 other) + { + fixed (ManifoldPoint_2* __self = &this) + { + return new Span(__self, sizeof(ManifoldPoint_2)).SequenceEqual(new Span(&other, sizeof(ManifoldPoint_2))); + } + } + + public override bool Equals(object? obj) + { + return obj is ManifoldPoint_2 other && Equals(other); + } + + public static bool operator ==(ManifoldPoint_2 left, ManifoldPoint_2 right) + { + return left.Equals(right); + } + + public static bool operator !=(ManifoldPoint_2 left, ManifoldPoint_2 right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (ManifoldPoint_2* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(ManifoldPoint_2))); + return hash.ToHashCode(); + } + } + } + } + + public partial struct InlineArrays + { + public partial struct int_12 : IEquatable + { + public bool Equals(int_12 other) + { + fixed (int_12* __self = &this) + { + return new Span(__self, sizeof(int_12)).SequenceEqual(new Span(&other, sizeof(int_12))); + } + } + + public override bool Equals(object? obj) + { + return obj is int_12 other && Equals(other); + } + + public static bool operator ==(int_12 left, int_12 right) + { + return left.Equals(right); + } + + public static bool operator !=(int_12 left, int_12 right) + { + return !(left == right); + } + + public override int GetHashCode() + { + fixed (int_12* __self = &this) + { + HashCode hash = new(); + hash.AddBytes(new Span(__self, sizeof(int_12))); + return hash.ToHashCode(); + } + } + } + } +} +#nullable disable diff --git a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj index a1aa96a..98fc342 100644 --- a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj +++ b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj @@ -1,36 +1,16 @@  - netstandard2.1;net6.0;net7.0 + net8.0 + enable true - true - true - - 3.0.0 - Box2D.NET.Bindings.Debug - Box2D.NET.Bindings.Release - BeanCheeseBurrito - BeanCheeseBurrito - Raw C# bindings for Box2D 3.0 - $(Title) - https://github.com/BeanCheeseBurrito/Box2D.NET - true - MIT - https://github.com/BeanCheeseBurrito/Box2D.NET - Github - - portable - true - snupkg - true - true + Raw C# bindings for Box2D - diff --git a/Box2D.NET.Examples/Box2D.NET.Examples.csproj b/Box2D.NET.Examples/Box2D.NET.Examples.csproj index fa3cae6..6422b64 100644 --- a/Box2D.NET.Examples/Box2D.NET.Examples.csproj +++ b/Box2D.NET.Examples/Box2D.NET.Examples.csproj @@ -6,6 +6,7 @@ enable enable true + false @@ -13,10 +14,8 @@ $(Example) - - - + diff --git a/Box2D.NET.Examples/CSharp/HelloWorld.cs b/Box2D.NET.Examples/CSharp/HelloWorld.cs index 33ab63b..10b2cc4 100644 --- a/Box2D.NET.Examples/CSharp/HelloWorld.cs +++ b/Box2D.NET.Examples/CSharp/HelloWorld.cs @@ -19,7 +19,7 @@ public static void Main() // Create a shape B2.Polygon box = B2.MakeBox(1, 1); B2.ShapeDef shapeDef = B2.DefaultShapeDef(); - shapeDef.friction = 0.6f; + shapeDef.material.friction = 0.6f; shapeDef.density = 1.0f; B2.ShapeId shapeId = B2.CreatePolygonShape(bodyId, &shapeDef, &box); diff --git a/Box2D.NET.Native/Box2D.NET.Native.csproj b/Box2D.NET.Native/Box2D.NET.Native.csproj index cc4ad81..294a6ed 100644 --- a/Box2D.NET.Native/Box2D.NET.Native.csproj +++ b/Box2D.NET.Native/Box2D.NET.Native.csproj @@ -1,106 +1,160 @@  - - netstandard1.0 - $(NoWarn);NU5128 + Library + netstandard2.1 + + + false + false + false + false + false + false + false + $(NoWarn);CS2008;NU5128 - true - true - false - - 3.0.0 - Box2D.NET.Native.Debug - Box2D.NET.Native.Release - BeanCheeseBurrito - BeanCheeseBurrito - Native libraries for Box2D 3.0 - $(Title) - https://github.com/BeanCheeseBurrito/Box2D.NET - true - MIT - https://github.com/BeanCheeseBurrito/Box2D.NET - Github + Native libraries for Box2D + - true - true - true + Debug + ReleaseFast + - $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture) - box2d + + + $(HostRuntime) + - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + + + + + - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - + + $(WasmCachePath)sysroot + + + + + + x86_64-windows-gnu + + + + + x86-windows-gnu + + + + + arm-windows-gnu + + + + + aarch64-windows-gnu + + + + + x86_64-linux-gnu + + + + + x86-linux-gnu + + + + + arm-linux-gnueabihf + + + + + aarch64-linux-gnu + + + + + x86_64-macos + + + + + aarch64-macos + + + + + x86_64-ios-simulator + -Dsysroot="$(IOS_SIMULATOR_SDK_SYSROOT)" + + + + + aarch64-ios-simulator + -Dsysroot="$(IOS_SIMULATOR_SDK_SYSROOT)" -Dcpu=apple_m1 + + + + + aarch64-ios + -Dsysroot="$(IOS_SDK_SYSROOT)" + + + + + wasm32-emscripten + -Dsysroot="$(EMSCRIPTEN_CACHE_SYSROOT)" + + + + + aarch64-linux-android.21 + -Dsysroot="$(ANDROID_NDK_SYSROOT)" + + + + + x86_64-linux-android.21 + -Dsysroot="$(ANDROID_NDK_SYSROOT)" + + + + + $(RuntimeIdentifier) + + + + + + + + $(ZigExePath) build -Doptimize=$(ZigConfiguration) --prefix $(OutputPath)runtimes --prefix-lib-dir $(RuntimeIdentifier)/native --prefix-exe-dir $(RuntimeIdentifier)/native -Dtarget=$(ZigIdentifier) -Dcompiler-rt-path="$(ZigLibPath)compiler_rt.zig" $(ZigArgs) + + + + + + + diff --git a/Box2D.NET.Native/Box2D.NET.Native.targets b/Box2D.NET.Native/Box2D.NET.Native.targets deleted file mode 100644 index ecd9be2..0000000 --- a/Box2D.NET.Native/Box2D.NET.Native.targets +++ /dev/null @@ -1,31 +0,0 @@ - - - - %(Filename)%(Extension) - Always - false - - - - %(Filename)%(Extension) - Always - false - - - - %(Filename)%(Extension) - Always - false - - - - %(Filename)%(Extension) - Always - false - - - diff --git a/Box2D.NET.Native/build.zig b/Box2D.NET.Native/build.zig index 4e9f309..2146b9a 100644 --- a/Box2D.NET.Native/build.zig +++ b/Box2D.NET.Native/build.zig @@ -1,68 +1,149 @@ const std = @import("std"); +const builtin = @import("builtin"); const Build = std.Build; -const LazyPath = Build.LazyPath; -pub fn build(b: *Build) void { - const target = b.standardTargetOptions(.{}); - const optimize = b.standardOptimizeOption(.{}); +pub const LibraryType = enum { Shared, Static }; - const lib = b.addSharedLibrary(.{ - .name = "box2d", - .target = target, - .optimize = optimize, - .strip = optimize != .Debug, - }); +const BuildOptions = struct { + optimize: std.builtin.OptimizeMode, + target: Build.ResolvedTarget, + library_type: LibraryType, + // There are some issues with path lookups when using --sysroot. Pass as a build option instead. + sysroot: ?[]const u8, + // When building static libraries for Windows, zig's compiler-rt needs to be bundled. + // For some reason, setting "bundle_compiler_rt" to true doesn't produce a static library that works with NativeAOT. + // As a work-around, we manually build the compiler_rt.zig file. + compiler_rt_path: ?[]const u8, +}; + +const src_flags = [_][]const u8{ + "-fno-sanitize=undefined", +}; + +// Collect all C source files in the given directory and its subdirectories. +fn getSourceFiles(b: *std.Build, dir_path: []const u8) !std.ArrayList([]const u8) { + var list = std.ArrayList([]const u8).init(b.allocator); + + var dir = try std.fs.cwd().openDir(dir_path, .{ .iterate = true }); + defer dir.close(); - if (optimize != .Debug) { - lib.defineCMacro("NDEBUG", null); + var walker = try dir.walk(b.allocator); + defer walker.deinit(); + + while (try walker.next()) |entry| { + if (entry.kind == .file and std.mem.endsWith(u8, entry.path, ".c")) { + try list.append(b.pathJoin(&.{ dir_path, entry.path })); + } } - lib.linkLibC(); + return list; +} + +pub fn compile(b: *Build, options: BuildOptions) !void { + const lib = switch (options.library_type) { + .Shared => b.addSharedLibrary(.{ + .name = "box2d", + .target = options.target, + .optimize = options.optimize, + .strip = options.optimize != .Debug, + .link_libc = true, + }), + .Static => b.addStaticLibrary(.{ + .name = "box2d", + .target = options.target, + .optimize = options.optimize, + .strip = options.optimize != .Debug, + .link_libc = true, + .root_source_file = if (options.compiler_rt_path) |path| .{ .cwd_relative = path } else null, + }), + }; + + if (options.optimize != .Debug) { + lib.root_module.addCMacro("NDEBUG", ""); + } - lib.addIncludePath(b.path("../native/box2d/src")); lib.addIncludePath(b.path("../native/box2d/include")); - lib.addIncludePath(b.path("../native/box2d/extern/simde")); - - lib.addCSourceFiles(.{ - .files = &.{ - "../native/box2d/src/aabb.c", - "../native/box2d/src/allocate.c", - "../native/box2d/src/array.c", - "../native/box2d/src/bitset.c", - "../native/box2d/src/block_array.c", - "../native/box2d/src/body.c", - "../native/box2d/src/broad_phase.c", - "../native/box2d/src/constraint_graph.c", - "../native/box2d/src/contact.c", - "../native/box2d/src/contact_solver.c", - "../native/box2d/src/core.c", - "../native/box2d/src/distance.c", - "../native/box2d/src/distance_joint.c", - "../native/box2d/src/dynamic_tree.c", - "../native/box2d/src/geometry.c", - "../native/box2d/src/hull.c", - "../native/box2d/src/id_pool.c", - "../native/box2d/src/island.c", - "../native/box2d/src/joint.c", - "../native/box2d/src/manifold.c", - "../native/box2d/src/math_functions.c", - "../native/box2d/src/motor_joint.c", - "../native/box2d/src/mouse_joint.c", - "../native/box2d/src/prismatic_joint.c", - "../native/box2d/src/revolute_joint.c", - "../native/box2d/src/shape.c", - "../native/box2d/src/solver.c", - "../native/box2d/src/solver_set.c", - "../native/box2d/src/stack_allocator.c", - "../native/box2d/src/table.c", - "../native/box2d/src/timer.c", - "../native/box2d/src/types.c", - "../native/box2d/src/weld_joint.c", - "../native/box2d/src/wheel_joint.c", - "../native/box2d/src/world.c", + lib.addIncludePath(b.path("../native/box2d/src")); + lib.addCSourceFile(.{ .file = b.path("../native/inline.c"), .flags = &src_flags }); + + const source_files = try getSourceFiles(b, "../native/box2d/src"); + defer source_files.deinit(); + for (source_files.items) |file| { + lib.addCSourceFile(.{ .file = b.path(file), .flags = &src_flags }); + } + + switch (options.target.result.os.tag) { + .windows => { + // Temporary fix to get rid of undefined symbol errors when statically linking in Native AOT. + if (options.library_type == LibraryType.Static) { + lib.addCSourceFile(.{ .file = b.path("../native/windows.c"), .flags = &src_flags }); + } }, - .flags = &.{}, - }); + .ios => { + if (options.sysroot == null or options.sysroot.?.len == 0) { + @panic("A --sysroot path to an IOS SDK needs to be provided when compiling for IOS."); + } + + lib.addSystemFrameworkPath(.{ .cwd_relative = b.pathJoin(&.{ options.sysroot.?, "/System/Library/Frameworks" }) }); + lib.addSystemIncludePath(.{ .cwd_relative = b.pathJoin(&.{ options.sysroot.?, "/usr/include" }) }); + lib.addLibraryPath(.{ .cwd_relative = b.pathJoin(&.{ options.sysroot.?, "/usr/lib" }) }); + }, + .emscripten => { + if (options.sysroot == null or options.sysroot.?.len == 0) { + @panic("A --sysroot path to an emscripten cache needs to be provided when compiling for wasm."); + } + + lib.addSystemIncludePath(.{ .cwd_relative = b.pathJoin(&.{ options.sysroot.?, "/include" }) }); + }, + .linux => { + if (options.target.result.abi == .android) { + if (options.sysroot == null or options.sysroot.?.len == 0) { + @panic("A --sysroot path to an Android NDK needs to be provided when compiling for Android."); + } + + const triple = switch (options.target.result.cpu.arch) { + .aarch64 => "aarch64-linux-android", + .x86_64 => "x86_64-linux-android", + else => @panic("Unsupported Android architecture"), + }; + + const android_api_level: []const u8 = "21"; + + const android_lib_path = b.pathJoin(&.{ options.sysroot.?, "/usr/lib/", triple, android_api_level }); + const android_include_path = b.pathJoin(&.{ options.sysroot.?, "/usr/include" }); + const android_system_include_path = b.pathJoin(&.{ options.sysroot.?, "/usr/include/", triple }); + + lib.addLibraryPath(.{ .cwd_relative = android_lib_path }); + + const libc_file_name = "android-libc.conf"; + var libc_content = std.ArrayList(u8).init(b.allocator); + errdefer libc_content.deinit(); + + const writer = libc_content.writer(); + const libc_installation = std.zig.LibCInstallation{ + .include_dir = android_include_path, + .sys_include_dir = android_system_include_path, + .crt_dir = android_lib_path, + }; + libc_installation.render(writer) catch @panic("Failed to render libc"); + const libc_path = b.addWriteFiles().add(libc_file_name, libc_content.items); + + lib.setLibCFile(libc_path); + lib.libc_file.?.addStepDependencies(&lib.step); + } + }, + else => {}, + } b.installArtifact(lib); } + +pub fn build(b: *Build) !void { + try compile(b, .{ + .optimize = b.standardOptimizeOption(.{}), + .target = b.standardTargetOptions(.{}), + .library_type = b.option(LibraryType, "library-type", "Compile as a static or shared library.") orelse LibraryType.Shared, + .sysroot = b.option([]const u8, "sysroot", "Path to sysroot.") orelse null, + .compiler_rt_path = b.option([]const u8, "compiler-rt-path", "Path to the compiler_rt file.") orelse null, + }); +} diff --git a/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.props b/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.props new file mode 100644 index 0000000..8c119d5 --- /dev/null +++ b/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.props @@ -0,0 +1,2 @@ + + diff --git a/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.targets b/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.targets new file mode 100644 index 0000000..771eaed --- /dev/null +++ b/Box2D.NET.Native/buildTransitive/Box2D.NET.Native.targets @@ -0,0 +1,13 @@ + + + true + $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)../static/$(RuntimeIdentifier)/native/')) + $(Box2DStaticPath)box2d.lib + $(Box2DStaticPath)libbox2d.a + + + + + + + diff --git a/Box2D.NET.Tests/Box2D.NET.Tests.csproj b/Box2D.NET.Tests/Box2D.NET.Tests.csproj index a1e1516..0781fb8 100644 --- a/Box2D.NET.Tests/Box2D.NET.Tests.csproj +++ b/Box2D.NET.Tests/Box2D.NET.Tests.csproj @@ -1,9 +1,9 @@ - netcoreapp3.1;net6.0;net7.0;net8.0 - false + net8.0 true + false @@ -12,11 +12,9 @@ - - - + diff --git a/Box2D.NET.Tests/WorldTests.cs b/Box2D.NET.Tests/WorldTests.cs index 5cab2c9..e43c532 100644 --- a/Box2D.NET.Tests/WorldTests.cs +++ b/Box2D.NET.Tests/WorldTests.cs @@ -14,7 +14,7 @@ public void HelloWorld() worldDef.gravity = new B2.Vec2 { x = 0.0f, y = -10.0f }; B2.WorldId worldId = B2.CreateWorld(&worldDef); - Assert.True(B2.WorldIsValid(worldId) != 0); + Assert.True(B2.WorldIsValid(worldId)); // Define the ground body. B2.BodyDef groundBodyDef = B2.DefaultBodyDef(); @@ -24,7 +24,7 @@ public void HelloWorld() // from a pool and creates the ground box shape (also from a pool). // The body is also added to the world. B2.BodyId groundId = B2.CreateBody(worldId, &groundBodyDef); - Assert.True(B2.BodyIsValid(groundId) != 0); + Assert.True(B2.BodyIsValid(groundId)); // Define the ground box shape. The extents are the half-widths of the box. B2.Polygon groundBox = B2.MakeBox(50.0f, 10.0f); @@ -50,7 +50,7 @@ public void HelloWorld() shapeDef.density = 1.0f; // Override the default friction. - shapeDef.friction = 0.3f; + shapeDef.material.friction = 0.3f; // Add the shape to the body. B2.CreatePolygonShape(bodyId, &shapeDef, &dynamicBox); @@ -80,9 +80,9 @@ public void HelloWorld() // create orphaned ids, so be careful about your world management. B2.DestroyWorld(worldId); - Assert.True(Math.Abs(position.x) < 0.01f); - Assert.True(Math.Abs(position.y - 1.00f) < 0.01f); - Assert.True(Math.Abs(Math.Atan2(rotation.s, rotation.c)) < 0.01f); + Assert.True(B2.AbsFloat(position.x) < 0.01f); + Assert.True(B2.AbsFloat(position.y - 1.00f) < 0.01f); + Assert.True(B2.AbsFloat(B2.RotGetAngle(rotation)) < 0.01f); } } } diff --git a/Box2D.NET/Box2D.NET.csproj b/Box2D.NET/Box2D.NET.csproj index c169757..0851f78 100644 --- a/Box2D.NET/Box2D.NET.csproj +++ b/Box2D.NET/Box2D.NET.csproj @@ -1,37 +1,16 @@  - netstandard2.1;net6.0;net7.0 + net8.0 enable - true - true - - 3.0.0 - Box2D.NET.Debug - Box2D.NET.Release - BeanCheeseBurrito - BeanCheeseBurrito - Raw C# bindings for Box2D 3.0 - $(Title) - https://github.com/BeanCheeseBurrito/Box2D.NET - true - MIT - https://github.com/BeanCheeseBurrito/Box2D.NET - Github - - portable - true - snupkg - true - true + Raw C# bindings for Box2D - - + diff --git a/Directory.Build.props b/Directory.Build.props index d73a6b4..064181f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,61 @@ - false + 3.1.0 + BeanCheeseBurrito + BeanCheeseBurrito + https://github.com/BeanCheeseBurrito/Box2D.NET + MIT + README.md + true + https://github.com/BeanCheeseBurrito/Box2D.NET + Github + + portable + true + snupkg + true + true + + + + $(NoWarn);NETSDK1138 true true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + + + + + + $([System.IO.Path]::GetFileNameWithoutExtension('$(MSBuildProjectFile)')) + $(ProjectName).Debug + $(ProjectName).Release + + + + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture) + + + + + win-x64 + win-arm64 + + + + + linux-x64 + linux-arm64 + + + + + osx-x64 + osx-arm64 + + + diff --git a/Directory.Build.targets b/Directory.Build.targets index 8fe590b..8c119d5 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,2 @@ - - $(Version)$(NugetVersionSuffix) - diff --git a/README.md b/README.md index b66b36a..6d65724 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ To include both of them in your project based on your build configuration, use t Exe - net7.0 + net8.0 @@ -52,24 +52,49 @@ To include both of them in your project based on your build configuration, use t ``` -## GitLab Package Registry -For more up-to-date packages, development builds are available on the [GitLab package registry](https://gitlab.com/BeanCheeseBurrito/Box2D.NET/-/packages). To add the development feed to your project, add the GitLab link below as a restore source. You can now reference any package version listed [here](https://gitlab.com/BeanCheeseBurrito/Box2D.NET/-/packages)! +## GitHub Package Registry +For more up-to-date packages, development builds are available on the [GitHub package registry](https://github.com/BeanCheeseBurrito?tab=packages&repo_name=Box2D.NET). Packages are automatically uploaded on every commit to the main branch. + +To access development builds from your project, you first need to create a GitHub personal access token with the ``read:packages`` permission. (See [Creating a personal access token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)) + +Once you have created a personal access token, run the following command to add the GitHub feed as a new package source. Replace ``YOUR_GITHUB_USERNAME`` with your GitHub username and ``YOUR_GITHUB_TOKEN`` with your personal access token. +```bash +dotnet nuget add source --name "box2d.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json" +``` + +You can now reference any package from the [GitHub feed](https://github.com/BeanCheeseBurrito?tab=packages&repo_name=Box2D.NET)! + +```console +dotnet add PROJECT package Box2D.NET.Release --version *-build.* +``` + ```xml - Exe - net7.0 - https://gitlab.com/api/v4/projects/53993416/packages/nuget/index.json + net8.0 - + - ``` -> [!WARNING] +___ +By default, the GitHub feed will be added to your global ``nuget.config`` file and can be referenced by any project on your machine. If wish to add the feed to a single project/solution, create a ``nuget.config`` file at the root of your project/solution directory and run the following command with the ``--configfile`` option. +```bash +dotnet nuget add source --configfile "./nuget.config" --name "box2d.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json" +``` +To remove the GitHub feed from your NuGet package sources, run the following command. +```bash +dotnet nuget remove source "box2d.net" +``` +GitHub Actions workflows can be authenticated using the ``GITHUB_TOKEN`` secret. +```yaml +- name: Add GitHub source + run: dotnet nuget add source --name "box2d.net" --username "USERNAME" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json" +``` +> [!WARNING] > Development feed packages may be deleted without warning to free up space. ## Running examples @@ -110,13 +135,11 @@ Reference the project and import the native libraries. Exe - net7.0 + net8.0 - - - + diff --git a/native/box2d b/native/box2d index 8e7a17c..d5935a7 160000 --- a/native/box2d +++ b/native/box2d @@ -1 +1 @@ -Subproject commit 8e7a17c5c942dbf2fdea8b9d09983410dcc0429d +Subproject commit d5935a7a1853eb0f4aca92b369f37929d02c7e11 diff --git a/native/inline.c b/native/inline.c new file mode 100644 index 0000000..7d2f397 --- /dev/null +++ b/native/inline.c @@ -0,0 +1,6 @@ +// Include inline functions in native libraries. +#include +#undef B2_INLINE +#define B2_INLINE +#include +#include diff --git a/native/windows.c b/native/windows.c new file mode 100644 index 0000000..55af413 --- /dev/null +++ b/native/windows.c @@ -0,0 +1,4 @@ +// Temporary fix for undefined symbol errors when statically linking on windows. +int __isnanf(float) { } +int __fpclassifyf(float) { } +int printf(const char *, ...) { }