diff --git a/.gitignore b/.gitignore index 32a0183..07b1504 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ .vs/ dotnet-sandbox/obj/ dotnet-sandbox/bin/ +GroupedNativeMethodsGenerator/obj/ +GroupedNativeMethodsGenerator/bin/ unity-sandbox/obj/ unity-sandbox/bin/ unity-sandbox/Temp/ @@ -13,6 +15,4 @@ unity-sandbox/*.csproj unity-sandbox/*.csproj.user unity-sandbox/*.sln unity-sandbox/Library - - unity-sandbox/Logs/ diff --git a/GroupedNativeMethodsGenerator.sln b/GroupedNativeMethodsGenerator.sln new file mode 100644 index 0000000..b188df3 --- /dev/null +++ b/GroupedNativeMethodsGenerator.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33414.496 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CsbindgenDotnetConsoleApp", "dotnet-sandbox\CsbindgenDotnetConsoleApp.csproj", "{9FCF940C-368E-41C5-B83A-CFDEC01E2B70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroupedNativeMethodsGenerator", "GroupedNativeMethodsGenerator\GroupedNativeMethodsGenerator.csproj", "{C63592D1-9C02-43BF-A4E0-C23D4B1C0ACE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9FCF940C-368E-41C5-B83A-CFDEC01E2B70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FCF940C-368E-41C5-B83A-CFDEC01E2B70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FCF940C-368E-41C5-B83A-CFDEC01E2B70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FCF940C-368E-41C5-B83A-CFDEC01E2B70}.Release|Any CPU.Build.0 = Release|Any CPU + {C63592D1-9C02-43BF-A4E0-C23D4B1C0ACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C63592D1-9C02-43BF-A4E0-C23D4B1C0ACE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C63592D1-9C02-43BF-A4E0-C23D4B1C0ACE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C63592D1-9C02-43BF-A4E0-C23D4B1C0ACE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8FAD332E-1845-455E-AB46-3F45699D2335} + EndGlobalSection +EndGlobal diff --git a/GroupedNativeMethodsGenerator/Class1.cs b/GroupedNativeMethodsGenerator/Class1.cs new file mode 100644 index 0000000..3e15bb0 --- /dev/null +++ b/GroupedNativeMethodsGenerator/Class1.cs @@ -0,0 +1,71 @@ +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; + +namespace GroupedNativeMethodsGenerator; + +[Generator(LanguageNames.CSharp)] +public partial class GroupedNativeMethodsGenerator : IIncrementalGenerator +{ + public void Initialize(IncrementalGeneratorInitializationContext context) + { + context.RegisterPostInitializationOutput(ctx => + { + ctx.AddSource("GroupedNativeMethodsGenerator.Attribute.cs", """ +namespace GroupedNativeMethodsGenerator +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] + internal sealed class GroupedNativeMethodsAttribute : Attribute + { + public string RemovePrefix { get; set; } = ""; + public bool RemoveUntilTypeName { get; set; } = true; + + /// Fix method name as C# Style, e.g.: foo_bar_baz() -> FooBarBaz() + public bool FixMethodName { get; set; } = true; + } +} +"""); + }); + + var source = context.SyntaxProvider.ForAttributeWithMetadataName("GroupedNativeMethodsGenerator.GroupedNativeMethodsAttribute", + (node, token) => node is ClassDeclarationSyntax, + (ctx, token) => ctx); + + context.RegisterSourceOutput(source, Emit); + } + + static void Emit(SourceProductionContext context, GeneratorAttributeSyntaxContext source) + { + var typeSymbol = (INamedTypeSymbol)source.TargetSymbol; + var typeNode = (TypeDeclarationSyntax)source.TargetNode; + + var ns = typeSymbol.ContainingNamespace.IsGlobalNamespace + ? "" + : $"namespace {typeSymbol.ContainingNamespace};"; + + var fullType = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + .Replace("global::", "") + .Replace("<", "_") + .Replace(">", "_"); + + var methods = typeSymbol.GetMembers() + .OfType(); + + + + // context.AddSource($"{fullType}.SampleGenerator.g.cs", code); + } +} + +// TODO:... +public static class DiagnosticDescriptors +{ + const string Category = "SampleGenerator"; + + public static readonly DiagnosticDescriptor ExistsOverrideToString = new( + id: "SAMPLE001", + title: "ToString override", + messageFormat: "The GenerateToString class '{0}' has ToString override but it is not allowed.", + category: Category, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true); +} \ No newline at end of file diff --git a/GroupedNativeMethodsGenerator/GroupedNativeMethodsGenerator.csproj b/GroupedNativeMethodsGenerator/GroupedNativeMethodsGenerator.csproj new file mode 100644 index 0000000..38db96e --- /dev/null +++ b/GroupedNativeMethodsGenerator/GroupedNativeMethodsGenerator.csproj @@ -0,0 +1,16 @@ + + + + netstandard2.0 + enable + enable + 11 + true + cs + + + + + + + \ No newline at end of file diff --git a/GroupedNativeMethodsGenerator/Properties/launchSettings.json b/GroupedNativeMethodsGenerator/Properties/launchSettings.json new file mode 100644 index 0000000..7174de3 --- /dev/null +++ b/GroupedNativeMethodsGenerator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "P1": { + "commandName": "DebugRoslynComponent", + "targetProject": "..\\dotnet-sandbox\\CsbindgenDotnetConsoleApp.csproj" + } + } +} \ No newline at end of file diff --git a/dotnet-sandbox/BindingGroupExtensions.cs b/dotnet-sandbox/BindingGroupExtensions.cs new file mode 100644 index 0000000..1aeb8f3 --- /dev/null +++ b/dotnet-sandbox/BindingGroupExtensions.cs @@ -0,0 +1,50 @@ +using CsBindgen; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace CsbindgenDotnetConsoleApp +{ + // Concept for grouping extension + + internal static unsafe class BindingGroupExtensions + { + // public static extern bool quiche_conn_set_keylog_path(quiche_conn* conn, byte* path); + // public static extern nuint quiche_conn_max_send_udp_payload_size(quiche_conn* conn); + // public static extern int quiche_conn_close(quiche_conn* conn, [MarshalAs(UnmanagedType.U1)] bool app, ulong err, byte* reason, nuint reason_len); + + public static bool SetKeylogPath(this ref quiche_conn conn, byte* path) + { + return LibQuiche.quiche_conn_set_keylog_path((quiche_conn*)Unsafe.AsPointer(ref conn), path); + } + + public static nuint MaxSendUdpPayloadSize(this ref quiche_conn conn) + { + return LibQuiche.quiche_conn_max_send_udp_payload_size((quiche_conn*)Unsafe.AsPointer(ref conn)); + } + + public static int MaxSendUdpPayloadSize(this ref quiche_conn conn, bool app, ulong err, byte* reason, nuint reason_len) + { + return LibQuiche.quiche_conn_close((quiche_conn*)Unsafe.AsPointer(ref conn), app, err, reason, reason_len); + } + + public static bool Hoge(quiche_conn* conn, byte* path) + { + return conn->SetKeylogPath(path); + } + + } +} + + +namespace Physx +{ + [GroupedNativeMethodsGenerator.GroupedNativeMethods] + internal static unsafe partial class LibPhysxd + { + } +} \ No newline at end of file diff --git a/dotnet-sandbox/CsbindgenDotnetConsoleApp.csproj b/dotnet-sandbox/CsbindgenDotnetConsoleApp.csproj index f5e0449..25ee1db 100644 --- a/dotnet-sandbox/CsbindgenDotnetConsoleApp.csproj +++ b/dotnet-sandbox/CsbindgenDotnetConsoleApp.csproj @@ -8,13 +8,6 @@ true - - - - Always @@ -24,4 +17,11 @@ + + + Analyzer + false + + + diff --git a/dotnet-sandbox/jolt_bindgen.cs b/dotnet-sandbox/jolt_bindgen.cs new file mode 100644 index 0000000..efd8312 --- /dev/null +++ b/dotnet-sandbox/jolt_bindgen.cs @@ -0,0 +1,4197 @@ +// +// This code is generated by csbindgen. +// DON'T CHANGE THIS DIRECTLY. +// +#pragma warning disable CS8981 +using System; +using System.Runtime.InteropServices; + +namespace Jolt +{ + internal static unsafe partial class NativeMethods + { + const string __DllName = "libjolt"; + + /// Register platform default allocation / free functions + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RegisterDefaultAllocator", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RegisterDefaultAllocator(); + + /// Register all physics types with the factory + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RegisterTypes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RegisterTypes(); + + /// Unregisters all types with the factory and cleans up the default material + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_UnregisterTypes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_UnregisterTypes(); + + /// Get a visually distinct color + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Color_sGetDistinctColor", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Color JPH_Color_sGetDistinctColor(int inIndex); + + /// Get the amount of ticks per second, note that this number will never be fully accurate as the amound of ticks per second may vary with CPU load, so this number is only to be used to give an indication of time for profiling purposes + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GetProcessorTicksPerSecond", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong JPH_GetProcessorTicksPerSecond(); + + /// Release the semaphore, signalling the thread waiting on the barrier that there may be work + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Semaphore_Release", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Semaphore_Release(JPH_Semaphore* @this, uint inNumber); + + /// Acquire the semaphore inNumber times + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Semaphore_Acquire", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Semaphore_Acquire(JPH_Semaphore* @this, uint inNumber); + + /// Constructor + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Semaphore_Semaphore", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Semaphore_Semaphore(JPH_Semaphore* @this); + + /// Wait for all jobs in this job barrier, while waiting, execute jobs that are part of this barrier on the current thread + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_BarrierImpl_Wait", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_BarrierImpl_Wait(JPH_JobSystemWithBarrier_BarrierImpl* @this); + + /// Constructor + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_BarrierImpl_BarrierImpl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_BarrierImpl_BarrierImpl(JPH_JobSystemWithBarrier_BarrierImpl* @this); + + /// Initialize the barriers @param inMaxBarriers Max number of barriers that can be allocated at any time + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_Init(JPH_JobSystemWithBarrier* @this, uint inMaxBarriers); + + /// Constructs barriers @see JobSystemWithBarrier::Init + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_JobSystemWithBarrier", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_JobSystemWithBarrier(JPH_JobSystemWithBarrier* @this, uint inMaxBarriers); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_CreateBarrier", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_JobSystem_Barrier* JPH_JobSystemWithBarrier_CreateBarrier(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_DestroyBarrier", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_DestroyBarrier(void* @this, JPH_JobSystem_Barrier* inBarrier); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_WaitForJobs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_WaitForJobs(void* @this, JPH_JobSystem_Barrier* inBarrier); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_BarrierImpl_AddJob", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_BarrierImpl_AddJob(void* @this, JPH_JobSystem_JobHandle* inJob); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_BarrierImpl_AddJobs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_BarrierImpl_AddJobs(void* @this, JPH_JobSystem_JobHandle* inHandles, uint inNumHandles); + + /// Called by a Job to mark that it is finished + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemWithBarrier_BarrierImpl_OnJobFinished", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemWithBarrier_BarrierImpl_OnJobFinished(void* @this, JPH_JobSystem_Job* inJob); + + /// Initialize the thread pool @param inMaxJobs Max number of jobs that can be allocated at any time @param inMaxBarriers Max number of barriers that can be allocated at any time @param inNumThreads Number of threads to start (the number of concurrent jobs is 1 more because the main thread will also run jobs while waiting for a barrier to complete). Use -1 to autodetect the amount of CPU's. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemThreadPool_Init(JPH_JobSystemThreadPool* @this, uint inMaxJobs, uint inMaxBarriers, int inNumThreads); + + /// Creates a thread pool. @see JobSystemThreadPool::Init + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_JobSystemThreadPool", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemThreadPool_JobSystemThreadPool(JPH_JobSystemThreadPool* @this, uint inMaxJobs, uint inMaxBarriers, int inNumThreads); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_CreateJob", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_JobSystem_JobHandle JPH_JobSystemThreadPool_CreateJob(void* @this, byte* inName, JPH_Color inColor, std_function* inJobFunction, uint inNumDependencies); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_QueueJob", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemThreadPool_QueueJob(void* @this, JPH_JobSystem_Job* inJob); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_QueueJobs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemThreadPool_QueueJobs(void* @this, JPH_JobSystem_Job** inJobs, uint inNumJobs); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_JobSystemThreadPool_FreeJob", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_JobSystemThreadPool_FreeJob(void* @this, JPH_JobSystem_Job* inJob); + + /// Create a body @return Created body or null when out of bodies + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_CreateBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Body* JPH_BodyInterface_CreateBody(JPH_BodyInterface* @this, JPH_BodyCreationSettings* inSettings); + + /// Create a body with specified ID. This function can be used if a simulation is to run in sync between clients or if a simulation needs to be restored exactly. The ID created on the server can be replicated to the client and used to create a deterministic simulation. @return Created body or null when the body ID is invalid or a body of the same ID already exists. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_CreateBodyWithID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Body* JPH_BodyInterface_CreateBodyWithID(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_BodyCreationSettings* inSettings); + + /// Advanced use only. Creates a body without specifying an ID. This body cannot be added to the physics system until it has been assigned a body ID. This can be used to decouple allocation from registering the body. A call to CreateBodyWithoutID followed by AssignBodyID is equivalent to calling CreateBodyWithID. @return Created body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_CreateBodyWithoutID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Body* JPH_BodyInterface_CreateBodyWithoutID(JPH_BodyInterface* @this, JPH_BodyCreationSettings* inSettings); + + /// Advanced use only. Destroy a body previously created with CreateBodyWithoutID that hasn't gotten an ID yet through the AssignBodyID function, or a body that has had its body ID unassigned through UnassignBodyIDs. Bodies that have an ID should be destroyed through DestroyBody. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_DestroyBodyWithoutID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_DestroyBodyWithoutID(JPH_BodyInterface* @this, JPH_Body* inBody); + + /// Advanced use only. Assigns the next available body ID to a body that was created using CreateBodyWithoutID. After this call, the body can be added to the physics system. @return false if the body already has an ID or out of body ids. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AssignBodyID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyInterface_AssignBodyID(JPH_BodyInterface* @this, JPH_Body* ioBody); + + /// Advanced use only. Assigns a body ID to a body that was created using CreateBodyWithoutID. After this call, the body can be added to the physics system. @return false if the body already has an ID or if the ID is not valid. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AssignBodyID1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyInterface_AssignBodyID1(JPH_BodyInterface* @this, JPH_Body* ioBody, JPH_BodyID* inBodyID); + + /// Advanced use only. See UnassignBodyIDs. Unassigns the ID of a single body. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_UnassignBodyID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Body* JPH_BodyInterface_UnassignBodyID(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Advanced use only. Removes a number of body IDs from their bodies and returns the body pointers. Before calling this, the body should have been removed from the physics system. The body can be destroyed through DestroyBodyWithoutID. This can be used to decouple deallocation. A call to UnassignBodyIDs followed by calls to DestroyBodyWithoutID is equivalent to calling DestroyBodies. @param inBodyIDs A list of body IDs @param inNumber Number of bodies in the list @param outBodies If not null on input, this will contain a list of body pointers corresponding to inBodyIDs that can be destroyed afterwards (caller assumes ownership over these). + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_UnassignBodyIDs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_UnassignBodyIDs(JPH_BodyInterface* @this, JPH_BodyID* inBodyIDs, int inNumber, JPH_Body** outBodies); + + /// Destroy a body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_DestroyBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_DestroyBody(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Destroy multiple bodies + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_DestroyBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_DestroyBodies(JPH_BodyInterface* @this, JPH_BodyID* inBodyIDs, int inNumber); + + /// Add body to the physics system. Note that if you need to add multiple bodies, use the AddBodiesPrepare/AddBodiesFinalize function. Adding many bodies, one at a time, results in a really inefficient broadphase until PhysicsSystem::OptimizeBroadPhase is called or when PhysicsSystem::Update rebuilds the tree! After adding, to get a body by ID use the BodyLockRead or BodyLockWrite interface! + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddBody(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, int inActivationMode); + + /// Remove body from the physics system. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_RemoveBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_RemoveBody(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Check if a body has been added to the physics system. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_IsAdded", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyInterface_IsAdded(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Combines CreateBody and AddBody @return Created body ID or an invalid ID when out of bodies + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_CreateAndAddBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyID JPH_BodyInterface_CreateAndAddBody(JPH_BodyInterface* @this, JPH_BodyCreationSettings* inSettings, int inActivationMode); + + /// @name Batch adding interface, see Broadphase for further documentation. Note that ioBodies array must be kept constant while the add is in progress.@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddBodiesPrepare", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_BodyInterface_AddBodiesPrepare(JPH_BodyInterface* @this, JPH_BodyID* ioBodies, int inNumber); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddBodiesFinalize", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddBodiesFinalize(JPH_BodyInterface* @this, JPH_BodyID* ioBodies, int inNumber, void* inAddState, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddBodiesAbort", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddBodiesAbort(JPH_BodyInterface* @this, JPH_BodyID* ioBodies, int inNumber, void* inAddState); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_RemoveBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_RemoveBodies(JPH_BodyInterface* @this, JPH_BodyID* ioBodies, int inNumber); + + /// @name Activate / deactivate a body@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_ActivateBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_ActivateBody(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_ActivateBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_ActivateBodies(JPH_BodyInterface* @this, JPH_BodyID* inBodyIDs, int inNumber); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_DeactivateBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_DeactivateBody(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_DeactivateBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_DeactivateBodies(JPH_BodyInterface* @this, JPH_BodyID* inBodyIDs, int inNumber); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_IsActive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyInterface_IsActive(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Create a two body constraint + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_CreateConstraint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TwoBodyConstraint* JPH_BodyInterface_CreateConstraint(JPH_BodyInterface* @this, JPH_TwoBodyConstraintSettings* inSettings, JPH_BodyID* inBodyID1, JPH_BodyID* inBodyID2); + + /// Activate non-static bodies attached to a constraint + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_ActivateConstraint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_ActivateConstraint(JPH_BodyInterface* @this, JPH_TwoBodyConstraint* inConstraint); + + /// Set a new shape on the body @param inBodyID Body ID of body that had its shape changed @param inShape The new shape @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated @param inActivationMode Weather or not to activate the body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetShape(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Shape* inShape, [MarshalAs(UnmanagedType.U1)] bool inUpdateMassProperties, int inActivationMode); + + /// Notify all systems to indicate that a shape has changed (usable for MutableCompoundShapes) @param inBodyID Body ID of body that had its shape changed @param inPreviousCenterOfMass Center of mass of the shape before the alterations @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated @param inActivationMode Weather or not to activate the body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_NotifyShapeChanged", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_NotifyShapeChanged(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPreviousCenterOfMass, [MarshalAs(UnmanagedType.U1)] bool inUpdateMassProperties, int inActivationMode); + + /// @name Object layer of a body@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetObjectLayer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetObjectLayer(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, ushort inLayer); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetObjectLayer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ushort JPH_BodyInterface_GetObjectLayer(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// @name Position and rotation of a body@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetPositionAndRotation", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetPositionAndRotation(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPosition, JPH_Quat inRotation, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetPositionAndRotationWhenChanged", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetPositionAndRotationWhenChanged(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPosition, JPH_Quat inRotation, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetPositionAndRotation", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_GetPositionAndRotation(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3* outPosition, JPH_Quat* outRotation); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetPosition", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetPosition(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPosition, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetPosition", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BodyInterface_GetPosition(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetCenterOfMassPosition", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BodyInterface_GetCenterOfMassPosition(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetRotation", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetRotation(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Quat inRotation, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetRotation", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Quat JPH_BodyInterface_GetRotation(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetWorldTransform", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Mat44 JPH_BodyInterface_GetWorldTransform(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetCenterOfMassTransform", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Mat44 JPH_BodyInterface_GetCenterOfMassTransform(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Set velocity of body such that it will be positioned at inTargetPosition/Rotation in inDeltaTime seconds (will activate body if needed) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_MoveKinematic", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_MoveKinematic(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inTargetPosition, JPH_Quat inTargetRotation, float inDeltaTime); + + /// Linear or angular velocity (functions will activate body if needed). Note that the linear velocity is the velocity of the center of mass, which may not coincide with the position of your object, to correct for this: \\f$VelocityCOM = Velocity - AngularVelocity \\times ShapeCOM\\f$ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetLinearAndAngularVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetLinearAndAngularVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inLinearVelocity, JPH_Vec3 inAngularVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetLinearAndAngularVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_GetLinearAndAngularVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3* outLinearVelocity, JPH_Vec3* outAngularVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetLinearVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetLinearVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inLinearVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetLinearVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BodyInterface_GetLinearVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddLinearVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddLinearVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inLinearVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddLinearAndAngularVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddLinearAndAngularVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inLinearVelocity, JPH_Vec3 inAngularVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetAngularVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetAngularVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inAngularVelocity); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetAngularVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BodyInterface_GetAngularVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetPointVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BodyInterface_GetPointVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPoint); + + /// Set the complete motion state of a body. Note that the linear velocity is the velocity of the center of mass, which may not coincide with the position of your object, to correct for this: \\f$VelocityCOM = Velocity - AngularVelocity \\times ShapeCOM\\f$ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetPositionRotationAndVelocity", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetPositionRotationAndVelocity(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_Vec3 inLinearVelocity, JPH_Vec3 inAngularVelocity); + + /// @name Add forces to the body@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddForce", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddForce(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inForce); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddForce1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddForce1(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inForce, JPH_Vec3 inPoint); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddTorque", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddTorque(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inTorque); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddForceAndTorque", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddForceAndTorque(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inForce, JPH_Vec3 inTorque); + + /// @name Add an impulse to the body@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddImpulse", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddImpulse(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inImpulse); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddImpulse1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddImpulse1(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inImpulse, JPH_Vec3 inPoint); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_AddAngularImpulse", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_AddAngularImpulse(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_Vec3 inAngularImpulse); + + /// @name Body motion type@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetMotionType", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetMotionType(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, byte inMotionType, int inActivationMode); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetMotionType", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte JPH_BodyInterface_GetMotionType(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// @name Body motion quality@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetMotionQuality", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetMotionQuality(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, byte inMotionQuality); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetMotionQuality", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte JPH_BodyInterface_GetMotionQuality(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Get inverse inertia tensor in world space + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetInverseInertia", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Mat44 JPH_BodyInterface_GetInverseInertia(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// @name Restitution@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetRestitution", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetRestitution(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, float inRestitution); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetRestitution", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float JPH_BodyInterface_GetRestitution(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// @name Friction@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetFriction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetFriction(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, float inFriction); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetFriction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float JPH_BodyInterface_GetFriction(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// @name Gravity factor@{ + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_SetGravityFactor", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_SetGravityFactor(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, float inGravityFactor); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetGravityFactor", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float JPH_BodyInterface_GetGravityFactor(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Get transform and shape for this body, used to perform collision detection + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_BodyInterface_GetTransformedShape(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Get the user data for a body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetUserData", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong JPH_BodyInterface_GetUserData(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + /// Get the material for a particular sub shape + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetMaterial", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_BodyInterface_GetMaterial(JPH_BodyInterface* @this, JPH_BodyID* inBodyID, JPH_SubShapeID* inSubShapeID); + + /// Set the Body::EFlags::InvalidateContactCache flag for the specified body. This means that the collision cache is invalid for any body pair involving that body until the next physics step. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_InvalidateContactCache", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyInterface_InvalidateContactCache(JPH_BodyInterface* @this, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_GetBaseClassCount", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_RTTI_GetBaseClassCount(JPH_RTTI* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_GetBaseClass", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_RTTI_GetBaseClass(JPH_RTTI* @this, int inIdx); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_GetHash", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_RTTI_GetHash(JPH_RTTI* @this); + + /// Create an object of this type (returns nullptr if the object is abstract) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_CreateObject", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_RTTI_CreateObject(JPH_RTTI* @this); + + /// Destruct object of this type (does nothing if the object is abstract) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_DestructObject", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RTTI_DestructObject(JPH_RTTI* @this, void* inObject); + + /// Add base class + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_AddBaseClass", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RTTI_AddBaseClass(JPH_RTTI* @this, JPH_RTTI* inRTTI, int inOffset); + + /// Test if this class is derived from class of type inRTTI + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_IsKindOf", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_RTTI_IsKindOf(JPH_RTTI* @this, JPH_RTTI* inRTTI); + + /// Cast inObject of this type to object of type inRTTI, returns nullptr if the cast is unsuccessful + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_RTTI_CastTo(JPH_RTTI* @this, void* inObject, JPH_RTTI* inRTTI); + + /// Attribute access + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_AddAttribute", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RTTI_AddAttribute(JPH_RTTI* @this, JPH_SerializableAttribute* inAttribute); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_GetAttributeCount", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_RTTI_GetAttributeCount(JPH_RTTI* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_GetAttribute", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_SerializableAttribute* JPH_RTTI_GetAttribute(JPH_RTTI* @this, int inIdx); + + /// Constructor + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_RTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RTTI_RTTI(JPH_RTTI* @this, byte* inName, int inSize, delegate* unmanaged[Cdecl] inCreateObject, delegate* unmanaged[Cdecl] inDestructObject); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RTTI_RTTI1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RTTI_RTTI1(JPH_RTTI* @this, byte* inName, int inSize, delegate* unmanaged[Cdecl] inCreateObject, delegate* unmanaged[Cdecl] inDestructObject, delegate* unmanaged[Cdecl] inCreateRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType(byte* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData(JPH_IObjectStreamIn* ioStream, byte* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType(JPH_IObjectStreamOut* ioStream, byte* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData(JPH_IObjectStreamOut* ioStream, byte* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType1(ushort* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData1(JPH_IObjectStreamIn* ioStream, ushort* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType1(JPH_IObjectStreamOut* ioStream, ushort* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData1(JPH_IObjectStreamOut* ioStream, ushort* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType2(int* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData2(JPH_IObjectStreamIn* ioStream, int* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType2(JPH_IObjectStreamOut* ioStream, int* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData2(JPH_IObjectStreamOut* ioStream, int* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType3(uint* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData3(JPH_IObjectStreamIn* ioStream, uint* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType3(JPH_IObjectStreamOut* ioStream, uint* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData3(JPH_IObjectStreamOut* ioStream, uint* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType4(ulong* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData4(JPH_IObjectStreamIn* ioStream, ulong* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType4(JPH_IObjectStreamOut* ioStream, ulong* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData4(JPH_IObjectStreamOut* ioStream, ulong* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType5", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType5(float* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData5", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData5(JPH_IObjectStreamIn* ioStream, float* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType5", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType5(JPH_IObjectStreamOut* ioStream, float* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData5", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData5(JPH_IObjectStreamOut* ioStream, float* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType6", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType6(bool* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData6", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData6(JPH_IObjectStreamIn* ioStream, bool* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType6", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType6(JPH_IObjectStreamOut* ioStream, bool* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData6", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData6(JPH_IObjectStreamOut* ioStream, bool* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType7", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType7(std_basic_string* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData7", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData7(JPH_IObjectStreamIn* ioStream, std_basic_string* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType7", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType7(JPH_IObjectStreamOut* ioStream, std_basic_string* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData7", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData7(JPH_IObjectStreamOut* ioStream, std_basic_string* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType8", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType8(JPH_Float3* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData8", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData8(JPH_IObjectStreamIn* ioStream, JPH_Float3* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType8", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType8(JPH_IObjectStreamOut* ioStream, JPH_Float3* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData8", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData8(JPH_IObjectStreamOut* ioStream, JPH_Float3* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType9", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType9(JPH_Vec3* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData9", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData9(JPH_IObjectStreamIn* ioStream, JPH_Vec3* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType9", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType9(JPH_IObjectStreamOut* ioStream, JPH_Vec3* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData9", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData9(JPH_IObjectStreamOut* ioStream, JPH_Vec3* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType10", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType10(JPH_Vec4* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData10", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData10(JPH_IObjectStreamIn* ioStream, JPH_Vec4* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType10", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType10(JPH_IObjectStreamOut* ioStream, JPH_Vec4* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData10", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData10(JPH_IObjectStreamOut* ioStream, JPH_Vec4* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType11", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType11(JPH_Quat* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData11", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData11(JPH_IObjectStreamIn* ioStream, JPH_Quat* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType11", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType11(JPH_IObjectStreamOut* ioStream, JPH_Quat* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData11", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData11(JPH_IObjectStreamOut* ioStream, JPH_Quat* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType12", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType12(JPH_Mat44* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData12", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData12(JPH_IObjectStreamIn* ioStream, JPH_Mat44* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType12", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType12(JPH_IObjectStreamOut* ioStream, JPH_Mat44* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData12", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData12(JPH_IObjectStreamOut* ioStream, JPH_Mat44* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType13", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType13(double* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData13", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData13(JPH_IObjectStreamIn* ioStream, double* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType13", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType13(JPH_IObjectStreamOut* ioStream, double* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData13", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData13(JPH_IObjectStreamOut* ioStream, double* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType14", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType14(JPH_DVec3* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData14", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData14(JPH_IObjectStreamIn* ioStream, JPH_DVec3* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType14", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType14(JPH_IObjectStreamOut* ioStream, JPH_DVec3* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData14", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData14(JPH_IObjectStreamOut* ioStream, JPH_DVec3* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType15", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType15(JPH_DMat44* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData15", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData15(JPH_IObjectStreamIn* ioStream, JPH_DMat44* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType15", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType15(JPH_IObjectStreamOut* ioStream, JPH_DMat44* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData15", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData15(JPH_IObjectStreamOut* ioStream, JPH_DMat44* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSIsType16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSIsType16(JPH_Double3* arg1, int inArrayDepth, int inDataType, byte* inClassName); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSReadData16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OSReadData16(JPH_IObjectStreamIn* ioStream, JPH_Double3* outPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteDataType16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteDataType16(JPH_IObjectStreamOut* ioStream, JPH_Double3* arg1); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OSWriteData16", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OSWriteData16(JPH_IObjectStreamOut* ioStream, JPH_Double3* inPrimitive); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SerializableObject_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SerializableObject_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SerializableObject_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_SerializableObject_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SerializableObject_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_SerializableObject_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Using eigendecomposition, decompose the inertia tensor into a diagonal matrix D and a right-handed rotation matrix R so that the inertia tensor is \\f$R \\: D \\: R^{-1}\\f$. @see https://en.wikipedia.org/wiki/Moment_of_inertia section 'Principal axes' @param outRotation The rotation matrix R @param outDiagonal The diagonal of the diagonal matrix D @return True if successful, false if failed + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_DecomposePrincipalMomentsOfInertia", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_MassProperties_DecomposePrincipalMomentsOfInertia(JPH_MassProperties* @this, JPH_Mat44* outRotation, JPH_Vec3* outDiagonal); + + /// Set the mass and inertia of a box with edge size inBoxSize and density inDensity + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_SetMassAndInertiaOfSolidBox", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_SetMassAndInertiaOfSolidBox(JPH_MassProperties* @this, JPH_Vec3 inBoxSize, float inDensity); + + /// Set the mass and scale the inertia tensor to match the mass + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_ScaleToMass", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_ScaleToMass(JPH_MassProperties* @this, float inMass); + + /// Calculates the size of the solid box that has an inertia tensor diagonal inInertiaDiagonal + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_sGetEquivalentSolidBoxSize", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_MassProperties_sGetEquivalentSolidBoxSize(float inMass, JPH_Vec3 inInertiaDiagonal); + + /// Rotate the inertia by 3x3 matrix inRotation + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_Rotate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_Rotate(JPH_MassProperties* @this, JPH_Mat44* inRotation); + + /// Translate the inertia by a vector inTranslation + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_Translate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_Translate(JPH_MassProperties* @this, JPH_Vec3 inTranslation); + + /// Scale the mass and inertia by inScale, note that elements can be < 0 to flip the shape + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_Scale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_Scale(JPH_MassProperties* @this, JPH_Vec3 inScale); + + /// Saves the state of this object in binary form to inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_SaveBinaryState(JPH_MassProperties* @this, JPH_StreamOut* inStream); + + /// Restore the state of this object from inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MassProperties_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MassProperties_RestoreBinaryState(JPH_MassProperties* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_ShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + /// Scale this shape. Note that not all shapes support all scales, this will return a shape that matches the scale as accurately as possible. @param inScale The scale to use for this shape (note: this scale is applied to the entire shape in the space it was created, most function apply the scale in the space of the leaf shapes and from the center of mass!) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_ScaleShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_Shape_ScaleShape(JPH_Shape* @this, JPH_Vec3 inScale); + + /// Creates a Shape of the correct type and restores its contents from the binary stream inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_sRestoreFromBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_Shape_sRestoreFromBinaryState(JPH_StreamIn* inStream); + + /// Save this shape, all its children and its materials. Pass in an empty map in ioShapeMap / ioMaterialMap or reuse the same map while saving multiple shapes to the same stream in order to avoid writing duplicates. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_SaveWithChildren", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Shape_SaveWithChildren(JPH_Shape* @this, JPH_StreamOut* inStream, std_unordered_map* ioShapeMap, std_unordered_map* ioMaterialMap); + + /// Restore a shape, all its children and materials. Pass in an empty map in ioShapeMap / ioMaterialMap or reuse the same map while reading multiple shapes from the same stream in order to restore duplicates. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_sRestoreWithChildren", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_Shape_sRestoreWithChildren(JPH_StreamIn* inStream, std_vector* ioShapeMap, std_vector* ioMaterialMap); + + /// Get the direct child sub shape and its transform for a sub shape ID. @param inSubShapeID Sub shape ID that indicates the path to the leaf shape @param inPositionCOM The position of the center of mass of this shape @param inRotation The orientation of this shape @param inScale Scale of this shape @param outRemainder The remainder of the sub shape ID after removing the sub shape @return Direct child sub shape and its transform, note that the body ID and sub shape ID will be invalid + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_GetSubShapeTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_Shape_GetSubShapeTransformedShape(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeID* outRemainder); + + /// Collect the leaf transformed shapes of all leaf shapes of this shape. inBox is the world space axis aligned box which leaf shapes should collide with. inPositionCOM/inRotation/inScale describes the transform of this shape. inSubShapeIDCeator represents the current sub shape ID of this shape. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Shape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// Transforms this shape and all of its children with inTransform, resulting shape(s) are passed to ioCollector. Note that not all shapes support all transforms (especially true for scaling), the resulting shape will try to match the transform as accurately as possible. @param inCenterOfMassTransform The transform (rotation, translation, scale) that the center of mass of the shape should get @param ioCollector The transformed shapes will be passed to this collector + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Shape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + /// Saves the contents of the shape in binary form to inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Shape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + /// Get the combined stats of this shape and its children. @param ioVisitedShapes is used to track which shapes have already been visited, to avoid calculating the wrong memory size. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_GetStatsRecursive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_Shape_GetStatsRecursive(void* @this, std_unordered_set* ioVisitedShapes); + + /// This function should not be called directly, it is used by sRestoreFromBinaryState. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Shape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Shape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_GroupFilter_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Creates a GroupFilter of the correct type and restores its contents from the binary stream inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_sRestoreFromBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_GroupFilter_sRestoreFromBinaryState(JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_GroupFilter_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_GroupFilter_CastTo(void* @this, JPH_RTTI* inRTTI); + + /// Saves the contents of the group filter in binary form to inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_GroupFilter_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + /// This function should not be called directly, it is used by sRestoreFromBinaryState. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_GroupFilter_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_GroupFilter_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CollisionGroup_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CollisionGroup_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Saves the state of this object in binary form to inStream. Does not save group filter. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CollisionGroup_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CollisionGroup_SaveBinaryState(JPH_CollisionGroup* @this, JPH_StreamOut* inStream); + + /// Restore the state of this object from inStream. Does not save group filter. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CollisionGroup_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CollisionGroup_RestoreBinaryState(JPH_CollisionGroup* @this, JPH_StreamIn* inStream); + + /// Cast a ray and find the closest hit. Returns true if it finds a hit. Hits further than ioHit.mFraction will not be considered and in this case ioHit will remain unmodified (and the function will return false). Convex objects will be treated as solid (meaning if the ray starts inside, you'll get a hit fraction of 0) and back face hits are returned. If you want the surface normal of the hit use GetWorldSpaceSurfaceNormal(ioHit.mSubShapeID2, inRay.GetPointOnRay(ioHit.mFraction)) on this object. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_TransformedShape_CastRay(JPH_TransformedShape* @this, JPH_RRayCast* inRay, JPH_RayCastResult* ioHit); + + /// Cast a ray, allows collecting multiple hits. Note that this version is more flexible but also slightly slower than the CastRay function that returns only a single hit. If you want the surface normal of the hit use GetWorldSpaceSurfaceNormal(collected sub shape ID, inRay.GetPointOnRay(collected fraction)) on this object. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_CastRay1(JPH_TransformedShape* @this, JPH_RRayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// Check if inPoint is inside any shapes. For this tests all shapes are treated as if they were solid. For a mesh shape, this test will only provide sensible information if the mesh is a closed manifold. For each shape that collides, ioCollector will receive a hit + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_CollidePoint(JPH_TransformedShape* @this, JPH_Vec3 inPoint, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// Collide a shape and report any hits to ioCollector @param inShape Shape to test @param inShapeScale Scale in local space of shape @param inCenterOfMassTransform Center of mass transform for the shape @param inCollideShapeSettings Settings @param inBaseOffset All hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. mShapePositionCOM since floats are most accurate near the origin @param ioCollector Collector that receives the hits @param inShapeFilter Filter that allows you to reject collisions + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CollideShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_CollideShape(JPH_TransformedShape* @this, JPH_Shape* inShape, JPH_Vec3 inShapeScale, JPH_Mat44* inCenterOfMassTransform, JPH_CollideShapeSettings* inCollideShapeSettings, JPH_Vec3 inBaseOffset, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// Cast a shape and report any hits to ioCollector @param inShapeCast The shape cast and its position and direction @param inShapeCastSettings Settings for the shape cast @param inBaseOffset All hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. mShapePositionCOM or inShapeCast.mCenterOfMassStart.GetTranslation() since floats are most accurate near the origin @param ioCollector Collector that receives the hits @param inShapeFilter Filter that allows you to reject collisions + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CastShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_CastShape(JPH_TransformedShape* @this, JPH_RShapeCast* inShapeCast, JPH_ShapeCastSettings* inShapeCastSettings, JPH_Vec3 inBaseOffset, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// Collect the leaf transformed shapes of all leaf shapes of this shape inBox is the world space axis aligned box which leaf shapes should collide with + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_CollectTransformedShapes(JPH_TransformedShape* @this, JPH_AABox* inBox, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// To start iterating over triangles, call this function first. To get the actual triangles call GetTrianglesNext. @param ioContext A temporary buffer and should remain untouched until the last call to GetTrianglesNext. @param inBox The world space bounding in which you want to get the triangles. @param inBaseOffset All hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. inBox.GetCenter() since floats are most accurate near the origin + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TransformedShape_GetTrianglesStart(JPH_TransformedShape* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inBaseOffset); + + /// Call this repeatedly to get all triangles in the box. outTriangleVertices should be large enough to hold 3 * inMaxTriangleRequested entries outMaterials (if it is not null) should contain inMaxTrianglesRequested entries The function returns the amount of triangles that it found (which will be <= inMaxTrianglesRequested), or 0 if there are no more triangles. Note that the function can return a value < inMaxTrianglesRequested and still have more triangles to process (triangles can be returned in blocks) Note that the function may return triangles outside of the requested box, only coarse culling is performed on the returned triangles + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TransformedShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_TransformedShape_GetTrianglesNext(JPH_TransformedShape* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MotionProperties_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MotionProperties_SaveState(JPH_MotionProperties* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MotionProperties_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MotionProperties_RestoreState(JPH_MotionProperties* @this, JPH_StateRecorder* inStream); + + /// Create a formatted text string for debugging purposes. Note that this function has an internal buffer of 1024 characters, so long strings will be trimmed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StringFormat", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern std_basic_string JPH_StringFormat(byte* inFMT); + + /// Converts the lower 4 bits of inNibble to a string that represents the number in binary format + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NibbleToBinary", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern byte* JPH_NibbleToBinary(uint inNibble); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_SetMotionType", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_SetMotionType(JPH_Body* @this, byte inMotionType); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_SetAllowSleeping", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_SetAllowSleeping(JPH_Body* @this, [MarshalAs(UnmanagedType.U1)] bool inAllow); + + /// Set velocity of body such that it will be positioned at inTargetPosition/Rotation in inDeltaTime seconds. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_MoveKinematic", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_MoveKinematic(JPH_Body* @this, JPH_Vec3 inTargetPosition, JPH_Quat inTargetRotation, float inDeltaTime); + + /// Applies an impulse to the body that simulates fluid buoyancy and drag @param inSurfacePosition Position on the fluid surface in world space @param inSurfaceNormal Normal of the fluid surface (should point up) @param inBuoyancy The buoyancy factor for the body. 1 = neutral body, < 1 sinks, > 1 floats. Note that we don't use the fluid density since it is harder to configure than a simple number between [0, 2] @param inLinearDrag Linear drag factor that slows down the body when in the fluid (approx. 0.5) @param inAngularDrag Angular drag factor that slows down rotation when the body is in the fluid (approx. 0.01) @param inFluidVelocity The average velocity of the fluid (in m/s) in which the body resides @param inGravity The graviy vector (pointing down) @param inDeltaTime Delta time of the next simulation step (in s) @return true if an impulse was applied, false if the body was not in the fluid + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_ApplyBuoyancyImpulse", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_Body_ApplyBuoyancyImpulse(JPH_Body* @this, JPH_Vec3 inSurfacePosition, JPH_Vec3 inSurfaceNormal, float inBuoyancy, float inLinearDrag, float inAngularDrag, JPH_Vec3 inFluidVelocity, JPH_Vec3 inGravity, float inDeltaTime); + + /// Debug function to convert a body back to a body creation settings object to be able to save/recreate the body later + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_GetBodyCreationSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyCreationSettings JPH_Body_GetBodyCreationSettings(JPH_Body* @this); + + /// Updates world space bounding box (should only be called by the PhysicsSystem) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_CalculateWorldSpaceBoundsInternal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_CalculateWorldSpaceBoundsInternal(JPH_Body* @this); + + /// Function to update body's position (should only be called by the BodyInterface since it also requires updating the broadphase) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_SetPositionAndRotationInternal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_SetPositionAndRotationInternal(JPH_Body* @this, JPH_Vec3 inPosition, JPH_Quat inRotation); + + /// Updates the center of mass and optionally mass propertes after shifting the center of mass or changes to the shape (should only be called by the BodyInterface since it also requires updating the broadphase) @param inPreviousCenterOfMass Center of mass of the shape before the alterations @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_UpdateCenterOfMassInternal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_UpdateCenterOfMassInternal(JPH_Body* @this, JPH_Vec3 inPreviousCenterOfMass, [MarshalAs(UnmanagedType.U1)] bool inUpdateMassProperties); + + /// Function to update a body's shape (should only be called by the BodyInterface since it also requires updating the broadphase) @param inShape The new shape for this body @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_SetShapeInternal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_SetShapeInternal(JPH_Body* @this, JPH_Shape* inShape, [MarshalAs(UnmanagedType.U1)] bool inUpdateMassProperties); + + /// Update eligibility for sleeping + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_UpdateSleepStateInternal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_Body_UpdateSleepStateInternal(JPH_Body* @this, float inDeltaTime, float inMaxMovement, float inTimeBeforeSleep); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_SaveState(JPH_Body* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Body_RestoreState(JPH_Body* @this, JPH_StateRecorder* inStream); + + /// Initialize the manager + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_Init(JPH_BodyManager* @this, uint inMaxBodies, uint inNumBodyMutexes, JPH_BroadPhaseLayerInterface* inLayerInterface); + + /// Gets the current amount of bodies that are in the body manager + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_GetNumBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_BodyManager_GetNumBodies(JPH_BodyManager* @this); + + /// Get stats about the bodies in the body manager (slow, iterates through all bodies) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_GetBodyStats", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyManager_BodyStats JPH_BodyManager_GetBodyStats(JPH_BodyManager* @this); + + /// Create a body using creation settings. The returned body will not be part of the body manager yet. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_AllocateBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Body* JPH_BodyManager_AllocateBody(JPH_BodyManager* @this, JPH_BodyCreationSettings* inBodyCreationSettings); + + /// Free a body that has not been added to the body manager yet (if it has, use DestroyBodies). + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_FreeBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_FreeBody(JPH_BodyManager* @this, JPH_Body* inBody); + + /// Add a body to the body manager, assigning it the next available ID. Returns false if no more IDs are available. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_AddBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyManager_AddBody(JPH_BodyManager* @this, JPH_Body* ioBody); + + /// Add a body to the body manager, assigning it a custom ID. Returns false if the ID is not valid. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_AddBodyWithCustomID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyManager_AddBodyWithCustomID(JPH_BodyManager* @this, JPH_Body* ioBody, JPH_BodyID* inBodyID); + + /// Remove a list of bodies from the body manager + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_RemoveBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_RemoveBodies(JPH_BodyManager* @this, JPH_BodyID* inBodyIDs, int inNumber, JPH_Body** outBodies); + + /// Remove a set of bodies from the body manager and frees them. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_DestroyBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_DestroyBodies(JPH_BodyManager* @this, JPH_BodyID* inBodyIDs, int inNumber); + + /// Activate a list of bodies. This function should only be called when an exclusive lock for the bodies are held. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_ActivateBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_ActivateBodies(JPH_BodyManager* @this, JPH_BodyID* inBodyIDs, int inNumber); + + /// Deactivate a list of bodies. This function should only be called when an exclusive lock for the bodies are held. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_DeactivateBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_DeactivateBodies(JPH_BodyManager* @this, JPH_BodyID* inBodyIDs, int inNumber); + + /// Update the motion quality for a body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_SetMotionQuality", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_SetMotionQuality(JPH_BodyManager* @this, JPH_Body* ioBody, byte inMotionQuality); + + /// Get copy of the list of active bodies under protection of a lock. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_GetActiveBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_GetActiveBodies(JPH_BodyManager* @this, std_vector* outBodyIDs); + + /// Listener that is notified whenever a body is activated/deactivated + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_SetBodyActivationListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_SetBodyActivationListener(JPH_BodyManager* @this, JPH_BodyActivationListener* inListener); + + /// Get all body IDs under the protection of a lock + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_GetBodyIDs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_GetBodyIDs(JPH_BodyManager* @this, std_vector* outBodies); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_GetMutexMask", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong JPH_BodyManager_GetMutexMask(JPH_BodyManager* @this, JPH_BodyID* inBodies, int inNumber); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_LockRead", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_LockRead(JPH_BodyManager* @this, ulong inMutexMask); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_UnlockRead", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_UnlockRead(JPH_BodyManager* @this, ulong inMutexMask); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_LockWrite", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_LockWrite(JPH_BodyManager* @this, ulong inMutexMask); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_UnlockWrite", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_UnlockWrite(JPH_BodyManager* @this, ulong inMutexMask); + + /// Lock all bodies. This should only be done during PhysicsSystem::Update(). + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_LockAllBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_LockAllBodies(JPH_BodyManager* @this); + + /// Unlock all bodies. This should only be done during PhysicsSystem::Update(). + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_UnlockAllBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_UnlockAllBodies(JPH_BodyManager* @this); + + /// Set the Body::EFlags::InvalidateContactCache flag for the specified body. This means that the collision cache is invalid for any body pair involving that body until the next physics step. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_InvalidateContactCacheForBody", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_InvalidateContactCacheForBody(JPH_BodyManager* @this, JPH_Body* ioBody); + + /// Reset the Body::EFlags::InvalidateContactCache flag for all bodies. All contact pairs in the contact cache will now by valid again. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_ValidateContactCacheForAllBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_ValidateContactCacheForAllBodies(JPH_BodyManager* @this); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyManager_SaveState(JPH_BodyManager* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay. Returns false if failed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyManager_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BodyManager_RestoreState(JPH_BodyManager* @this, JPH_StateRecorder* inStream); + + /// Initialize the broadphase. @param inBodyManager The body manager singleton @param inLayerInterface Interface that maps object layers to broadphase layers. Note that the broadphase takes a pointer to the data inside inObjectToBroadPhaseLayer so this object should remain static. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BroadPhase_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BroadPhase_Init(void* @this, JPH_BodyManager* inBodyManager, JPH_BroadPhaseLayerInterface* inLayerInterface); + + /// Cast a ray and find the closest hit. Returns true if it finds a hit. Hits further than ioHit.mFraction will not be considered and in this case ioHit will remain unmodified (and the function will return false). Convex objects will be treated as solid (meaning if the ray starts inside, you'll get a hit fraction of 0) and back face hits against triangles are returned. If you want the surface normal of the hit use Body::GetWorldSpaceSurfaceNormal(ioHit.mSubShapeID2, inRay.GetPointOnRay(ioHit.mFraction)) on body with ID ioHit.mBodyID. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_NarrowPhaseQuery_CastRay(JPH_NarrowPhaseQuery* @this, JPH_RRayCast* inRay, JPH_RayCastResult* ioHit, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter); + + /// Cast a ray, allows collecting multiple hits. Note that this version is more flexible but also slightly slower than the CastRay function that returns only a single hit. If you want the surface normal of the hit use Body::GetWorldSpaceSurfaceNormal(collected sub shape ID, inRay.GetPointOnRay(collected fraction)) on body with collected body ID. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_NarrowPhaseQuery_CastRay1(JPH_NarrowPhaseQuery* @this, JPH_RRayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_CollisionCollector* ioCollector, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter, JPH_ShapeFilter* inShapeFilter); + + /// Check if inPoint is inside any shapes. For this tests all shapes are treated as if they were solid. For a mesh shape, this test will only provide sensible information if the mesh is a closed manifold. For each shape that collides, ioCollector will receive a hit + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_NarrowPhaseQuery_CollidePoint(JPH_NarrowPhaseQuery* @this, JPH_Vec3 inPoint, JPH_CollisionCollector* ioCollector, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter, JPH_ShapeFilter* inShapeFilter); + + /// Collide a shape with the system @param inShape Shape to test @param inShapeScale Scale in local space of shape @param inCenterOfMassTransform Center of mass transform for the shape @param inCollideShapeSettings Settings @param inBaseOffset All hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. inCenterOfMassTransform.GetTranslation() since floats are most accurate near the origin @param ioCollector Collector that receives the hits @param inBroadPhaseLayerFilter Filter that filters at broadphase level @param inObjectLayerFilter Filter that filters at layer level @param inBodyFilter Filter that filters at body level @param inShapeFilter Filter that filters at shape level + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CollideShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_NarrowPhaseQuery_CollideShape(JPH_NarrowPhaseQuery* @this, JPH_Shape* inShape, JPH_Vec3 inShapeScale, JPH_Mat44* inCenterOfMassTransform, JPH_CollideShapeSettings* inCollideShapeSettings, JPH_Vec3 inBaseOffset, JPH_CollisionCollector* ioCollector, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter, JPH_ShapeFilter* inShapeFilter); + + /// Cast a shape and report any hits to ioCollector @param inShapeCast The shape cast and its position and direction @param inShapeCastSettings Settings for the shape cast @param inBaseOffset All hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. inShapeCast.mCenterOfMassStart.GetTranslation() since floats are most accurate near the origin @param ioCollector Collector that receives the hits @param inBroadPhaseLayerFilter Filter that filters at broadphase level @param inObjectLayerFilter Filter that filters at layer level @param inBodyFilter Filter that filters at body level @param inShapeFilter Filter that filters at shape level + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CastShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_NarrowPhaseQuery_CastShape(JPH_NarrowPhaseQuery* @this, JPH_RShapeCast* inShapeCast, JPH_ShapeCastSettings* inShapeCastSettings, JPH_Vec3 inBaseOffset, JPH_CollisionCollector* ioCollector, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter, JPH_ShapeFilter* inShapeFilter); + + /// Collect all leaf transformed shapes that fall inside world space box inBox + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_NarrowPhaseQuery_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_NarrowPhaseQuery_CollectTransformedShapes(JPH_NarrowPhaseQuery* @this, JPH_AABox* inBox, JPH_CollisionCollector* ioCollector, JPH_BroadPhaseLayerFilter* inBroadPhaseLayerFilter, JPH_ObjectLayerFilter* inObjectLayerFilter, JPH_BodyFilter* inBodyFilter, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsMaterial_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Creates a PhysicsMaterial of the correct type and restores its contents from the binary stream inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_sRestoreFromBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_PhysicsMaterial_sRestoreFromBinaryState(JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_PhysicsMaterial_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_PhysicsMaterial_CastTo(void* @this, JPH_RTTI* inRTTI); + + /// Saves the contents of the material in binary form to inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsMaterial_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + /// This function should not be called directly, it is used by sRestoreFromBinaryState. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsMaterial_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsMaterial_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_ConvexShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ConvexShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConvexShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_ConvexShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_SaveMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_SaveMaterialState(void* @this, std_vector* outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_RestoreMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_RestoreMaterialState(void* @this, JPH_RefConst* inMaterials, uint inNumMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + /// Saving / restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedContactPoint_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedContactPoint_SaveState(JPH_ContactConstraintManager_CachedContactPoint* @this, JPH_StateRecorder* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedContactPoint_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedContactPoint_RestoreState(JPH_ContactConstraintManager_CachedContactPoint* @this, JPH_StateRecorder* inStream); + + /// Saving / restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedManifold_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedManifold_SaveState(JPH_ContactConstraintManager_CachedManifold* @this, JPH_StateRecorder* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedManifold_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedManifold_RestoreState(JPH_ContactConstraintManager_CachedManifold* @this, JPH_StateRecorder* inStream); + + /// Saving / restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedBodyPair_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedBodyPair_SaveState(JPH_ContactConstraintManager_CachedBodyPair* @this, JPH_StateRecorder* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_CachedBodyPair_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_CachedBodyPair_RestoreState(JPH_ContactConstraintManager_CachedBodyPair* @this, JPH_StateRecorder* inStream); + + /// Initialize the cache + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_Init(JPH_ContactConstraintManager_ManifoldCache* @this, uint inMaxBodyPairs, uint inMaxContactConstraints, uint inCachedManifoldsSize); + + /// Reset all entries from the cache + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Clear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_Clear(JPH_ContactConstraintManager_ManifoldCache* @this); + + /// Prepare cache before creating new contacts. inExpectedNumBodyPairs / inExpectedNumManifolds are the amount of body pairs / manifolds found in the previous step and is used to determine the amount of buckets the contact cache hash map will use. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Prepare", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_Prepare(JPH_ContactConstraintManager_ManifoldCache* @this, uint inExpectedNumBodyPairs, uint inExpectedNumManifolds); + + /// Find / create cached entry for SubShapeIDPair -> CachedManifold + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Find", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern KeyValue* JPH_ContactConstraintManager_ManifoldCache_Find(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_SubShapeIDPair* inKey, ulong inKeyHash); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern KeyValue* JPH_ContactConstraintManager_ManifoldCache_Create(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_SubShapeIDPair* inKey, ulong inKeyHash, int inNumContactPoints); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_FindOrCreate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern std_pair JPH_ContactConstraintManager_ManifoldCache_FindOrCreate(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_SubShapeIDPair* inKey, ulong inKeyHash, int inNumContactPoints); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_ToHandle", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_ContactConstraintManager_ManifoldCache_ToHandle(JPH_ContactConstraintManager_ManifoldCache* @this, KeyValue* inKeyValue); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_FromHandle", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern KeyValue* JPH_ContactConstraintManager_ManifoldCache_FromHandle(JPH_ContactConstraintManager_ManifoldCache* @this, uint inHandle); + + /// Find / create entry for BodyPair -> CachedBodyPair + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Find1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern KeyValue* JPH_ContactConstraintManager_ManifoldCache_Find1(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_BodyPair* inKey, ulong inKeyHash); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_Create1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern KeyValue* JPH_ContactConstraintManager_ManifoldCache_Create1(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_BodyPair* inKey, ulong inKeyHash); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_GetAllBodyPairsSorted", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_GetAllBodyPairsSorted(JPH_ContactConstraintManager_ManifoldCache* @this, std_vector* outAll); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_GetAllManifoldsSorted", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_GetAllManifoldsSorted(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactConstraintManager_CachedBodyPair* inBodyPair, std_vector* outAll); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_GetAllCCDManifoldsSorted", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_GetAllCCDManifoldsSorted(JPH_ContactConstraintManager_ManifoldCache* @this, std_vector* outAll); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_ContactPointRemovedCallbacks", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_ContactPointRemovedCallbacks(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactListener* inListener); + + /// Saving / restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ManifoldCache_SaveState(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_StateRecorder* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ManifoldCache_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_ManifoldCache_RestoreState(JPH_ContactConstraintManager_ManifoldCache* @this, JPH_ContactConstraintManager_ManifoldCache* inReadCache, JPH_StateRecorder* inStream); + + /// Calculate constraint properties below + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_WorldContactPoint_CalculateNonPenetrationConstraintProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_WorldContactPoint_CalculateNonPenetrationConstraintProperties(JPH_ContactConstraintManager_WorldContactPoint* @this, float inDeltaTime, JPH_Body* inBody1, JPH_Body* inBody2, JPH_Vec3 inWorldSpacePosition1, JPH_Vec3 inWorldSpacePosition2, JPH_Vec3 inWorldSpaceNormal); + + /// Initialize the system. @param inMaxBodyPairs Maximum amount of body pairs to process (anything else will fall through the world), this number should generally be much higher than the max amount of contact points as there will be lots of bodies close that are not actually touching @param inMaxContactConstraints Maximum amount of contact constraints to process (anything else will fall through the world) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_Init(JPH_ContactConstraintManager* @this, uint inMaxBodyPairs, uint inMaxContactConstraints); + + /// Sets up the constraint buffer. Should be called before starting collision detection. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_PrepareConstraintBuffer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_PrepareConstraintBuffer(JPH_ContactConstraintManager* @this, JPH_PhysicsUpdateContext* inContext); + + /// Check if the contact points from the previous frame are reusable and if so copy them. When the cache was usable and the pair has been handled: outPairHandled = true. When a contact constraint was produced: outConstraintCreated = true. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_GetContactsFromCache", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_GetContactsFromCache(JPH_ContactConstraintManager* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_Body* inBody1, JPH_Body* inBody2, bool* outPairHandled, bool* outConstraintCreated); + + /// Create a handle for a colliding body pair so that contact constraints can be added between them. Needs to be called once per body pair per frame before calling AddContactConstraint. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_AddBodyPair", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ContactConstraintManager_AddBodyPair(JPH_ContactConstraintManager* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_Body* inBody1, JPH_Body* inBody2); + + /// Add a contact constraint for this frame. @param ioContactAllocator The allocator that reserves memory for the contacts @param inBodyPair The handle for the contact cache for this body pair @param inBody1 The first body that is colliding @param inBody2 The second body that is colliding @param inManifold The manifold that describes the collision @return true if a contact constraint was created (can be false in the case of a sensor) This is using the approach described in 'Modeling and Solving Constraints' by Erin Catto presented at GDC 2009 (and later years with slight modifications). We're using the formulas from slide 50 - 53 combined. Euler velocity integration: v1' = v1 + M^-1 P Impulse: P = J^T lambda Constraint force: lambda = -K^-1 J v1 Inverse effective mass: K = J M^-1 J^T Constraint equation (limits movement in 1 axis): C = (p2 - p1) . n Jacobian (for position constraint) J = [-n, -r1 x n, n, r2 x n] n = contact normal (pointing away from body 1). p1, p2 = positions of collision on body 1 and 2. r1, r2 = contact point relative to center of mass of body 1 and body 2 (r1 = p1 - x1, r2 = p2 - x2). v1, v2 = (linear velocity, angular velocity): 6 vectors containing linear and angular velocity for body 1 and 2. M = mass matrix, a diagonal matrix of the mass and inertia with diagonal [m1, I1, m2, I2]. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_AddContactConstraint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_AddContactConstraint(JPH_ContactConstraintManager* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, void* inBodyPair, JPH_Body* inBody1, JPH_Body* inBody2, JPH_ContactManifold* inManifold); + + /// Finalizes the contact cache, the contact cache that was generated during the calls to AddContactConstraint in this update will be used from now on to read from. After finalizing the contact cache, the contact removed callbacks will be called. inExpectedNumBodyPairs / inExpectedNumManifolds are the amount of body pairs / manifolds found in the previous step and is used to determine the amount of buckets the contact cache hash map will use in the next update. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_FinalizeContactCacheAndCallContactPointRemovedCallbacks", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_FinalizeContactCacheAndCallContactPointRemovedCallbacks(JPH_ContactConstraintManager* @this, uint inExpectedNumBodyPairs, uint inExpectedNumManifolds); + + /// Check if 2 bodies were in contact during the last simulation step. Since contacts are only detected between active bodies, at least one of the bodies must be active. Uses the read collision cache to determine if 2 bodies are in contact. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_WereBodiesInContact", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_WereBodiesInContact(JPH_ContactConstraintManager* @this, JPH_BodyID* inBody1ID, JPH_BodyID* inBody2ID); + + /// Sort contact constraints deterministically + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_SortContacts", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_SortContacts(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd); + + /// AddContactConstraint will also setup the velocity constraints for the first sub step. For subsequent sub steps this function must be called prior to warm starting the constraint. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_SetupVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_SetupVelocityConstraints(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inDeltaTime); + + /// Apply last frame's impulses as an initial guess for this frame's impulses + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_WarmStartVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_WarmStartVelocityConstraints(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inWarmStartImpulseRatio); + + /// Solve velocity constraints, when almost nothing changes this should only apply very small impulses since we're warm starting with the total impulse applied in the last frame above. Friction wise we're using the Coulomb friction model which says that: |F_T| <= mu |F_N| Where F_T is the tangential force, F_N is the normal force and mu is the friction coefficient In impulse terms this becomes: |lambda_T| <= mu |lambda_N| And the constraint that needs to be applied is exactly the same as a non penetration constraint except that we use a tangent instead of a normal. The tangent should point in the direction of the tangential velocity of the point: J = [-T, -r1 x T, T, r2 x T] Where T is the tangent. See slide 42 and 43. Restitution is implemented as a velocity bias (see slide 41): b = e v_n^- e = the restitution coefficient, v_n^- is the normal velocity prior to the collision Restitution is only applied when v_n^- is large enough and the points are moving towards collision + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_SolveVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_SolveVelocityConstraints(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd); + + /// Save back the lambdas to the contact cache for the next warm start + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_StoreAppliedImpulses", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_StoreAppliedImpulses(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd); + + /// Solve position constraints. This is using the approach described in 'Modeling and Solving Constraints' by Erin Catto presented at GDC 2007. On slide 78 it is suggested to split up the Baumgarte stabilization for positional drift so that it does not actually add to the momentum. We combine an Euler velocity integrate + a position integrate and then discard the velocity change. Constraint force: lambda = -K^-1 b Baumgarte stabilization: b = beta / dt C beta = baumgarte stabilization factor. dt = delta time. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_SolvePositionConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_SolvePositionConstraints(JPH_ContactConstraintManager* @this, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd); + + /// Recycle the constraint buffer. Should be called between collision simulation steps. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_RecycleConstraintBuffer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_RecycleConstraintBuffer(JPH_ContactConstraintManager* @this); + + /// Terminate the constraint buffer. Should be called after simulation ends. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_FinishConstraintBuffer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_FinishConstraintBuffer(JPH_ContactConstraintManager* @this); + + /// Called by continuous collision detection to notify the contact listener that a contact was added @param ioContactAllocator The allocator that reserves memory for the contacts @param inBody1 The first body that is colliding @param inBody2 The second body that is colliding @param inManifold The manifold that describes the collision @param outSettings The calculated contact settings (may be overridden by the contact listener) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_OnCCDContactAdded", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_OnCCDContactAdded(JPH_ContactConstraintManager* @this, JPH_ContactConstraintManager_ContactAllocator* ioContactAllocator, JPH_Body* inBody1, JPH_Body* inBody2, JPH_ContactManifold* inManifold, JPH_ContactSettings* outSettings); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_SaveState(JPH_ContactConstraintManager* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay. Returns false when failed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ContactConstraintManager_RestoreState(JPH_ContactConstraintManager* @this, JPH_StateRecorder* inStream); + + /// Constructor + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ContactConstraintManager_ContactConstraintManager", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ContactConstraintManager_ContactConstraintManager(JPH_ContactConstraintManager* @this, JPH_PhysicsSettings* inPhysicsSettings); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Creates a constraint of the correct type and restores its contents from the binary stream inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_sRestoreFromBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_ConstraintSettings_sRestoreFromBinaryState(JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_ConstraintSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ConstraintSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + /// Saves the contents of the constraint settings in binary form to inStream. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintSettings_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + /// This function should not be called directly, it is used by sRestoreFromBinaryState. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintSettings_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintSettings_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + /// Helper function to copy settings back to constraint settings for this base class + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Constraint_ToConstraintSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Constraint_ToConstraintSettings(JPH_Constraint* @this, JPH_ConstraintSettings* outSettings); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Constraint_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Constraint_SaveState(void* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Constraint_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_Constraint_RestoreState(void* @this, JPH_StateRecorder* inStream); + + /// Add a new constraint. This is thread safe. Note that the inConstraints array is allowed to have nullptrs, these will be ignored. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_Add", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_Add(JPH_ConstraintManager* @this, JPH_Constraint** inConstraints, int inNumber); + + /// Remove a constraint. This is thread safe. Note that the inConstraints array is allowed to have nullptrs, these will be ignored. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_Remove", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_Remove(JPH_ConstraintManager* @this, JPH_Constraint** inConstraint, int inNumber); + + /// Get a list of all constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_GetConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern std_vector JPH_ConstraintManager_GetConstraints(JPH_ConstraintManager* @this); + + /// Determine the active constraints of a subset of the constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_GetActiveConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_GetActiveConstraints(JPH_ConstraintManager* @this, uint inStartConstraintIdx, uint inEndConstraintIdx, JPH_Constraint** outActiveConstraints, uint* outNumActiveConstraints); + + /// Link bodies to form islands + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sBuildIslands", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sBuildIslands(JPH_Constraint** inActiveConstraints, uint inNumActiveConstraints, JPH_IslandBuilder* ioBuilder, JPH_BodyManager* inBodyManager); + + /// In order to have a deterministic simulation, we need to sort the constraints of an island before solving them + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSortConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sSortConstraints(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd); + + /// Prior to solving the velocity constraints, you must call SetupVelocityConstraints once to precalculate values that are independent of velocity + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSetupVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sSetupVelocityConstraints(JPH_Constraint** inActiveConstraints, uint inNumActiveConstraints, float inDeltaTime); + + /// Same as above, but applies to a limited amount of constraints only + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSetupVelocityConstraints1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sSetupVelocityConstraints1(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inDeltaTime); + + /// Apply last frame's impulses, must be called prior to SolveVelocityConstraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sWarmStartVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sWarmStartVelocityConstraints(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inWarmStartImpulseRatio); + + /// Same as above but also calculates the number of velocity steps + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sWarmStartVelocityConstraints1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_sWarmStartVelocityConstraints1(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inWarmStartImpulseRatio, int* ioNumVelocitySteps); + + /// This function is called multiple times to iteratively come to a solution that meets all velocity constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSolveVelocityConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConstraintManager_sSolveVelocityConstraints(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inDeltaTime); + + /// This function is called multiple times to iteratively come to a solution that meets all position constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSolvePositionConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConstraintManager_sSolvePositionConstraints(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inDeltaTime, float inBaumgarte); + + /// Same as above but also calculates the number of position steps + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_sSolvePositionConstraints1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConstraintManager_sSolvePositionConstraints1(JPH_Constraint** inActiveConstraints, uint* inConstraintIdxBegin, uint* inConstraintIdxEnd, float inDeltaTime, float inBaumgarte, int* ioNumPositionSteps); + + /// Save state of constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConstraintManager_SaveState(JPH_ConstraintManager* @this, JPH_StateRecorder* inStream); + + /// Restore the state of constraints. Returns false if failed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConstraintManager_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConstraintManager_RestoreState(JPH_ConstraintManager* @this, JPH_StateRecorder* inStream); + + /// Initialize the island builder with the maximum amount of bodies that could be active + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_Init(JPH_IslandBuilder* @this, uint inMaxActiveBodies); + + /// Prepare for simulation step by allocating space for the contact constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_PrepareContactConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_PrepareContactConstraints(JPH_IslandBuilder* @this, uint inMaxContactConstraints, JPH_TempAllocator* inTempAllocator); + + /// Prepare for simulation step by allocating space for the non-contact constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_PrepareNonContactConstraints", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_PrepareNonContactConstraints(JPH_IslandBuilder* @this, uint inNumConstraints, JPH_TempAllocator* inTempAllocator); + + /// Link two bodies by their index in the BodyManager::mActiveBodies list to form islands + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_LinkBodies", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_LinkBodies(JPH_IslandBuilder* @this, uint inFirst, uint inSecond); + + /// Link a constraint to a body by their index in the BodyManager::mActiveBodies + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_LinkConstraint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_LinkConstraint(JPH_IslandBuilder* @this, uint inConstraintIndex, uint inFirst, uint inSecond); + + /// Link a contact to a body by their index in the BodyManager::mActiveBodies + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_LinkContact", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_LinkContact(JPH_IslandBuilder* @this, uint inContactIndex, uint inFirst, uint inSecond); + + /// Finalize the islands after all bodies have been Link()-ed + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_Finalize", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_Finalize(JPH_IslandBuilder* @this, JPH_BodyID* inActiveBodies, uint inNumActiveBodies, uint inNumContacts, JPH_TempAllocator* inTempAllocator); + + /// Get iterator for a particular island, return false if there are no constraints + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_GetBodiesInIsland", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_GetBodiesInIsland(JPH_IslandBuilder* @this, uint inIslandIndex, JPH_BodyID** outBodiesBegin, JPH_BodyID** outBodiesEnd); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_GetConstraintsInIsland", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_IslandBuilder_GetConstraintsInIsland(JPH_IslandBuilder* @this, uint inIslandIndex, uint** outConstraintsBegin, uint** outConstraintsEnd); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_GetContactsInIsland", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_IslandBuilder_GetContactsInIsland(JPH_IslandBuilder* @this, uint inIslandIndex, uint** outContactsBegin, uint** outContactsEnd); + + /// After you're done calling the three functions above, call this function to free associated data + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_IslandBuilder_ResetIslands", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_IslandBuilder_ResetIslands(JPH_IslandBuilder* @this, JPH_TempAllocator* inTempAllocator); + + /// Fetch the next batch to process + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_Splits_FetchNextBatch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_LargeIslandSplitter_Splits_FetchNextBatch(JPH_LargeIslandSplitter_Splits* @this, uint* outConstraintsBegin, uint* outConstraintsEnd, uint* outContactsBegin, uint* outContactsEnd, bool* outFirstIteration); + + /// Mark a batch as processed + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_Splits_MarkBatchProcessed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_LargeIslandSplitter_Splits_MarkBatchProcessed(JPH_LargeIslandSplitter_Splits* @this, uint inNumProcessed, bool* outLastIteration, bool* outFinalBatch); + + /// Prepare the island splitter by allocating memory + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_Prepare", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_LargeIslandSplitter_Prepare(JPH_LargeIslandSplitter* @this, JPH_IslandBuilder* inIslandBuilder, uint inNumActiveBodies, JPH_TempAllocator* inTempAllocator); + + /// Assign two bodies to a split. Returns the split index. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_AssignSplit", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_LargeIslandSplitter_AssignSplit(JPH_LargeIslandSplitter* @this, JPH_Body* inBody1, JPH_Body* inBody2); + + /// Force a body to be in a non parallel split. Returns the split index. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_AssignToNonParallelSplit", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_LargeIslandSplitter_AssignToNonParallelSplit(JPH_LargeIslandSplitter* @this, JPH_Body* inBody); + + /// Splits up an island, the created splits will be added to the list of batches and can be fetched with FetchNextBatch. Returns false if the island did not need splitting. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_SplitIsland", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_LargeIslandSplitter_SplitIsland(JPH_LargeIslandSplitter* @this, uint inIslandIndex, JPH_IslandBuilder* inIslandBuilder, JPH_BodyManager* inBodyManager, JPH_ContactConstraintManager* inContactManager, JPH_Constraint** inActiveConstraints, int inNumVelocitySteps, int inNumPositionSteps); + + /// Fetch the next batch to process, returns a handle in outSplitIslandIndex that must be provided to MarkBatchProcessed when complete + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_FetchNextBatch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_LargeIslandSplitter_FetchNextBatch(JPH_LargeIslandSplitter* @this, uint* outSplitIslandIndex, uint** outConstraintsBegin, uint** outConstraintsEnd, uint** outContactsBegin, uint** outContactsEnd, bool* outFirstIteration); + + /// Mark a batch as processed + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_MarkBatchProcessed", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_LargeIslandSplitter_MarkBatchProcessed(JPH_LargeIslandSplitter* @this, uint inSplitIslandIndex, uint* inConstraintsBegin, uint* inConstraintsEnd, uint* inContactsBegin, uint* inContactsEnd, bool* outLastIteration, bool* outFinalBatch); + + /// Prepare the island splitter for iterating over the split islands again for position solving. Marks all batches as startable. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_PrepareForSolvePositions", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_LargeIslandSplitter_PrepareForSolvePositions(JPH_LargeIslandSplitter* @this); + + /// Reset the island splitter + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_LargeIslandSplitter_Reset", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_LargeIslandSplitter_Reset(JPH_LargeIslandSplitter* @this, JPH_TempAllocator* inTempAllocator); + + /// Destructor + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsUpdateContext_PhysicsUpdateContext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsUpdateContext_PhysicsUpdateContext(JPH_PhysicsUpdateContext* @this, JPH_TempAllocator* inTempAllocator); + + /// Initialize the system. @param inMaxBodies Maximum number of bodies to support. @param inNumBodyMutexes Number of body mutexes to use. Should be a power of 2 in the range [1, 64], use 0 to auto detect. @param inMaxBodyPairs Maximum amount of body pairs to process (anything else will fall through the world), this number should generally be much higher than the max amount of contact points as there will be lots of bodies close that are not actually touching. @param inMaxContactConstraints Maximum amount of contact constraints to process (anything else will fall through the world). @param inBroadPhaseLayerInterface Information on the mapping of object layers to broad phase layers. Since this is a virtual interface, the instance needs to stay alive during the lifetime of the PhysicsSystem. @param inObjectVsBroadPhaseLayerFilter Filter callback function that is used to determine if an object layer collides with a broad phase layer. Since this is a virtual interface, the instance needs to stay alive during the lifetime of the PhysicsSystem. @param inObjectLayerPairFilter Filter callback function that is used to determine if two object layers collide. Since this is a virtual interface, the instance needs to stay alive during the lifetime of the PhysicsSystem. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_Init", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_Init(JPH_PhysicsSystem* @this, uint inMaxBodies, uint inNumBodyMutexes, uint inMaxBodyPairs, uint inMaxContactConstraints, JPH_BroadPhaseLayerInterface* inBroadPhaseLayerInterface, JPH_ObjectVsBroadPhaseLayerFilter* inObjectVsBroadPhaseLayerFilter, JPH_ObjectLayerPairFilter* inObjectLayerPairFilter); + + /// Optimize the broadphase, needed only if you've added many bodies prior to calling Update() for the first time. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_OptimizeBroadPhase", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_OptimizeBroadPhase(JPH_PhysicsSystem* @this); + + /// Adds a new step listener + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_AddStepListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_AddStepListener(JPH_PhysicsSystem* @this, JPH_PhysicsStepListener* inListener); + + /// Removes a step listener + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_RemoveStepListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_RemoveStepListener(JPH_PhysicsSystem* @this, JPH_PhysicsStepListener* inListener); + + /// Simulate the system. The world steps for a total of inDeltaTime seconds. This is divided in inCollisionSteps iterations. Each iteration consists of collision detection followed by inIntegrationSubSteps integration steps. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_Update", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_Update(JPH_PhysicsSystem* @this, float inDeltaTime, int inCollisionSteps, int inIntegrationSubSteps, JPH_TempAllocator* inTempAllocator, JPH_JobSystem* inJobSystem); + + /// Saving state for replay + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_SaveState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_SaveState(JPH_PhysicsSystem* @this, JPH_StateRecorder* inStream); + + /// Restoring state for replay. Returns false if failed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_RestoreState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_PhysicsSystem_RestoreState(JPH_PhysicsSystem* @this, JPH_StateRecorder* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_BoxShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_BoxShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_BoxShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_BoxShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_BoxShape(JPH_BoxShape* @this, JPH_BoxShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_BoxShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_BoxShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_BoxShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_BoxShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_BoxShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BoxShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BoxShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_SphereShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_SphereShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_SphereShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_SphereShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_SphereShape(JPH_SphereShape* @this, JPH_SphereShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_SphereShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_SphereShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_SphereShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_SphereShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_SphereShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_SphereShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_SphereShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_SphereShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SphereShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SphereShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyCreationSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Convert ShapeSettings object into a Shape object. This will free the ShapeSettings object and make the object ready for runtime. Serialization is no longer possible after this. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_ConvertShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_BodyCreationSettings_ConvertShapeSettings(JPH_BodyCreationSettings* @this); + + /// Access to the run-time shape object. Will convert from ShapeSettings object if needed. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_GetShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape* JPH_BodyCreationSettings_GetShape(JPH_BodyCreationSettings* @this); + + /// Calculate (or return when overridden) the mass and inertia for this body + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_BodyCreationSettings_GetMassProperties(JPH_BodyCreationSettings* @this); + + /// Saves the state of this object in binary form to inStream. Doesn't store the shape nor the group filter. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyCreationSettings_SaveBinaryState(JPH_BodyCreationSettings* @this, JPH_StreamOut* inStream); + + /// Restore the state of this object from inStream. Doesn't restore the shape nor the group filter. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyCreationSettings_RestoreBinaryState(JPH_BodyCreationSettings* @this, JPH_StreamIn* inStream); + + /// Save this body creation settings, its shape and gropu filter. Pass in an empty map in ioShapeMap / ioMaterialMap / ioGroupFilterMap or reuse the same map while saving multiple shapes to the same stream in order to avoid writing duplicates. Pass nullptr to ioShapeMap and ioMaterial map to skip saving shapes Pass nullptr to ioGroupFilterMap to skip saving group filters + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_SaveWithChildren", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_BodyCreationSettings_SaveWithChildren(JPH_BodyCreationSettings* @this, JPH_StreamOut* inStream, std_unordered_map* ioShapeMap, std_unordered_map* ioMaterialMap, std_unordered_map* ioGroupFilterMap); + + /// Restore a shape, all its children and materials. Pass in an empty map in ioShapeMap / ioMaterialMap / ioGroupFilterMap or reuse the same map while reading multiple shapes from the same stream in order to restore duplicates. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyCreationSettings_sRestoreWithChildren", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_BodyCreationSettings_sRestoreWithChildren(JPH_StreamIn* inStream, std_vector* ioShapeMap, std_vector* ioMaterialMap, std_vector* ioGroupFilterMap); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_CapsuleShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_CapsuleShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_CapsuleShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_CapsuleShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_CapsuleShape(JPH_CapsuleShape* @this, JPH_CapsuleShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_CapsuleShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_CapsuleShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_CapsuleShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_CapsuleShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_CapsuleShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CapsuleShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_CapsuleShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CapsuleShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CapsuleShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CapsuleShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_SubShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShapeSettings_SubShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Add a shape to the compound. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_AddShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShapeSettings_AddShape(JPH_CompoundShapeSettings* @this, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_ShapeSettings* inShape, uint inUserData); + + /// Add a shape to the compound. Variant that uses a concrete shape, which means this object cannot be serialized. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_AddShape1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShapeSettings_AddShape1(JPH_CompoundShapeSettings* @this, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_Shape* inShape, uint inUserData); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_CompoundShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_CompoundShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_MustBeStatic", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CompoundShape_MustBeStatic(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetSubShapeIDBitsRecursive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_CompoundShape_GetSubShapeIDBitsRecursive(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_CompoundShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_CompoundShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetMaterial", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_CompoundShape_GetMaterial(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetSubShapeUserData", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong JPH_CompoundShape_GetSubShapeUserData(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetSubShapeTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_CompoundShape_GetSubShapeTransformedShape(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeID* outRemainder); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_CompoundShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_SaveSubShapeState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_SaveSubShapeState(void* @this, std_vector* outSubShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_RestoreSubShapeState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_RestoreSubShapeState(void* @this, JPH_RefConst* inSubShapes, uint inNumShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetStatsRecursive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_CompoundShape_GetStatsRecursive(void* @this, std_unordered_set* ioVisitedShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_GetVolume", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float JPH_CompoundShape_GetVolume(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CompoundShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CompoundShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CompoundShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_ConvexHullShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ConvexHullShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_ConvexHullShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_ConvexHullShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_ConvexHullShape(JPH_ConvexHullShape* @this, JPH_ConvexHullShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_ConvexHullShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_ConvexHullShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_ConvexHullShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ConvexHullShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_ConvexHullShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_GetStats", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_ConvexHullShape_GetStats(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ConvexHullShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ConvexHullShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_CylinderShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_CylinderShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_CylinderShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_CylinderShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_CylinderShape(JPH_CylinderShape* @this, JPH_CylinderShapeSettings* inSettings, JPH_Result* outResult); + + /// Create a shape centered around the origin with one top at (0, -inHalfHeight, 0) and the other at (0, inHalfHeight, 0) and radius inRadius. (internally the convex radius will be subtracted from the cylinder the total cylinder will not grow with the convex radius, but the edges of the cylinder will be rounded a bit). + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_CylinderShape1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_CylinderShape1(JPH_CylinderShape* @this, float inHalfHeight, float inRadius, float inConvexRadius, JPH_PhysicsMaterial* inMaterial); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_CylinderShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_CylinderShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_CylinderShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_CylinderShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CylinderShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_CylinderShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_CylinderShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CylinderShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_CylinderShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DecoratedShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_DecoratedShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_DecoratedShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_DecoratedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DecoratedShape_DecoratedShape(JPH_DecoratedShape* @this, byte inSubType, JPH_DecoratedShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_GetMaterial", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_DecoratedShape_GetMaterial(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DecoratedShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_GetSubShapeUserData", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern ulong JPH_DecoratedShape_GetSubShapeUserData(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_SaveSubShapeState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DecoratedShape_SaveSubShapeState(void* @this, std_vector* outSubShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_RestoreSubShapeState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DecoratedShape_RestoreSubShapeState(void* @this, JPH_RefConst* inSubShapes, uint inNumShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DecoratedShape_GetStatsRecursive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_DecoratedShape_GetStatsRecursive(void* @this, std_unordered_set* ioVisitedShapes); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Determine the minimal and maximal value of mHeightSamples (will ignore cNoCollisionValue) @param outMinValue The minimal value fo mHeightSamples or FLT_MAX if no samples have collision @param outMaxValue The maximal value fo mHeightSamples or -FLT_MAX if no samples have collision @param outQuantizationScale (value - outMinValue) * outQuantizationScale quantizes a height sample to 16 bits + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_DetermineMinAndMaxSample", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShapeSettings_DetermineMinAndMaxSample(JPH_HeightFieldShapeSettings* @this, float* outMinValue, float* outMaxValue, float* outQuantizationScale); + + /// Given mBlockSize, mSampleCount and mHeightSamples, calculate the amount of bits needed to stay below absolute error inMaxError @param inMaxError Maximum allowed error in mHeightSamples after compression (note that this does not take mScale.Y into account) @return Needed bits per sample in the range [1, 8]. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_CalculateBitsPerSampleForError", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_HeightFieldShapeSettings_CalculateBitsPerSampleForError(JPH_HeightFieldShapeSettings* @this, float inMaxError); + + /// Create a height field shape of inSampleCount * inSampleCount vertices. The height field is a surface defined by: inOffset + inScale * (x, inSamples[y * inSampleCount + x], y). where x and y are integers in the range x and y e [0, inSampleCount - 1]. inSampleCount: inSampleCount / mBlockSize must be a power of 2 and minimally 2. inSamples: inSampleCount^2 vertices. inMaterialIndices: (inSampleCount - 1)^2 indices that index into inMaterialList. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_HeightFieldShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShapeSettings_HeightFieldShapeSettings(JPH_HeightFieldShapeSettings* @this, float* inSamples, JPH_Vec3 inOffset, JPH_Vec3 inScale, uint inSampleCount, byte* inMaterialIndices, std_vector* inMaterialList); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_HeightFieldShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_HeightFieldShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_HeightFieldShapeSettings_Create(void* @this); + + /// Overload to get the material at a particular location + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetMaterial1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_HeightFieldShape_GetMaterial1(JPH_HeightFieldShape* @this, uint inX, uint inY); + + /// Get height field position at sampled location (inX, inY). where inX and inY are integers in the range inX e [0, mSampleCount - 1] and inY e [0, mSampleCount - 1]. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetPosition", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_HeightFieldShape_GetPosition(JPH_HeightFieldShape* @this, uint inX, uint inY); + + /// Check if height field at sampled location (inX, inY) has collision (has a hole or not) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_IsNoCollision", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_HeightFieldShape_IsNoCollision(JPH_HeightFieldShape* @this, uint inX, uint inY); + + /// Projects inLocalPosition (a point in the space of the shape) along the Y axis onto the surface and returns it in outSurfacePosition. When there is no surface position (because of a hole or because the point is outside the heightfield) the function will return false. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_ProjectOntoSurface", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_HeightFieldShape_ProjectOntoSurface(JPH_HeightFieldShape* @this, JPH_Vec3 inLocalPosition, JPH_Vec3* outSurfacePosition, JPH_SubShapeID* outSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_HeightFieldShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_HeightFieldShape(JPH_HeightFieldShape* @this, JPH_HeightFieldShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_HeightFieldShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_HeightFieldShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetMaterial", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_HeightFieldShape_GetMaterial(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_HeightFieldShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_HeightFieldShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_HeightFieldShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_SaveMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_SaveMaterialState(void* @this, std_vector* outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_RestoreMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_RestoreMaterialState(void* @this, JPH_RefConst* inMaterials, uint inNumMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_GetStats", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_HeightFieldShape_GetStats(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_HeightFieldShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_HeightFieldShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Sanitize the mesh data. Remove duplicate and degenerate triangles. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_Sanitize", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShapeSettings_Sanitize(JPH_MeshShapeSettings* @this); + + /// Create a mesh shape. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_MeshShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShapeSettings_MeshShapeSettings(JPH_MeshShapeSettings* @this, std_vector* inTriangles, std_vector* inMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_MeshShapeSettings1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShapeSettings_MeshShapeSettings1(JPH_MeshShapeSettings* @this, std_vector* inVertices, std_vector* inTriangles, std_vector* inMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_MeshShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_MeshShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_MeshShapeSettings_Create(void* @this); + + /// Determine which material index a particular sub shape uses (note that if there are no materials this function will return 0 so check the array size) Note: This could for example be used to create a decorator shape around a mesh shape that overrides the GetMaterial call to replace a material with another material. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetMaterialIndex", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_MeshShape_GetMaterialIndex(JPH_MeshShape* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_MeshShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_MeshShape(JPH_MeshShape* @this, JPH_MeshShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_MeshShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetSubShapeIDBitsRecursive", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_MeshShape_GetSubShapeIDBitsRecursive(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_MeshShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetMaterial", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsMaterial* JPH_MeshShape_GetMaterial(void* @this, JPH_SubShapeID* inSubShapeID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_MeshShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_MeshShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + /// See: Shape::CollidePoint Note that for CollidePoint to work for a mesh shape, the mesh needs to be closed (a manifold) or multiple non-intersecting manifolds. Triangles may be facing the interior of the manifold. Insideness is tested by counting the amount of triangles encountered when casting an infinite ray from inPoint. If the number of hits is odd we're inside, if it's even we're outside. + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_MeshShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_SaveMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_SaveMaterialState(void* @this, std_vector* outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_RestoreMaterialState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_RestoreMaterialState(void* @this, JPH_RefConst* inMaterials, uint inNumMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_GetStats", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Shape_Stats JPH_MeshShape_GetStats(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MeshShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MeshShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_MutableCompoundShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_MutableCompoundShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_MutableCompoundShapeSettings_Create(void* @this); + + /// Adding a new shape @return The index of the newly added shape + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_AddShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern uint JPH_MutableCompoundShape_AddShape(JPH_MutableCompoundShape* @this, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_Shape* inShape, uint inUserData); + + /// Remove a shape by index + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_RemoveShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_RemoveShape(JPH_MutableCompoundShape* @this, uint inIndex); + + /// Modify the position / orientation of a shape + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_ModifyShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_ModifyShape(JPH_MutableCompoundShape* @this, uint inIndex, JPH_Vec3 inPosition, JPH_Quat inRotation); + + /// Modify the position / orientation and shape at the same time + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_ModifyShape1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_ModifyShape1(JPH_MutableCompoundShape* @this, uint inIndex, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_Shape* inShape); + + /// @brief Batch set positions / orientations, this avoids duplicate work due to bounding box calculation. @param inStartIndex Index of first shape to update @param inNumber Number of shapes to update @param inPositions A list of positions with arbitrary stride @param inRotations A list of orientations with arbitrary stride @param inPositionStride The position stride (the number of bytes between the first and second element) @param inRotationStride The orientation stride (the number of bytes between the first and second element) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_ModifyShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_ModifyShapes(JPH_MutableCompoundShape* @this, uint inStartIndex, uint inNumber, JPH_Vec3* inPositions, JPH_Quat* inRotations, uint inPositionStride, uint inRotationStride); + + /// Recalculate the center of mass and shift all objects so they're centered around it (this needs to be done of dynamic bodies and if the center of mass changes significantly due to adding / removing / repositioning sub shapes or else the simulation will look unnatural) + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_AdjustCenterOfMass", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_AdjustCenterOfMass(JPH_MutableCompoundShape* @this); + + /// @} + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_MutableCompoundShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_MutableCompoundShape(JPH_MutableCompoundShape* @this, JPH_MutableCompoundShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_MutableCompoundShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_GetIntersectingSubShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_MutableCompoundShape_GetIntersectingSubShapes(void* @this, JPH_AABox* inBox, uint* outSubShapeIndices, int inMaxSubShapeIndices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_GetIntersectingSubShapes1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_MutableCompoundShape_GetIntersectingSubShapes1(void* @this, JPH_OrientedBox* inBox, uint* outSubShapeIndices, int inMaxSubShapeIndices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_MutableCompoundShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_MutableCompoundShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_OffsetCenterOfMassShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_OffsetCenterOfMassShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_OffsetCenterOfMassShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_OffsetCenterOfMassShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_OffsetCenterOfMassShape(JPH_OffsetCenterOfMassShape* @this, JPH_OffsetCenterOfMassShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_OffsetCenterOfMassShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_OffsetCenterOfMassShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_GetSubShapeTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_OffsetCenterOfMassShape_GetSubShapeTransformedShape(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeID* outRemainder); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_OffsetCenterOfMassShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_OffsetCenterOfMassShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_OffsetCenterOfMassShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_OffsetCenterOfMassShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_RotatedTranslatedShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_RotatedTranslatedShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_RotatedTranslatedShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_RotatedTranslatedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_RotatedTranslatedShape(JPH_RotatedTranslatedShape* @this, JPH_RotatedTranslatedShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_RotatedTranslatedShape1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_RotatedTranslatedShape1(JPH_RotatedTranslatedShape* @this, JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_Shape* inShape); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_RotatedTranslatedShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_RotatedTranslatedShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_RotatedTranslatedShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetSubShapeTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_RotatedTranslatedShape_GetSubShapeTransformedShape(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeID* outRemainder); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_RotatedTranslatedShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_RotatedTranslatedShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_RotatedTranslatedShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_RotatedTranslatedShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_RotatedTranslatedShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_ScaledShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_ScaledShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_ScaledShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_ScaledShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_ScaledShape(JPH_ScaledShape* @this, JPH_ScaledShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_ScaledShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_ScaledShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_ScaledShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetSubShapeTransformedShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TransformedShape JPH_ScaledShape_GetSubShapeTransformedShape(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeID* outRemainder); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_ScaledShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ScaledShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_GetVolume", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float JPH_ScaledShape_GetVolume(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_ScaledShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_ScaledShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_ScaledShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Specialization of Create() function that allows specifying a temp allocator to avoid temporary memory allocations on the heap + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShapeSettings_Create1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_StaticCompoundShapeSettings_Create1(JPH_StaticCompoundShapeSettings* @this, JPH_TempAllocator* inTempAllocator); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_StaticCompoundShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_StaticCompoundShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_StaticCompoundShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_Node_SetChildBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_Node_SetChildBounds(JPH_StaticCompoundShape_Node* @this, uint inIndex, JPH_AABox* inBounds); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_Node_SetChildInvalid", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_Node_SetChildInvalid(JPH_StaticCompoundShape_Node* @this, uint inIndex); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_StaticCompoundShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_StaticCompoundShape(JPH_StaticCompoundShape* @this, JPH_StaticCompoundShapeSettings* inSettings, JPH_TempAllocator* inTempAllocator, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_StaticCompoundShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_CollectTransformedShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_CollectTransformedShapes(void* @this, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_GetIntersectingSubShapes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_StaticCompoundShape_GetIntersectingSubShapes(void* @this, JPH_AABox* inBox, uint* outSubShapeIndices, int inMaxSubShapeIndices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_GetIntersectingSubShapes1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_StaticCompoundShape_GetIntersectingSubShapes1(void* @this, JPH_OrientedBox* inBox, uint* outSubShapeIndices, int inMaxSubShapeIndices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_StaticCompoundShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_StaticCompoundShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + /// Checks if the settings of this tapered capsule make this shape a sphere + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_IsSphere", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_TaperedCapsuleShapeSettings_IsSphere(JPH_TaperedCapsuleShapeSettings* @this); + + /// Create a tapered capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfTaperedCylinder, 0) with radius inBottomRadius and the other at (0, inHalfHeightOfTaperedCylinder, 0) with radius inTopRadius + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_TaperedCapsuleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShapeSettings_TaperedCapsuleShapeSettings(JPH_TaperedCapsuleShapeSettings* @this, float inHalfHeightOfTaperedCylinder, float inTopRadius, float inBottomRadius, JPH_PhysicsMaterial* inMaterial); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_TaperedCapsuleShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_TaperedCapsuleShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_TaperedCapsuleShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_TaperedCapsuleShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_TaperedCapsuleShape(JPH_TaperedCapsuleShape* @this, JPH_TaperedCapsuleShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_TaperedCapsuleShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_TaperedCapsuleShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_TaperedCapsuleShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_TaperedCapsuleShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_TaperedCapsuleShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_TaperedCapsuleShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TaperedCapsuleShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TaperedCapsuleShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShapeSettings_sCreateRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShapeSettings_sCreateRTTI(JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShapeSettings_GetRTTI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RTTI* JPH_TriangleShapeSettings_GetRTTI(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShapeSettings_CastTo", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void* JPH_TriangleShapeSettings_CastTo(void* @this, JPH_RTTI* inRTTI); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShapeSettings_Create", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Result JPH_TriangleShapeSettings_Create(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_sRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_sRegister(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_TriangleShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_TriangleShape(JPH_TriangleShape* @this, JPH_TriangleShapeSettings* inSettings, JPH_Result* outResult); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetLocalBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_TriangleShape_GetLocalBounds(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetWorldSpaceBounds", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_AABox JPH_TriangleShape_GetWorldSpaceBounds(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetMassProperties", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MassProperties JPH_TriangleShape_GetMassProperties(void* @this); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetSurfaceNormal", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_Vec3 JPH_TriangleShape_GetSurfaceNormal(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inLocalSurfacePosition); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetSupportingFace", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_GetSupportingFace(void* @this, JPH_SubShapeID* inSubShapeID, JPH_Vec3 inDirection, JPH_Vec3 inScale, JPH_Mat44* inCenterOfMassTransform, byte* outVertices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetSupportFunction", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexShape_Support* JPH_TriangleShape_GetSupportFunction(void* @this, int inMode, JPH_ConvexShape_SupportBuffer* inBuffer, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_CastRay", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_TriangleShape_CastRay(void* @this, JPH_RayCast* inRay, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_RayCastResult* ioHit); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_CastRay1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_CastRay1(void* @this, JPH_RayCast* inRay, JPH_RayCastSettings* inRayCastSettings, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_CollidePoint", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_CollidePoint(void* @this, JPH_Vec3 inPoint, JPH_SubShapeIDCreator* inSubShapeIDCreator, JPH_CollisionCollector* ioCollector, JPH_ShapeFilter* inShapeFilter); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_TransformShape", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_TransformShape(void* @this, JPH_Mat44* inCenterOfMassTransform, JPH_CollisionCollector* ioCollector); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetTrianglesStart", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_GetTrianglesStart(void* @this, JPH_Shape_GetTrianglesContext* ioContext, JPH_AABox* inBox, JPH_Vec3 inPositionCOM, JPH_Quat inRotation, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_GetTrianglesNext", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int JPH_TriangleShape_GetTrianglesNext(void* @this, JPH_Shape_GetTrianglesContext* ioContext, int inMaxTrianglesRequested, JPH_Float3* outTriangleVertices, JPH_PhysicsMaterial** outMaterials); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_SaveBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_SaveBinaryState(void* @this, JPH_StreamOut* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_IsValidScale", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool JPH_TriangleShape_IsValidScale(void* @this, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_TriangleShape_RestoreBinaryState", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_TriangleShape_RestoreBinaryState(void* @this, JPH_StreamIn* inStream); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_SetFactory", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_SetFactory(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_UnsetFactory", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_UnsetFactory(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_SetBodyActivationListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_SetBodyActivationListener(JPH_PhysicsSystem* handler, JPH_BodyActivationListener* inListener); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_SetContactListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_PhysicsSystem_SetContactListener(JPH_PhysicsSystem* handler, JPH_ContactListener* inListener); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_PhysicsSystem_GetBodyInterface", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyInterface* JPH_PhysicsSystem_GetBodyInterface(JPH_PhysicsSystem* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetCenterOfMassPosition1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH___Vec3__ JPH_BodyInterface_GetCenterOfMassPosition1(JPH_BodyInterface* handler, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_BodyInterface_GetLinearVelocity1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH___Vec3__ JPH_BodyInterface_GetLinearVelocity1(JPH_BodyInterface* handler, JPH_BodyID* inBodyID); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_Body_GetID", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyID* JPH_Body_GetID(JPH_Body* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreatePhysicsSystem", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_PhysicsSystem* JPH_CreatePhysicsSystem(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyPhysicsSystem", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyPhysicsSystem(JPH_PhysicsSystem* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateBodyCreationSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyCreationSettings* JPH_CreateBodyCreationSettings(JPH_ShapeSettings* inShape, JPH_Vec3 inPosition, JPH_Quat inRotation, byte inMotionType, ushort inObjectLayer); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyBodyCreationSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyBodyCreationSettings(JPH_BodyCreationSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateTempAllocatorImpl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TempAllocatorImpl* JPH_CreateTempAllocatorImpl(uint inSize); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyTempAllocatorImpl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyTempAllocatorImpl(JPH_TempAllocatorImpl* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateJobSystemThreadPool", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_JobSystemThreadPool* JPH_CreateJobSystemThreadPool(uint inMaxJobs, uint inMaxBarriers, int inNumThreads); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyJobSystemThreadPool", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyJobSystemThreadPool(JPH_JobSystemThreadPool* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateBoxShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BoxShapeSettings* JPH_CreateBoxShapeSettings(JPH_Vec3 inHalfExtent, float inConvexRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyBoxShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyBoxShapeSettings(JPH_BoxShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateCapsuleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_CapsuleShapeSettings* JPH_CreateCapsuleShapeSettings(float inHalfHeightOfCylinder, float inRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyCapsuleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyCapsuleShapeSettings(JPH_CapsuleShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateConvexHullShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ConvexHullShapeSettings* JPH_CreateConvexHullShapeSettings(JPH_Vec3* inPoints, int inNumPoints, float inMaxConvexRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyConvexHullShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyConvexHullShapeSettings(JPH_ConvexHullShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateCylinderShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_CylinderShapeSettings* JPH_CreateCylinderShapeSettings(float inHalfHeight, float inRadius, float inConvexRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyCylinderShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyCylinderShapeSettings(JPH_CylinderShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateHeightFieldShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_HeightFieldShapeSettings* JPH_CreateHeightFieldShapeSettings(float* inSamples, JPH_Vec3 inOffset, JPH_Vec3 inScale, uint inSampleCount, byte* inMaterialIndices); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyHeightFieldShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyHeightFieldShapeSettings(JPH_HeightFieldShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateMeshShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MeshShapeSettings* JPH_CreateMeshShapeSettings(std_vector* inVertices, std_vector* inTriangles); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyMeshShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyMeshShapeSettings(JPH_MeshShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateMutableCompoundShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_MutableCompoundShapeSettings* JPH_CreateMutableCompoundShapeSettings(); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyMutableCompoundShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyMutableCompoundShapeSettings(JPH_MutableCompoundShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateOffsetCenterOfMassShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_OffsetCenterOfMassShapeSettings* JPH_CreateOffsetCenterOfMassShapeSettings(JPH_Vec3 inOffset, JPH_ShapeSettings* inShape); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyOffsetCenterOfMassShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyOffsetCenterOfMassShapeSettings(JPH_OffsetCenterOfMassShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateRotatedTranslatedShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_RotatedTranslatedShapeSettings* JPH_CreateRotatedTranslatedShapeSettings(JPH_Vec3 inPosition, JPH_Quat inRotation, JPH_ShapeSettings* inShape); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyRotatedTranslatedShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyRotatedTranslatedShapeSettings(JPH_RotatedTranslatedShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateScaledShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ScaledShapeSettings* JPH_CreateScaledShapeSettings(JPH_ShapeSettings* inShape, JPH_Vec3 inScale); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyScaledShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyScaledShapeSettings(JPH_ScaledShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateSphereShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_SphereShapeSettings* JPH_CreateSphereShapeSettings(float inRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroySphereShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroySphereShapeSettings(JPH_SphereShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateTaperedCapsuleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TaperedCapsuleShapeSettings* JPH_CreateTaperedCapsuleShapeSettings(float inHalfHeightOfTaperedCylinder, float inTopRadius, float inBottomRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyTaperedCapsuleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyTaperedCapsuleShapeSettings(JPH_TaperedCapsuleShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateTriangleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_TriangleShapeSettings* JPH_CreateTriangleShapeSettings(JPH_Vec3 inV1, JPH_Vec3 inV2, JPH_Vec3 inV3, float inConvexRadius); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyTriangleShapeSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyTriangleShapeSettings(JPH_TriangleShapeSettings* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateBroadPhaseLayerInterface", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BroadPhaseLayerInterface* JPH_CreateBroadPhaseLayerInterface(JPH_BroadPhaseLayerInterfaceMethods methods); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyBroadPhaseLayerInterface", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyBroadPhaseLayerInterface(JPH_BroadPhaseLayerInterface* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateObjectVsBroadPhaseLayerFilter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ObjectVsBroadPhaseLayerFilter* JPH_CreateObjectVsBroadPhaseLayerFilter(JPH_ObjectVsBroadPhaseLayerFilterMethods methods); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyObjectVsBroadPhaseLayerFilter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyObjectVsBroadPhaseLayerFilter(JPH_ObjectVsBroadPhaseLayerFilter* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateObjectLayerPairFilter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ObjectLayerPairFilter* JPH_CreateObjectLayerPairFilter(JPH_ObjectLayerPairFilterMethods methods); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyObjectLayerPairFilter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyObjectLayerPairFilter(JPH_ObjectLayerPairFilter* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateBodyActivationListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_BodyActivationListener* JPH_CreateBodyActivationListener(JPH_BodyActivationListenerMethods methods); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyBodyActivationListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyBodyActivationListener(JPH_BodyActivationListener* handler); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_CreateContactListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern JPH_ContactListener* JPH_CreateContactListener(JPH_ContactListenerMethods methods); + + [DllImport(__DllName, EntryPoint = "magicbullet_JPH_DestroyContactListener", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void JPH_DestroyContactListener(JPH_ContactListener* handler); + + + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_pair + { + public _Ty1 first; + public _Ty2 second; + public PhantomData _phantom_0; + public PhantomData _phantom_1; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_vector + { + public byte _Mypair; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_basic_string + { + public byte _Mypair; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_atomic + { + public byte _address; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_list + { + public byte _Mypair; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std__Hash_vec + { + public byte _Mypair; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std__Hash + { + public _Traits _Traitsobj; + public std_list _List; + public std__Hash_vec _Vec; + public fixed byte _Mask[1]; + public fixed byte _Maxidx[1]; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_unordered_map + { + public std__Hash _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_function + { + public byte _address; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std__Mutex_base + { + public fixed ulong _Mtx_storage[10]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_mutex + { + public std__Mutex_base _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct std_unordered_set + { + public std__Hash _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Vec4 + { + public JPH_Vec4__bindgen_ty_1 __bindgen_anon_1; + } + + [StructLayout(LayoutKind.Explicit)] + internal unsafe partial struct JPH_Vec4__bindgen_ty_1 + { + [FieldOffset(0)] + public fixed float mValue[4]; + [FieldOffset(0)] + public fixed float mF32[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Float3 + { + public float x; + public float y; + public float z; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Vec3 + { + public JPH_Vec3__bindgen_ty_1 __bindgen_anon_1; + } + + [StructLayout(LayoutKind.Explicit)] + internal unsafe partial struct JPH_Vec3__bindgen_ty_1 + { + [FieldOffset(0)] + public fixed float mValue[4]; + [FieldOffset(0)] + public fixed float mF32[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Mat44 + { + public fixed byte/* JPH_Vec4, this length is invalid so must keep pointer and can't edit from C# */ mCol[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Quat + { + public JPH_Vec4 mValue; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Double3 + { + public double x; + public double y; + public double z; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_DVec3 + { + public JPH_DVec3__bindgen_ty_1 __bindgen_anon_1; + } + + [StructLayout(LayoutKind.Explicit)] + internal unsafe partial struct JPH_DVec3__bindgen_ty_1 + { + [FieldOffset(0)] + public fixed double mValue[4]; + [FieldOffset(0)] + public fixed double mF64[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_DMat44 + { + public fixed byte/* JPH_Vec4, this length is invalid so must keep pointer and can't edit from C# */ mCol[3]; + public fixed ulong __bindgen_padding_0[2]; + public JPH_DVec3 mCol3; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TempAllocator + { + public JPH_TempAllocator__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TempAllocatorImpl + { + public JPH_TempAllocator _base; + public byte* mBase; + public uint mSize; + public uint mTop; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RefTarget + { + public std_atomic mRefCount; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Ref + { + public T* mPtr; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RefConst + { + public T* mPtr; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Color + { + public JPH_Color__bindgen_ty_1 __bindgen_anon_1; + } + + [StructLayout(LayoutKind.Explicit)] + internal unsafe partial struct JPH_Color__bindgen_ty_1 + { + [FieldOffset(0)] + public uint mU32; + [FieldOffset(0)] + public JPH_Color__bindgen_ty_1__bindgen_ty_1 __bindgen_anon_1; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Color__bindgen_ty_1__bindgen_ty_1 + { + public byte r; + public byte g; + public byte b; + public byte a; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystem + { + public JPH_JobSystem__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystem_JobHandle + { + public JPH_Ref _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystem_Barrier + { + public JPH_JobSystem_Barrier__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystem_Job + { + public JPH_JobSystem* mJobSystem; + public std_atomic mBarrier; + public std_function mJobFunction; + public std_atomic mReferenceCount; + public std_atomic mNumDependencies; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Semaphore + { + public std_atomic mCount; + public void* mSemaphore; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystemWithBarrier + { + public JPH_JobSystem _base; + public uint mMaxBarriers; + public JPH_JobSystemWithBarrier_BarrierImpl* mBarriers; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystemWithBarrier_BarrierImpl + { + public JPH_JobSystem_Barrier _base; + public std_atomic mInUse; + public fixed byte/* std_atomic, this length is invalid so must keep pointer and can't edit from C# */ mJobs[2048]; + public fixed uint __bindgen_padding_0[12]; + public std_atomic mJobReadIndex; + public fixed uint __bindgen_padding_1[15]; + public std_atomic mJobWriteIndex; + public std_atomic mNumToAcquire; + public fixed ulong __bindgen_padding_2[7]; + public JPH_Semaphore mSemaphore; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_FixedSizeFreeList + { + public std_atomic mAllocationTag; + public std_atomic mFirstFreeObjectAndTag; + public uint mPageSize; + public uint mPageShift; + public uint mObjectMask; + public uint mNumPages; + public uint mNumObjectsAllocated; + public std_atomic mFirstFreeObjectInNewPage; + public JPH_FixedSizeFreeList_ObjectStorage** mPages; + public std_mutex mPageMutex; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_FixedSizeFreeList_ObjectStorage + { + public Object mObject; + public std_atomic mNextFreeObject; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_JobSystemThreadPool + { + public JPH_JobSystemWithBarrier _base; + public JPH_FixedSizeFreeList mJobs; + public std_vector mThreads; + public fixed byte/* std_atomic, this length is invalid so must keep pointer and can't edit from C# */ mQueue[1024]; + public std_atomic* mHeads; + public fixed uint __bindgen_padding_0[2]; + public std_atomic mTail; + public fixed ulong __bindgen_padding_1[7]; + public JPH_Semaphore mSemaphore; + public std_atomic mQuit; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_PhysicsSettings + { + public int mMaxInFlightBodyPairs; + public int mStepListenersBatchSize; + public int mStepListenerBatchesPerJob; + public float mBaumgarte; + public float mSpeculativeContactDistance; + public float mPenetrationSlop; + public float mLinearCastThreshold; + public float mLinearCastMaxPenetration; + public float mManifoldToleranceSq; + public float mMaxPenetrationDistance; + public float mBodyPairCacheMaxDeltaPositionSq; + public float mBodyPairCacheCosMaxDeltaRotationDiv2; + public float mContactNormalCosMaxDeltaRotation; + public float mContactPointPreserveLambdaMaxDistSq; + public int mNumVelocitySteps; + public int mNumPositionSteps; + public float mMinVelocityForRestitution; + public float mTimeBeforeSleep; + public float mPointVelocitySleepThreshold; + [MarshalAs(UnmanagedType.U1)] public bool mDeterministicSimulation; + [MarshalAs(UnmanagedType.U1)] public bool mConstraintWarmStart; + [MarshalAs(UnmanagedType.U1)] public bool mUseBodyPairContactCache; + [MarshalAs(UnmanagedType.U1)] public bool mUseManifoldReduction; + [MarshalAs(UnmanagedType.U1)] public bool mUseLargeIslandSplitter; + [MarshalAs(UnmanagedType.U1)] public bool mAllowSleeping; + [MarshalAs(UnmanagedType.U1)] public bool mCheckActiveEdges; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyID + { + public uint mID; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectLayerFilter + { + public JPH_ObjectLayerFilter__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectLayerPairFilter + { + public JPH_ObjectLayerPairFilter__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TwoBodyConstraintSettings + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TwoBodyConstraint + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyInterface + { + public JPH_BodyLockInterface* mBodyLockInterface; + public JPH_BodyManager* mBodyManager; + public JPH_BroadPhase* mBroadPhase; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyFilter + { + public JPH_BodyFilter__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_AABox + { + public JPH_Vec3 mMin; + public JPH_Vec3 mMax; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SerializableAttribute + { + public byte* mName; + public uint mMemberOffset; + public delegate* unmanaged[Cdecl] mGetMemberPrimitiveType; + public delegate* unmanaged[Cdecl] mIsType; + public delegate* unmanaged[Cdecl] mReadData; + public delegate* unmanaged[Cdecl] mWriteData; + public delegate* unmanaged[Cdecl] mWriteDataType; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RTTI + { + public byte* mName; + public int mSize; + public fixed ulong mBaseClasses[9]; + public delegate* unmanaged[Cdecl] mCreate; + public delegate* unmanaged[Cdecl] mDestruct; + public fixed ulong mAttributes[225]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectStream + { + public JPH_ObjectStream__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_IObjectStreamIn + { + public JPH_ObjectStream _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_IObjectStreamOut + { + public JPH_ObjectStream _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SerializableObject + { + public JPH_SerializableObject__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MassProperties + { + public float mMass; + public ulong __bindgen_padding_0; + public JPH_Mat44 mInertia; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CollisionCollector + { + public JPH_CollisionCollector__bindgen_vtable* vtable_; + public float mEarlyOutFraction; + public JPH_TransformedShape* mContext; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ShapeFilter + { + public JPH_ShapeFilter__bindgen_vtable* vtable_; + public JPH_BodyID mBodyID2; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Result + { + public JPH_Result__bindgen_ty_1 __bindgen_anon_1; + public byte mState; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Result__bindgen_ty_1 + { + public __BindgenUnionField mResult; + public __BindgenUnionField mError; + public fixed ulong bindgen_union_field[4]; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RayCast + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RayCastSettings + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ShapeCastSettings + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RayCastResult + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CollideShapeResult + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ShapeSettings + { + public JPH_SerializableObject _base; + public JPH_RefTarget _base_1; + public ulong mUserData; + public JPH_Result mCachedResult; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Shape + { + public JPH_Shape__bindgen_vtable* vtable_; + public JPH_RefTarget _base; + public ulong mUserData; + public byte mShapeType; + public byte mShapeSubType; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Shape_GetTrianglesContext + { + public fixed byte mData[4288]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Shape_Stats + { + public nuint mSizeBytes; + public uint mNumTriangles; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhaseLayer + { + public byte mValue; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhaseLayerInterface + { + public JPH_BroadPhaseLayerInterface__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectVsBroadPhaseLayerFilter + { + public JPH_ObjectVsBroadPhaseLayerFilter__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhaseLayerFilter + { + public JPH_BroadPhaseLayerFilter__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CollisionGroup + { + public JPH_RefConst mGroupFilter; + public uint mGroupID; + public uint mSubGroupID; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SubShapeID + { + public uint mValue; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SubShapeIDCreator + { + public JPH_SubShapeID mID; + public uint mCurrentBit; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RRayCast + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RShapeCast + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CollideShapeSettings + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TransformedShape + { + public JPH_Vec3 mShapePositionCOM; + public JPH_Quat mShapeRotation; + public JPH_RefConst mShape; + public JPH_Float3 mShapeScale; + public JPH_BodyID mBodyID; + public JPH_SubShapeIDCreator mSubShapeIDCreator; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Sphere + { + public JPH_Float3 mCenter; + public float mRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MotionProperties + { + public JPH_Vec3 mLinearVelocity; + public JPH_Vec3 mAngularVelocity; + public JPH_Vec3 mInvInertiaDiagonal; + public JPH_Quat mInertiaRotation; + public JPH_Float3 mForce; + public JPH_Float3 mTorque; + public float mInvMass; + public float mLinearDamping; + public float mAngularDamping; + public float mMaxLinearVelocity; + public float mMaxAngularVelocity; + public float mGravityFactor; + public uint mIndexInActiveBodies; + public uint mIslandIndex; + public byte mMotionQuality; + [MarshalAs(UnmanagedType.U1)] public bool mAllowSleeping; + public fixed byte/* JPH_Sphere, this length is invalid so must keep pointer and can't edit from C# */ mSleepTestSpheres[3]; + public float mSleepTestTimer; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Body + { + public JPH_Vec3 mPosition; + public JPH_Quat mRotation; + public JPH_AABox mBounds; + public JPH_RefConst mShape; + public JPH_MotionProperties* mMotionProperties; + public ulong mUserData; + public JPH_CollisionGroup mCollisionGroup; + public float mFriction; + public float mRestitution; + public JPH_BodyID mID; + public ushort mObjectLayer; + public JPH_BroadPhaseLayer mBroadPhaseLayer; + public byte mMotionType; + public std_atomic mFlags; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MutexArray + { + public JPH_MutexArray_MutexStorage* mMutexStorage; + public uint mNumMutexes; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MutexArray_MutexStorage + { + public MutexType mMutex; + public PhantomData _phantom_0; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyManager + { + public std_vector mBodies; + public uint mNumBodies; + public nuint mBodyIDFreeListStart; + public std_mutex mBodiesMutex; + public JPH_MutexArray mBodyMutexes; + public std_vector mBodySequenceNumbers; + public std_mutex mActiveBodiesMutex; + public JPH_BodyID* mActiveBodies; + public std_atomic mNumActiveBodies; + public uint mNumActiveCCDBodies; + public std_mutex mBodiesCacheInvalidMutex; + public std_vector mBodiesCacheInvalid; + public JPH_BodyActivationListener* mActivationListener; + public JPH_BroadPhaseLayerInterface* mBroadPhaseLayerInterface; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyManager_BodyStats + { + public uint mNumBodies; + public uint mMaxBodies; + public uint mNumBodiesStatic; + public uint mNumBodiesDynamic; + public uint mNumActiveBodiesDynamic; + public uint mNumBodiesKinematic; + public uint mNumActiveBodiesKinematic; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyLockInterface + { + public JPH_BodyLockInterface__bindgen_vtable* vtable_; + public JPH_BodyManager* mBodyManager; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyLockInterfaceNoLock + { + public JPH_BodyLockInterface _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyLockInterfaceLocking + { + public JPH_BodyLockInterface _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_OrientedBox + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhaseQuery + { + public JPH_BroadPhaseQuery__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhase + { + public JPH_BroadPhaseQuery _base; + public JPH_BodyManager* mBodyManager; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_NarrowPhaseQuery + { + public JPH_BodyLockInterface* mBodyLockInterface; + public JPH_BroadPhase* mBroadPhase; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SubShapeIDPair + { + public JPH_BodyID mBody1ID; + public JPH_SubShapeID mSubShapeID1; + public JPH_BodyID mBody2ID; + public JPH_SubShapeID mSubShapeID2; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactManifold + { + public JPH_Vec3 mBaseOffset; + public JPH_Vec3 mWorldSpaceNormal; + public float mPenetrationDepth; + public JPH_SubShapeID mSubShapeID1; + public JPH_SubShapeID mSubShapeID2; + public fixed ulong __bindgen_padding_0[1]; + public fixed byte/* UInt128, this length is invalid so must keep pointer and can't edit from C# */ mRelativeContactPointsOn1[65]; + public fixed byte/* UInt128, this length is invalid so must keep pointer and can't edit from C# */ mRelativeContactPointsOn2[65]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactSettings + { + public float mCombinedFriction; + public float mCombinedRestitution; + [MarshalAs(UnmanagedType.U1)] public bool mIsSensor; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactListener + { + public JPH_ContactListener__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LFHMAllocator + { + public byte* mObjectStore; + public uint mObjectStoreSizeBytes; + public std_atomic mWriteOffset; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LFHMAllocatorContext + { + public JPH_LFHMAllocator* mAllocator; + public uint mBlockSize; + public uint mBegin; + public uint mEnd; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LockFreeHashMap + { + public JPH_LFHMAllocator* mAllocator; + public std_atomic* mBuckets; + public uint mNumBuckets; + public uint mMaxBuckets; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyPair + { + public JPH_BodyID mBodyA; + public JPH_BodyID mBodyB; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_PhysicsMaterial + { + public JPH_SerializableObject _base; + public JPH_RefTarget _base_1; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexShapeSettings + { + public JPH_ShapeSettings _base; + public JPH_RefConst mMaterial; + public float mDensity; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexShape + { + public JPH_Shape _base; + public JPH_RefConst mMaterial; + public float mDensity; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexShape_Support + { + public JPH_ConvexShape_Support__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexShape_SupportBuffer + { + public fixed byte mData[4160]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SpringPart + { + public float mBias; + public float mSoftness; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StreamIn + { + public JPH_StreamIn__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StreamOut + { + public JPH_StreamOut__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StateRecorder + { + public JPH_StreamIn _base; + public JPH_StreamOut _base_1; + [MarshalAs(UnmanagedType.U1)] public bool mIsValidating; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_AxisConstraintPart + { + public JPH_Float3 mR1PlusUxAxis; + public JPH_Float3 mR2xAxis; + public JPH_Float3 mInvI1_R1PlusUxAxis; + public JPH_Float3 mInvI2_R2xAxis; + public float mEffectiveMass; + public JPH_SpringPart mSpringPart; + public float mTotalLambda; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager + { + public fixed byte/* JPH_ContactConstraintManager_ManifoldCache, this length is invalid so must keep pointer and can't edit from C# */ mCache[2]; + public int mCacheWriteIdx; + public JPH_PhysicsSettings* mPhysicsSettings; + public JPH_ContactListener* mContactListener; + public delegate* unmanaged[Cdecl] mCombineFriction; + public delegate* unmanaged[Cdecl] mCombineRestitution; + public JPH_ContactConstraintManager_ContactConstraint* mConstraints; + public uint mMaxConstraints; + public std_atomic mNumConstraints; + public JPH_PhysicsUpdateContext* mUpdateContext; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_ContactAllocator + { + public JPH_LFHMAllocatorContext _base; + public uint mNumBodyPairs; + public uint mNumManifolds; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_CachedContactPoint + { + public JPH_Float3 mPosition1; + public JPH_Float3 mPosition2; + public float mNonPenetrationLambda; + public fixed uint mFrictionLambda[2]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_CachedManifold + { + public uint mNextWithSameBodyPair; + public JPH_Float3 mContactNormal; + public std_atomic mFlags; + public ushort mNumContactPoints; + public fixed byte/* JPH_ContactConstraintManager_CachedContactPoint, this length is invalid so must keep pointer and can't edit from C# */ mContactPoints[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_CachedBodyPair + { + public JPH_Float3 mDeltaPosition; + public JPH_Float3 mDeltaRotation; + public uint mFirstCachedManifold; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_ManifoldCache + { + public JPH_LFHMAllocator mAllocator; + public JPH_LockFreeHashMap mCachedManifolds; + public JPH_LockFreeHashMap mCachedBodyPairs; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_WorldContactPoint + { + public JPH_AxisConstraintPart mNonPenetrationConstraint; + public JPH_AxisConstraintPart mFrictionConstraint1; + public JPH_AxisConstraintPart mFrictionConstraint2; + public JPH_ContactConstraintManager_CachedContactPoint* mContactPoint; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactConstraintManager_ContactConstraint + { + public JPH_Vec3 mWorldSpaceNormal; + public JPH_Body* mBody1; + public JPH_Body* mBody2; + public ulong mSortKey; + public float mCombinedFriction; + public float mCombinedRestitution; + public fixed ulong mContactPoints[101]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConstraintSettings + { + public JPH_SerializableObject _base; + public JPH_RefTarget _base_1; + [MarshalAs(UnmanagedType.U1)] public bool mEnabled; + public int mNumVelocityStepsOverride; + public int mNumPositionStepsOverride; + public float mDrawConstraintSize; + public ulong mUserData; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_Constraint + { + public JPH_Constraint__bindgen_vtable* vtable_; + public JPH_RefTarget _base; + public uint mConstraintIndex; + public int mNumVelocityStepsOverride; + public int mNumPositionStepsOverride; + [MarshalAs(UnmanagedType.U1)] public bool mEnabled; + public ulong mUserData; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConstraintManager + { + public std_vector mConstraints; + public std_mutex mConstraintsMutex; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_IslandBuilder + { + public JPH_IslandBuilder_BodyLink* mBodyLinks; + public uint* mConstraintLinks; + public uint* mContactLinks; + public JPH_BodyID* mBodyIslands; + public uint* mBodyIslandEnds; + public uint* mConstraintIslands; + public uint* mConstraintIslandEnds; + public uint* mContactIslands; + public uint* mContactIslandEnds; + public uint* mIslandsSorted; + public uint mMaxActiveBodies; + public uint mNumActiveBodies; + public uint mNumConstraints; + public uint mMaxContacts; + public uint mNumContacts; + public uint mNumIslands; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_IslandBuilder_BodyLink + { + public std_atomic mLinkedTo; + public uint mIslandIndex; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LargeIslandSplitter + { + public uint mNumActiveBodies; + public uint* mSplitMasks; + public uint* mContactAndConstaintsSplitIdx; + public uint* mContactAndConstraintIndices; + public uint mContactAndConstraintsSize; + public std_atomic mContactAndConstraintsNextFree; + public uint mNumSplitIslands; + public JPH_LargeIslandSplitter_Splits* mSplitIslands; + public std_atomic mNextSplitIsland; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LargeIslandSplitter_Split + { + public uint mContactBufferBegin; + public uint mContactBufferEnd; + public uint mConstraintBufferBegin; + public uint mConstraintBufferEnd; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_LargeIslandSplitter_Splits + { + public fixed byte/* JPH_LargeIslandSplitter_Split, this length is invalid so must keep pointer and can't edit from C# */ mSplits[32]; + public uint mIslandIndex; + public uint mNumSplits; + public int mNumIterations; + public int mNumVelocitySteps; + public int mNumPositionSteps; + public std_atomic mStatus; + public std_atomic mItemsProcessed; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_PhysicsUpdateContext + { + public JPH_PhysicsSystem* mPhysicsSystem; + public JPH_TempAllocator* mTempAllocator; + public JPH_JobSystem* mJobSystem; + public JPH_JobSystem_Barrier* mBarrier; + public float mStepDeltaTime; + public float mSubStepDeltaTime; + public float mWarmStartImpulseRatio; + [MarshalAs(UnmanagedType.U1)] public bool mUseLargeIslandSplitter; + public JPH_Constraint** mActiveConstraints; + public JPH_BodyPair* mBodyPairs; + public JPH_IslandBuilder* mIslandBuilder; + public std_vector mSteps; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_PhysicsStepListener + { + public fixed byte _unused[1]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_PhysicsSystem + { + public JPH_ObjectVsBroadPhaseLayerFilter* mObjectVsBroadPhaseLayerFilter; + public JPH_ObjectLayerPairFilter* mObjectLayerPairFilter; + public JPH_BodyManager mBodyManager; + public JPH_BodyLockInterfaceNoLock mBodyLockInterfaceNoLock; + public JPH_BodyLockInterfaceLocking mBodyLockInterfaceLocking; + public JPH_BodyInterface mBodyInterfaceNoLock; + public JPH_BodyInterface mBodyInterfaceLocking; + public JPH_NarrowPhaseQuery mNarrowPhaseQueryNoLock; + public JPH_NarrowPhaseQuery mNarrowPhaseQueryLocking; + public JPH_BroadPhase* mBroadPhase; + public JPH_PhysicsSettings mPhysicsSettings; + public JPH_ContactConstraintManager mContactManager; + public JPH_ConstraintManager mConstraintManager; + public JPH_IslandBuilder mIslandBuilder; + public JPH_LargeIslandSplitter mLargeIslandSplitter; + public std_mutex mStepListenersMutex; + public std_vector mStepListeners; + public JPH_Vec3 mGravity; + public float mPreviousSubStepDeltaTime; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BoxShapeSettings + { + public JPH_ConvexShapeSettings _base; + public JPH_Vec3 mHalfExtent; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BoxShape + { + public JPH_ConvexShape _base; + public JPH_Vec3 mHalfExtent; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SphereShapeSettings + { + public JPH_ConvexShapeSettings _base; + public float mRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_SphereShape + { + public JPH_ConvexShape _base; + public float mRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyCreationSettings + { + public JPH_Vec3 mPosition; + public JPH_Quat mRotation; + public JPH_Vec3 mLinearVelocity; + public JPH_Vec3 mAngularVelocity; + public ulong mUserData; + public ushort mObjectLayer; + public JPH_CollisionGroup mCollisionGroup; + public byte mMotionType; + [MarshalAs(UnmanagedType.U1)] public bool mAllowDynamicOrKinematic; + [MarshalAs(UnmanagedType.U1)] public bool mIsSensor; + [MarshalAs(UnmanagedType.U1)] public bool mUseManifoldReduction; + public byte mMotionQuality; + [MarshalAs(UnmanagedType.U1)] public bool mAllowSleeping; + public float mFriction; + public float mRestitution; + public float mLinearDamping; + public float mAngularDamping; + public float mMaxLinearVelocity; + public float mMaxAngularVelocity; + public float mGravityFactor; + public byte mOverrideMassProperties; + public float mInertiaMultiplier; + public fixed ulong __bindgen_padding_0[1]; + public JPH_MassProperties mMassPropertiesOverride; + public JPH_RefConst mShape; + public JPH_RefConst mShapePtr; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyActivationListener + { + public JPH_BodyActivationListener__bindgen_vtable* vtable_; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CapsuleShapeSettings + { + public JPH_ConvexShapeSettings _base; + public float mRadius; + public float mHalfHeightOfCylinder; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CapsuleShape + { + public JPH_ConvexShape _base; + public float mRadius; + public float mHalfHeightOfCylinder; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CompoundShapeSettings + { + public JPH_ShapeSettings _base; + public std_vector mSubShapes; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CompoundShape + { + public JPH_Shape _base; + public JPH_Vec3 mCenterOfMass; + public JPH_AABox mLocalBounds; + public std_vector mSubShapes; + public float mInnerRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexHullShapeSettings + { + public JPH_ConvexShapeSettings _base; + public std_vector mPoints; + public float mMaxConvexRadius; + public float mMaxErrorConvexRadius; + public float mHullTolerance; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ConvexHullShape + { + public JPH_ConvexShape _base; + public JPH_Vec3 mCenterOfMass; + public JPH_Mat44 mInertia; + public JPH_AABox mLocalBounds; + public std_vector mPoints; + public std_vector mFaces; + public std_vector mPlanes; + public std_vector mVertexIdx; + public float mConvexRadius; + public float mVolume; + public float mInnerRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CylinderShapeSettings + { + public JPH_ConvexShapeSettings _base; + public float mHalfHeight; + public float mRadius; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_CylinderShape + { + public JPH_ConvexShape _base; + public float mHalfHeight; + public float mRadius; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_DecoratedShapeSettings + { + public JPH_ShapeSettings _base; + public JPH_RefConst mInnerShape; + public JPH_RefConst mInnerShapePtr; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_DecoratedShape + { + public JPH_Shape _base; + public JPH_RefConst mInnerShape; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_HeightFieldShapeSettings + { + public JPH_ShapeSettings _base; + public JPH_Vec3 mOffset; + public JPH_Vec3 mScale; + public uint mSampleCount; + public uint mBlockSize; + public uint mBitsPerSample; + public std_vector mHeightSamples; + public std_vector mMaterialIndices; + public std_vector mMaterials; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_HeightFieldShape + { + public JPH_Shape _base; + public JPH_Vec3 mOffset; + public JPH_Vec3 mScale; + public uint mSampleCount; + public uint mBlockSize; + public byte mBitsPerSample; + public byte mSampleMask; + public ushort mMinSample; + public ushort mMaxSample; + public std_vector mRangeBlocks; + public std_vector mHeightSamples; + public std_vector mActiveEdges; + public std_vector mMaterials; + public std_vector mMaterialIndices; + public uint mNumBitsPerMaterialIndex; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ByteBuffer + { + public std_vector _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MeshShapeSettings + { + public JPH_ShapeSettings _base; + public std_vector mTriangleVertices; + public std_vector mIndexedTriangles; + public std_vector mMaterials; + public uint mMaxTrianglesPerLeaf; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MeshShape + { + public JPH_Shape _base; + public std_vector mMaterials; + public JPH_ByteBuffer mTree; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MutableCompoundShapeSettings + { + public JPH_CompoundShapeSettings _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_MutableCompoundShape + { + public JPH_CompoundShape _base; + public std_vector mSubShapeBounds; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_OffsetCenterOfMassShapeSettings + { + public JPH_DecoratedShapeSettings _base; + public JPH_Vec3 mOffset; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_OffsetCenterOfMassShape + { + public JPH_DecoratedShape _base; + public ulong __bindgen_padding_0; + public JPH_Vec3 mOffset; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RotatedTranslatedShapeSettings + { + public JPH_DecoratedShapeSettings _base; + public JPH_Vec3 mPosition; + public JPH_Quat mRotation; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_RotatedTranslatedShape + { + public JPH_DecoratedShape _base; + [MarshalAs(UnmanagedType.U1)] public bool mIsRotationIdentity; + public fixed ulong __bindgen_padding_0[1]; + public JPH_Vec3 mCenterOfMass; + public JPH_Quat mRotation; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ScaledShapeSettings + { + public JPH_DecoratedShapeSettings _base; + public JPH_Vec3 mScale; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ScaledShape + { + public JPH_DecoratedShape _base; + public ulong __bindgen_padding_0; + public JPH_Vec3 mScale; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StaticCompoundShapeSettings + { + public JPH_CompoundShapeSettings _base; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StaticCompoundShape + { + public JPH_CompoundShape _base; + public std_vector mNodes; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_StaticCompoundShape_Node + { + public fixed ushort mBoundsMinX[4]; + public fixed ushort mBoundsMinY[4]; + public fixed ushort mBoundsMinZ[4]; + public fixed ushort mBoundsMaxX[4]; + public fixed ushort mBoundsMaxY[4]; + public fixed ushort mBoundsMaxZ[4]; + public fixed uint mNodeProperties[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TaperedCapsuleShapeSettings + { + public JPH_ConvexShapeSettings _base; + public float mHalfHeightOfTaperedCylinder; + public float mTopRadius; + public float mBottomRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TaperedCapsuleShape + { + public JPH_ConvexShape _base; + public JPH_Vec3 mCenterOfMass; + public float mTopRadius; + public float mBottomRadius; + public float mTopCenter; + public float mBottomCenter; + public float mConvexRadius; + public float mSinAlpha; + public float mTanAlpha; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TriangleShapeSettings + { + public JPH_ConvexShapeSettings _base; + public JPH_Vec3 mV1; + public JPH_Vec3 mV2; + public JPH_Vec3 mV3; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_TriangleShape + { + public JPH_ConvexShape _base; + public JPH_Vec3 mV1; + public JPH_Vec3 mV2; + public JPH_Vec3 mV3; + public float mConvexRadius; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH___BroadPhaseLayer__ + { + public byte __value; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH___Vec3__ + { + public fixed float mF32[4]; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BroadPhaseLayerInterfaceMethods + { + public delegate* unmanaged[Cdecl] GetNumBroadPhaseLayers; + public delegate* unmanaged[Cdecl] GetBroadPhaseLayer; + public delegate* unmanaged[Cdecl] GetBroadPhaseLayerName; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectVsBroadPhaseLayerFilterMethods + { + public delegate* unmanaged[Cdecl] ShouldCollide; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ObjectLayerPairFilterMethods + { + public delegate* unmanaged[Cdecl] ShouldCollide; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_BodyActivationListenerMethods + { + public delegate* unmanaged[Cdecl] OnBodyActivated; + public delegate* unmanaged[Cdecl] OnBodyDeactivated; + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe partial struct JPH_ContactListenerMethods + { + public delegate* unmanaged[Cdecl] OnContactValidate; + public delegate* unmanaged[Cdecl] OnContactAdded; + public delegate* unmanaged[Cdecl] OnContactPersisted; + public delegate* unmanaged[Cdecl] OnContactRemoved; + } + + + internal struct PhantomData { } + internal struct KeyValue { } + internal struct _Traits { } + + internal struct _CharT { } + + // generics of std_pair<_Ty1, _Ty2> + internal struct _Ty1 { } + internal struct _Ty2 { } + // generics of std_pair<_T1, _T2> + internal struct _T1 { } + internal struct _T2 { } + // JPH_RefConst + internal struct T { } + // JPH_MutexArray_MutexStorage + internal struct MutexType { } + // __BindgenUnionField + internal struct __BindgenUnionField { } + + // tuple types + internal struct JPH_ObjectLayerFilter__bindgen_vtable { } + internal struct JPH_ObjectLayerPairFilter__bindgen_vtable { } + internal struct JPH_BodyFilter__bindgen_vtable { } + internal struct JPH_ObjectStream__bindgen_vtable { } + internal struct JPH_SerializableObject__bindgen_vtable { } + internal struct JPH_CollisionCollector__bindgen_vtable { } + internal struct JPH_ShapeFilter__bindgen_vtable { } + internal struct JPH_Shape__bindgen_vtable { } + internal struct JPH_BroadPhaseLayerInterface__bindgen_vtable { } + internal struct JPH_ObjectVsBroadPhaseLayerFilter__bindgen_vtable { } + internal struct JPH_BroadPhaseLayerFilter__bindgen_vtable { } + internal struct JPH_BodyLockInterface__bindgen_vtable { } + internal struct JPH_BroadPhaseQuery__bindgen_vtable { } + internal struct JPH_ContactListener__bindgen_vtable { } + internal struct JPH_StreamIn__bindgen_vtable { } + internal struct JPH_StreamOut__bindgen_vtable { } + internal struct JPH_Constraint__bindgen_vtable { } + internal struct JPH_JobSystem__bindgen_vtable { } + internal struct JPH_JobSystem_Barrier__bindgen_vtable { } + internal struct JPH_TempAllocator__bindgen_vtable { } + internal struct JPH_BodyActivationListener__bindgen_vtable { } + internal struct JPH_ConvexShape_Support__bindgen_vtable { } +}