Interface ConstPhysicsSystem

All Superinterfaces:
AutoCloseable, Comparable<JoltPhysicsObject>, ConstJoltPhysicsObject
All Known Implementing Classes:
PhysicsSystem

public interface ConstPhysicsSystem extends ConstJoltPhysicsObject
Read-only access to a PhysicsSystem.
  • Method Details

    • containsConstraint

      boolean containsConstraint(ConstConstraint constraint)
      Test whether the system contains the specified constraint. The system is unaffected.
      Parameters:
      constraint - the constraint to search for (not null, unaffected)
      Returns:
      true if found, otherwise false
    • getActiveBodies

      void getActiveBodies(EBodyType bodyType, BodyIdVector storeResult)
      Enumerate all bodies of the specified type to the specified vector.
      Parameters:
      bodyType - (not null)
      storeResult - storage for the result (not null)
    • getBodies

      void getBodies(BodyIdVector storeResult)
      Enumerate all bodies to the specified variable-length vector. The system is unaffected.
      Parameters:
      storeResult - storage for the result (not null)
    • getBodyActivationListener

      BodyActivationListener getBodyActivationListener()
      Access the system's BodyActivationListener.
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if none
    • getBodyLockInterface

      ConstBodyLockInterfaceLocking getBodyLockInterface()
      Access the system's BodyLockInterfaceLocking.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getBodyLockInterfaceNoLock

      ConstBodyLockInterfaceNoLock getBodyLockInterfaceNoLock()
      Access the system's BodyLockInterfaceNoLock.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getBounds

      AaBox getBounds()
      Generate a bounding box that contains all the bodies in the system. The system is unaffected.
      Returns:
      a new box
    • getBroadPhaseQuery

      ConstBroadPhaseQuery getBroadPhaseQuery()
      Access the system's interface for coarse collision queries.
      Returns:
      the pre-existing JVM object, or null if the system hasn't been initialized yet
    • getCombineFriction

      CombineFunction getCombineFriction()
      Access the combining function for friction.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getCombineRestitution

      CombineFunction getCombineRestitution()
      Access the combining function for restitutions.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getConstraints

      Constraints getConstraints()
      Enumerate all constraints in the system. The system is unaffected.
      Returns:
      a new object
    • getContactListener

      ContactListener getContactListener()
      Access the (application-provided) contact listener.
      Returns:
      the pre-existing instance, or null if none
    • getDefaultBroadPhaseLayerFilter

      DefaultBroadPhaseLayerFilter getDefaultBroadPhaseLayerFilter(int objectLayer)
      Generate a broad-phase layer filter using the current pair filter and the specified layer index.
      Parameters:
      objectLayer - the index of the object layer to use
      Returns:
      a new filter
    • getDefaultLayerFilter

      DefaultObjectLayerFilter getDefaultLayerFilter(int objectLayer)
      Generate an object layer filter using the current pair filter and the specified layer index.
      Parameters:
      objectLayer - the index of the object layer to use
      Returns:
      a new filter
    • getGravity

      Vec3 getGravity()
      Copy the gravity vector. The system is unaffected.
      Returns:
      a new acceleration vector (meters per second squared in system coordinates)
    • getMaxBodies

      int getMaxBodies()
      Return the maximum number of bodies the system supports. The system is unaffected.
      Returns:
      the count (≥0)
    • getNarrowPhaseQuery

      ConstNarrowPhaseQuery getNarrowPhaseQuery()
      Access the system's interface for fine collision queries.
      Returns:
      the pre-existing JVM object (not null)
    • getNarrowPhaseQueryNoLock

      ConstNarrowPhaseQuery getNarrowPhaseQueryNoLock()
      Access a version of the system's NarrowPhaseQuery that does not lock the bodies.
      Returns:
      the pre-existing JVM object (not null)
    • getNumActiveBodies

      int getNumActiveBodies(EBodyType bodyType)
      Count how many active bodies of the specified type there are in the body manager. The system is unaffected.
      Parameters:
      bodyType - which type of body to count (not null)
      Returns:
      the count (≥0, ≤maxBodies)
    • getNumBodies

      int getNumBodies()
      Count how many bodies there are in the body manager. The system is unaffected.
      Returns:
      the count (≥0, ≤maxBodies)
    • getObjectLayerPairFilter

      ConstObjectLayerPairFilter getObjectLayerPairFilter()
      Access the (application-provided) interface for testing whether 2 objects can collide, based on their object layers.
      Returns:
      the pre-existing instance, or null if none
    • getObjectVsBroadPhaseLayerFilter

      ConstObjectVsBroadPhaseLayerFilter getObjectVsBroadPhaseLayerFilter()
      Access the (application-provided) interface for testing whether an object can collide with a broad-phase layer.
      Returns:
      the pre-existing instance, or null if none
    • getPhysicsSettings

      PhysicsSettings getPhysicsSettings()
      Copy the system's settings. The system is unaffected.

      Different semantics from the native GetPhysicsSettings(), which returns a const reference, not a copy.

      Returns:
      a new JVM object with a new native object assigned
    • getSoftBodyContactListener

      SoftBodyContactListener getSoftBodyContactListener()
      Access the (application-provided) soft-body contact listener.
      Returns:
      the pre-existing instance, or null if none
    • saveState

      void saveState(StateRecorder recorder)
      Save the system's state to be replayed later.
      Parameters:
      recorder - where to save the state (not null)
    • saveState

      void saveState(StateRecorder recorder, int bitmask)
      Save the aspects of the system's state to be replayed later.
      Parameters:
      recorder - where to save the state (not null)
      bitmask - which aspects of the simulation to save
    • saveState

      void saveState(StateRecorder recorder, int bitmask, StateRecorderFilter filter)
      Save aspects of the system's state to be replayed later.
      Parameters:
      recorder - where to save the state (not null)
      bitmask - which aspects of the simulation to save
      filter - select which parts to save (unaffected) or null