Interface ConstBodyLockInterface
- All Superinterfaces:
AutoCloseable,Comparable<JoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Subinterfaces:
ConstBodyLockInterfaceLocking,ConstBodyLockInterfaceNoLock
- All Known Implementing Classes:
BodyLockInterface,BodyLockInterfaceLocking,BodyLockInterfaceNoLock
Read-only access to a
BodyLockInterface. (native type: const
BodyLockInterface)-
Method Summary
Modifier and TypeMethodDescriptionAccess the underlyingPhysicsSystem.lockRead(int bodyId) Lock the specified body for reading.lockWrite(int bodyId) Lock the specified body for writing.voidunlockRead(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.voidunlockWrite(SharedMutex mutex) Unlock the specified mutex, which was created to write a body.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
getSystem
PhysicsSystem getSystem()Access the underlyingPhysicsSystem.- Returns:
- the pre-existing instance
-
lockRead
Lock the specified body for reading.- Parameters:
bodyId- the ID of the body to read- Returns:
- a new mutex
-
lockWrite
Lock the specified body for writing.- Parameters:
bodyId- the ID of the body to write- Returns:
- a new mutex
-