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<ConstJoltPhysicsObject>
- Direct Known Subclasses:
BodyLockInterfaceLocking,BodyLockInterfaceNoLock
An interface to a
PhysicsSystem that is aware of body locking.-
Method Summary
Modifier and TypeMethodDescriptionAccess the underlyingPhysicsSystem.abstract SharedMutexlockRead(ConstBodyId bodyId) Lock the specified body for reading.abstract SharedMutexlockWrite(ConstBodyId bodyId) Lock the specified body for writing.abstract voidunlockRead(SharedMutex mutex) Unlock the specified mutex, which was created to read a body.abstract voidunlockWrite(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, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
getSystem
Access the underlyingPhysicsSystem.- Returns:
- the pre-existing instance
-
lockRead
Lock the specified body for reading.- Parameters:
bodyId- the body to read (not null, unaffected)- Returns:
- a new mutex
-
lockWrite
Lock the specified body for writing.- Parameters:
bodyId- the body to write (not null, unaffected)- Returns:
- a new mutex
-