//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:25
///
/// class BroadPhase : public BroadPhaseQuery
///
///
///
///
/// Used to do coarse collision detection operations to quickly prune out bodies that will not collide.
///
///
[InteropHandle]
public readonly partial struct BroadPhase
{
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:44
///
/// struct UpdateState { void *mData[4]; }
///
///
///
///
/// Context used during broadphase update
///
///
[StructLayout(LayoutKind.Explicit, Size = 32)]
public struct UpdateState
{
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:44
///
/// void *mData[4]
///
///
///
///
/// Context used during broadphase update
///
///
[FieldOffset(0)]
public nint_4 mData;
}
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:32
///
/// virtual void Init(BodyManager *inBodyManager, const BroadPhaseLayerInterface &inLayerInterface)
///
///
///
///
/// 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.
///
///
public void Init(BodyManager bodyManager, BroadPhaseLayerInterface layerInterface) => Jolt.PInvoke.BroadPhase_Init(this, bodyManager, layerInterface);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:35
///
/// virtual void Optimize()
///
///
///
///
/// Should be called after many objects have been inserted to make the broadphase more efficient, usually
/// done on startup only
///
///
public void Optimize() => Jolt.PInvoke.BroadPhase_Optimize(this);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:38
///
/// virtual void FrameSync()
///
///
///
///
/// Must be called just before updating the broadphase when none of the body mutexes are locked
///
///
public void FrameSync() => Jolt.PInvoke.BroadPhase_FrameSync(this);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:41
///
/// virtual void LockModifications()
///
///
///
///
/// Must be called before UpdatePrepare to prevent modifications from being made to the tree
///
///
public void LockModifications() => Jolt.PInvoke.BroadPhase_LockModifications(this);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:54
///
/// virtual void UnlockModifications()
///
///
///
///
/// Must be called after UpdateFinalize to allow modifications to the broadphase
///
///
public void UnlockModifications() => Jolt.PInvoke.BroadPhase_UnlockModifications(this);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:75
///
/// virtual void RemoveBodies(BodyID *ioBodies, int inNumber) = 0
///
///
///
///
/// Remove inNumber bodies in ioBodies from the broadphase.
/// ioBodies may be shuffled around by this function.
///
///
public unsafe void RemoveBodies(Ptr bodies, int number) => Jolt.PInvoke.BroadPhase_RemoveBodies(this, bodies, number);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:79
///
/// virtual void NotifyBodiesAABBChanged(BodyID *ioBodies, int inNumber, bool inTakeLock = true) = 0
///
///
///
///
/// Call whenever the aabb of a body changes (can change order of ioBodies array)
/// inTakeLock should be false if we're between LockModifications/UnlockModifications, in which case care needs to be taken to not call this between UpdatePrepare/UpdateFinalize
///
///
public unsafe void NotifyBodiesAABBChanged(Ptr bodies, int number, bool takeLock) => Jolt.PInvoke.BroadPhase_NotifyBodiesAABBChanged(this, bodies, number, takeLock);
///
///
/// C++:
/// Jolt/Physics/Collision/BroadPhase/BroadPhase.h:82
///
/// virtual void NotifyBodiesLayerChanged(BodyID *ioBodies, int inNumber) = 0
///
///
///
///
/// Call whenever the layer (and optionally the aabb as well) of a body changes (can change order of
/// ioBodies array)
///
///
public unsafe void NotifyBodiesLayerChanged(Ptr bodies, int number) => Jolt.PInvoke.BroadPhase_NotifyBodiesLayerChanged(this, bodies, number);
public static implicit operator BroadPhaseQuery(BroadPhase value) => Jolt.PInvoke.BroadPhase_AsBroadPhaseQuery(value);
}
}