Class PhysicsStepListenerContext

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.PhysicsStepListenerContext
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class PhysicsStepListenerContext extends JoltPhysicsObject
Context passed to a physics-step listener.
  • 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

      public PhysicsSystem getPhysicsSystem()
      Access the system being simulated. The context is unaffected. (native attribute: mPhysicsSystem)
      Returns:
      the pre-existing object, or null if not found