Package com.github.stephengold.joltjni
Class StateRecorderFilter
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.StateRecorderFilter
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
Determine which parts of a physics system should be saved.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldSaveBody(ConstBody body) Test whether the specified body should be saved.booleanshouldSaveConstraint(ConstConstraint constraint) Test whether the specified constraint should be saved.booleanshouldSaveContact(int bodyId1, int bodyId2) Test whether contacts between the specified bodies should be saved.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
shouldSaveBody
Test whether the specified body should be saved. Meant to be overridden.- Parameters:
body- the body to test (not null, unaffected)- Returns:
trueto save, otherwisefalse
-
shouldSaveConstraint
Test whether the specified constraint should be saved. Meant to be overridden.- Parameters:
constraint- the constraint to test (not null, unaffected)- Returns:
trueto save, otherwisefalse
-
shouldSaveContact
public boolean shouldSaveContact(int bodyId1, int bodyId2) Test whether contacts between the specified bodies should be saved. Meant to be overridden.- Parameters:
bodyId1- the ID of first bodybodyId2- the ID of 2nd body- Returns:
trueto save, otherwisefalse
-