Package com.github.stephengold.joltjni
Class PhysicsStepListenerContext
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.PhysicsStepListenerContext
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Context passed to a physics-step listener.
-
Constructor Summary
ConstructorsConstructorDescriptionPhysicsStepListenerContext(long contextVa) Instantiate a context with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the duration of the current step.booleanTest whether this is the first step.booleanTest whether this is the last step.Access the system being simulated.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
PhysicsStepListenerContext
public PhysicsStepListenerContext(long contextVa) Instantiate a context with the specified native object assigned but not owned.For use in custom contact listeners.
- Parameters:
contextVa- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getDeltaTime
public float getDeltaTime()Return the duration of the current step. The context is unaffected. (native attribute: mDeltaTime)- Returns:
- the duration (in seconds, >0)
-
getIsFirstStep
public boolean getIsFirstStep()Test whether this is the first step. The context is unaffected. (native attribute: mIsFirstStep)- Returns:
- true if it's the first step, otherwise false
-
getIsLastStep
public boolean getIsLastStep()Test whether this is the last step. The context is unaffected. (native attribute: mIsLastStep)- Returns:
- true if it's the last step, otherwise false
-
getPhysicsSystem
Access the system being simulated. The context is unaffected. (native attribute: mPhysicsSystem)- Returns:
- the pre-existing object, or
nullif not found
-