Interface ConstBodyLockInterface
- All Superinterfaces:
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.void
unlockRead
(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.void
unlockWrite
(SharedMutex mutex) Unlock the specified mutex, which was created to write a body.Methods inherited from interface java.lang.Comparable
compareTo
Methods 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
-