Package com.github.stephengold.joltjni
Class BodyLockInterface
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BodyLockInterface
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
BodyLockInterfaceLocking
,BodyLockInterfaceNoLock
An interface to a
PhysicsSystem
that is aware of body locking.-
Method Summary
Modifier and TypeMethodDescriptionAccess the underlyingPhysicsSystem
.abstract SharedMutex
lockRead
(int bodyId) Lock the specified body for reading.abstract SharedMutex
lockWrite
(int bodyId) Lock the specified body for writing.abstract void
unlockRead
(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.abstract void
unlockWrite
(SharedMutex mutex) Unlock the specified mutex, which was created to write a body.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
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
-