java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BroadPhaseQuery
com.github.stephengold.joltjni.BroadPhase
- All Implemented Interfaces:
ConstBroadPhaseQuery,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
BroadPhaseBruteForce,BroadPhaseQuadTree
Coarse collision-detection phase to quickly eliminate body pairs that cannot
collide.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBodiesAbort(BodyIdArray bodyIds, int numBodies, long addState) Abort adding bodies to the phase.voidaddBodiesAbort(BodyIdArray bodyIds, long addState) Abort adding bodies to the phase.voidaddBodiesFinalize(BodyIdArray bodyIds, int numBodies, long addState) Finish adding bodies to the phase.voidaddBodiesFinalize(BodyIdArray bodyIds, long addState) Finish adding bodies to the phase.longaddBodiesPrepare(BodyIdArray bodyIds) Prepare to add a batch of bodies to the phase.longaddBodiesPrepare(BodyIdArray bodyIds, int numBodies) Prepare to add a batch of bodies to the phase.voidinit(BodyManager manager, ConstBroadPhaseLayerInterface map) Initialize the phase.voidnotifyBodiesAabbChanged(BodyIdArray bodyIds, int numBodies) Invoke whenever the bounding boxes of some bodies change.voidnotifyBodiesAabbChanged(BodyIdArray bodyIds, int numBodies, boolean takeLock) Invoke whenever the bounding boxes of some bodies change.voidoptimize()Optimize the phase after adding objects.voidremoveBodies(BodyIdArray bodyIds, int numBodies) Remove multiple bodies from the phase.Methods inherited from class com.github.stephengold.joltjni.BroadPhaseQuery
castAaBox, castAaBox, castAaBox, castRay, castRay, castRay, collideAaBox, collideAaBox, collideAaBox, collideOrientedBox, collideOrientedBox, collideOrientedBox, collidePoint, collidePoint, collidePoint, collideSphere, collideSphere, collideSphere, getSystemMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
addBodiesAbort
Abort adding bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, unmodified since the handle was created)addState- the handle returned byaddBodiesPrepare()
-
addBodiesAbort
Abort adding bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, unmodified since the handle was created)numBodies- the number of bodies to be added (≥0)addState- the handle returned byaddBodiesPrepare()
-
addBodiesFinalize
Finish adding bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, unmodified since the handle was created)addState- the handle returned byaddBodiesPrepare()
-
addBodiesFinalize
Finish adding bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, unmodified since the handle was created)numBodies- the number of bodies to be added (≥0)addState- the handle returned byaddBodiesPrepare()
-
addBodiesPrepare
Prepare to add a batch of bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, possibly shuffled)- Returns:
- a handle to be passed to
addBodiesFinalize()oraddBodiesAbort()
-
addBodiesPrepare
Prepare to add a batch of bodies to the phase.- Parameters:
bodyIds- the IDs of the bodies to be added (not null, possibly shuffled)numBodies- the number of bodies to be added (≥0)- Returns:
- a handle to be passed to
addBodiesFinalize()oraddBodiesAbort()
-
init
Initialize the phase.- Parameters:
manager- the manager to use (not null)map- the desired map from object layers to broad-phase layers (not null, alias created)
-
optimize
public void optimize()Optimize the phase after adding objects. -
notifyBodiesAabbChanged
Invoke whenever the bounding boxes of some bodies change.- Parameters:
bodyIds- the IDs of the bodies to be notified (not null)numBodies- the number of bodies to be notified (≥0)
-
notifyBodiesAabbChanged
Invoke whenever the bounding boxes of some bodies change.- Parameters:
bodyIds- the IDs of the bodies to be notified (not null)numBodies- the number of bodies to be notified (≥0)takeLock-trueto acquire a lock, otherwisefalse
-
removeBodies
Remove multiple bodies from the phase.- Parameters:
bodyIds- the IDs of the bodies to be removed (not null, possibly shuffled)numBodies- the number of bodies to be removed (≥0)
-