//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
public static partial class Jolt
{
public static unsafe partial class PInvoke
{
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_Create")]
public static partial PhysicsSystem PhysicsSystem_Create();
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_Destroy")]
public static partial void PhysicsSystem_Destroy(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_Init")]
public static partial void PhysicsSystem_Init(
PhysicsSystem self,
uint maxBodies,
uint numBodyMutexes,
uint maxBodyPairs,
uint maxContactConstraints,
BroadPhaseLayerInterface broadPhaseLayerInterface,
ObjectVsBroadPhaseLayerFilter objectVsBroadPhaseLayerFilter,
ObjectLayerPairFilter objectLayerPairFilter
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetBodyActivationListener")]
public static partial void PhysicsSystem_SetBodyActivationListener(
PhysicsSystem self,
BodyActivationListener listener
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyActivationListener")]
public static partial BodyActivationListener PhysicsSystem_GetBodyActivationListener(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetContactListener")]
public static partial void PhysicsSystem_SetContactListener(PhysicsSystem self, ContactListener listener);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetContactListener")]
public static partial ContactListener PhysicsSystem_GetContactListener(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetSoftBodyContactListener")]
public static partial void PhysicsSystem_SetSoftBodyContactListener(
PhysicsSystem self,
SoftBodyContactListener listener
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetSoftBodyContactListener")]
public static partial SoftBodyContactListener PhysicsSystem_GetSoftBodyContactListener(PhysicsSystem self);
///
///
/// Set the function that combines the friction of two bodies and returns it Default method is the
/// geometric mean: sqrt(friction1 * friction2).
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:76
///
/// void SetCombineFriction(ContactConstraintManager::CombineFunction inCombineFriction)
///
///
///
///
/// combineFriction: The callback is invoked from native code: it must be a static method marked
/// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])], and userData is passed back to it
/// verbatim. Jolt calls it without a null check, so null is rejected.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetCombineFriction")]
public static partial void PhysicsSystem_SetCombineFriction(
PhysicsSystem self,
delegate* unmanaged[Cdecl]
combineFriction
);
///
///
/// Set the function that combines the restitution of two bodies and returns it Default method is
/// max(restitution1, restitution1)
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:81
///
/// void SetCombineRestitution(ContactConstraintManager::CombineFunction inCombineRestitution)
///
///
///
///
/// combineRestitution: The callback is invoked from native code: it must be a static method marked
/// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])], and userData is passed back to it
/// verbatim. Jolt calls it without a null check, so null is rejected.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetCombineRestitution")]
public static partial void PhysicsSystem_SetCombineRestitution(
PhysicsSystem self,
delegate* unmanaged[Cdecl] combineRestitution
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetSimShapeFilter")]
public static partial void PhysicsSystem_SetSimShapeFilter(PhysicsSystem self, SimShapeFilter shapeFilter);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetSimShapeFilter")]
public static partial SimShapeFilter PhysicsSystem_GetSimShapeFilter(PhysicsSystem self);
///
///
/// Advanced use only: Default function that is used to collide two bodies during simulation.
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:108
///
/// static void sDefaultSimCollideBodyVsBody(const Body &inBody1, const Body &inBody2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, CollideShapeSettings &ioCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter)
///
///
///
///
/// Collects every hit into defaultsimcollidebodyvsbodyresults, which you allocate and size. Returns how
/// many were written; totalHits is how many the query found, so a larger span is needed when it exceeds
/// the span's length.
///
///
/// Pass default for shapeFilter to filter nothing out.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DefaultSimCollideBodyVsBody")]
public static partial uint PhysicsSystem_DefaultSimCollideBodyVsBody(
Body body1,
Body body2,
in float4x4 centerOfMassTransform1,
in float4x4 centerOfMassTransform2,
CollideShapeSettings collideShapeSettings,
CollideShapeResult* buffer,
uint capacity,
ShapeFilter shapeFilter
);
///
///
/// Advanced use only: Default function that is used to collide two bodies during simulation.
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:108
///
/// static void sDefaultSimCollideBodyVsBody(const Body &inBody1, const Body &inBody2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, CollideShapeSettings &ioCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter)
///
///
///
///
/// Keeps only the closest (or deepest) hit. Returns false, and writes a native default-constructed
/// result (e.g. RayCastResult's fraction is 1 + epsilon), when nothing was hit.
///
///
/// Pass default for shapeFilter to filter nothing out.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DefaultSimCollideBodyVsBodyClosest")]
public static partial uint PhysicsSystem_DefaultSimCollideBodyVsBodyClosest(
Body body1,
Body body2,
in float4x4 centerOfMassTransform1,
in float4x4 centerOfMassTransform2,
CollideShapeSettings collideShapeSettings,
out CollideShapeResult result,
ShapeFilter shapeFilter
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetPhysicsSettings")]
public static partial void PhysicsSystem_SetPhysicsSettings(
PhysicsSystem self,
in PhysicsSettings settings
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetPhysicsSettings")]
public static partial void PhysicsSystem_GetPhysicsSettings(
PhysicsSystem self,
out PhysicsSettings outResult
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyInterface")]
public static partial BodyInterface PhysicsSystem_GetBodyInterface(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyInterfaceNoLock")]
public static partial BodyInterface PhysicsSystem_GetBodyInterfaceNoLock(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBroadPhaseQuery")]
public static partial BroadPhaseQuery PhysicsSystem_GetBroadPhaseQuery(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetNarrowPhaseQuery")]
public static partial NarrowPhaseQuery PhysicsSystem_GetNarrowPhaseQuery(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetNarrowPhaseQueryNoLock")]
public static partial NarrowPhaseQuery PhysicsSystem_GetNarrowPhaseQueryNoLock(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_AddConstraint")]
public static partial void PhysicsSystem_AddConstraint(PhysicsSystem self, Constraint constraint);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_RemoveConstraint")]
public static partial void PhysicsSystem_RemoveConstraint(PhysicsSystem self, Constraint constraint);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_AddConstraints")]
public static partial void PhysicsSystem_AddConstraints(
PhysicsSystem self,
Constraint* constraints,
int number
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_RemoveConstraints")]
public static partial void PhysicsSystem_RemoveConstraints(
PhysicsSystem self,
Constraint* constraints,
int number
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetConstraints")]
public static partial nint PhysicsSystem_GetConstraints(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_OptimizeBroadPhase")]
public static partial void PhysicsSystem_OptimizeBroadPhase(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_AddStepListener")]
public static partial void PhysicsSystem_AddStepListener(PhysicsSystem self, PhysicsStepListener listener);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_RemoveStepListener")]
public static partial void PhysicsSystem_RemoveStepListener(
PhysicsSystem self,
PhysicsStepListener listener
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_Update")]
public static partial PhysicsUpdateError PhysicsSystem_Update(
PhysicsSystem self,
float deltaTime,
int collisionSteps,
TempAllocator tempAllocator,
JobSystem jobSystem
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SaveState")]
public static partial void PhysicsSystem_SaveState(
PhysicsSystem self,
StateRecorder stream,
StateRecorderState state,
StateRecorderFilter filter
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_RestoreState")]
public static partial Brutal.Bool8 PhysicsSystem_RestoreState(
PhysicsSystem self,
StateRecorder stream,
StateRecorderFilter filter
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SaveBodyState")]
public static partial void PhysicsSystem_SaveBodyState(PhysicsSystem self, Body body, StateRecorder stream);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_RestoreBodyState")]
public static partial void PhysicsSystem_RestoreBodyState(
PhysicsSystem self,
Body body,
StateRecorder stream
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DrawBodies")]
public static partial void PhysicsSystem_DrawBodies(
PhysicsSystem self,
in BodyManager.DrawSettings settings,
DebugRenderer renderer,
BodyDrawFilter bodyFilter
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DrawConstraints")]
public static partial void PhysicsSystem_DrawConstraints(PhysicsSystem self, DebugRenderer renderer);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DrawConstraintLimits")]
public static partial void PhysicsSystem_DrawConstraintLimits(PhysicsSystem self, DebugRenderer renderer);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_DrawConstraintReferenceFrame")]
public static partial void PhysicsSystem_DrawConstraintReferenceFrame(
PhysicsSystem self,
DebugRenderer renderer
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetGravity")]
public static partial void PhysicsSystem_SetGravity(PhysicsSystem self, float3 gravity);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetGravity")]
public static partial float3 PhysicsSystem_GetGravity(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyLockInterfaceNoLock")]
public static partial BodyLockInterfaceNoLock PhysicsSystem_GetBodyLockInterfaceNoLock(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyLockInterface")]
public static partial BodyLockInterfaceLocking PhysicsSystem_GetBodyLockInterface(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBroadPhaseLayerInterface")]
public static partial BroadPhaseLayerInterface PhysicsSystem_GetBroadPhaseLayerInterface(
PhysicsSystem self
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetObjectVsBroadPhaseLayerFilter")]
public static partial ObjectVsBroadPhaseLayerFilter PhysicsSystem_GetObjectVsBroadPhaseLayerFilter(
PhysicsSystem self
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetObjectLayerPairFilter")]
public static partial ObjectLayerPairFilter PhysicsSystem_GetObjectLayerPairFilter(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetDefaultBroadPhaseLayerFilter")]
public static partial DefaultBroadPhaseLayerFilter PhysicsSystem_GetDefaultBroadPhaseLayerFilter(
PhysicsSystem self,
ushort layer
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetDefaultLayerFilter")]
public static partial DefaultObjectLayerFilter PhysicsSystem_GetDefaultLayerFilter(
PhysicsSystem self,
ushort layer
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetNumBodies")]
public static partial uint PhysicsSystem_GetNumBodies(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetNumActiveBodies")]
public static partial uint PhysicsSystem_GetNumActiveBodies(PhysicsSystem self, BodyType type);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetMaxBodies")]
public static partial uint PhysicsSystem_GetMaxBodies(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodyStats")]
public static partial void PhysicsSystem_GetBodyStats(
PhysicsSystem self,
out BodyManager.BodyStats outResult
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodies")]
public static partial void PhysicsSystem_GetBodies(PhysicsSystem self, out nint bodyIDs);
///
///
/// Get copy of the list of all bodies under protection of a lock.
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:235
///
/// void GetBodies(BodyIDVector &outBodyIDs) const
///
///
///
///
/// Get copy of the list of all bodies under protection of a lock.
/// @param outBodyIDs On return, this will contain the list of BodyIDs
///
///
/// Copies the contents into results, which you allocate and size - the allocation-free form of the
/// NativeArray overload beside this one. Returns how many elements were written; totalHits is how many
/// there were, so a larger span is needed when it exceeds the span's length.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBodies_2")]
public static partial uint PhysicsSystem_GetBodies_2(PhysicsSystem self, uint* buffer, uint capacity);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetActiveBodies")]
public static partial void PhysicsSystem_GetActiveBodies(
PhysicsSystem self,
BodyType type,
out nint bodyIDs
);
///
///
/// Get copy of the list of active bodies under protection of a lock.
///
///
/// C++:
/// Jolt/Physics/PhysicsSystem.h:240
///
/// void GetActiveBodies(EBodyType inType, BodyIDVector &outBodyIDs) const
///
///
///
///
/// Get copy of the list of active bodies under protection of a lock.
/// @param inType The type of bodies to get
/// @param outBodyIDs On return, this will contain the list of BodyIDs
///
///
/// Copies the contents into results, which you allocate and size - the allocation-free form of the
/// NativeArray overload beside this one. Returns how many elements were written; totalHits is how many
/// there were, so a larger span is needed when it exceeds the span's length.
///
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetActiveBodies_2")]
public static partial uint PhysicsSystem_GetActiveBodies_2(
PhysicsSystem self,
BodyType type,
uint* buffer,
uint capacity
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_WereBodiesInContact")]
public static partial Brutal.Bool8 PhysicsSystem_WereBodiesInContact(
PhysicsSystem self,
uint body1ID,
uint body2ID
);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetBounds")]
public static partial AABox PhysicsSystem_GetBounds(PhysicsSystem self);
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetMaxBodiesLimit")]
public static partial uint PhysicsSystem_GetMaxBodiesLimit();
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetMaxBodyPairsLimit")]
public static partial uint PhysicsSystem_GetMaxBodyPairsLimit();
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetMaxContactConstraintsLimit")]
public static partial uint PhysicsSystem_GetMaxContactConstraintsLimit();
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_GetDrawMotionQualityLinearCast")]
public static partial Brutal.Bool8 PhysicsSystem_GetDrawMotionQualityLinearCast();
///
[LibraryImport("jolt", EntryPoint = "PhysicsSystem_SetDrawMotionQualityLinearCast")]
public static partial void PhysicsSystem_SetDrawMotionQualityLinearCast(Brutal.Bool8 value);
}
}
}