Class BatchBodyInterface

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class BatchBodyInterface extends BodyInterface
Extended interface of BodyInterface providing additional batch-based query operations.

This interface inherits all operations from BodyInterface and adds methods that allow performing multiple body queries in a single call.

The primary purpose of these operations is to reduce the number of JNI calls by grouping multiple body interactions into one native invocation.

  • Method Details

    • areActive

      public void areActive(BodyIdArray bodyIds, ByteBuffer storeStatus)
      Test whether the specified bodies are active.
      Parameters:
      bodyIds - the IDs of the bodies to test (not null, unaffected)
      storeStatus - storage for the statuses (not null, 1 for active, 0 for inactive, modified)
    • areAdded

      public void areAdded(BodyIdArray bodyIds, ByteBuffer storeStatus)
      Test whether the specified bodies are added to the system.
      Parameters:
      bodyIds - the IDs of the bodies to search for (not null, unaffected)
      storeStatus - storage for the statuses (not null, 1 for added, 0 for not added, modified)
    • areSensors

      public void areSensors(BodyIdArray bodyIds, ByteBuffer storeStatus)
      Test whether the specified bodies are sensors.
      Parameters:
      bodyIds - the IDs of the bodies to test (not null, unaffected)
      storeStatus - storage for the statuses (not null, 1 for sensor, 0 for non-sensor, modified)
    • getAngularVelocities

      public void getAngularVelocities(BodyIdArray bodyIds, FloatBuffer storeVelocities)
      Copy the angular velocities of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeVelocities - storage for the velocities (not null, interleaved X,Y,Z, capacity≥3*numBodies, modified)
    • getBodyTypes

      public void getBodyTypes(BodyIdArray bodyIds, ByteBuffer storeTypes)
      Return the types of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeTypes - storage for the ordinals (not null, capacity≥numBodies, modified)
    • getCenterOfMassPositions

      public void getCenterOfMassPositions(BodyIdArray bodyIds, DoubleBuffer storePositions)
      Locate the centers of mass of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to locate (not null, unaffected)
      storePositions - storage for the locations (not null, interleaved X,Y,Z, capacity≥3*numBodies, modified)
    • getCenterOfMassTransforms

      public void getCenterOfMassTransforms(BodyIdArray bodyIds, RMat44Array storeMatrices)
      Return the center-of-mass transforms of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to locate (not null, unaffected)
      storeMatrices - storage for the matrices (not null, modified)
    • getFrictions

      public void getFrictions(BodyIdArray bodyIds, FloatBuffer storeFrictions)
      Return the friction ratios of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeFrictions - storage for the values (not null, capacity≥numBodies, modified)
    • getGravityFactors

      public void getGravityFactors(BodyIdArray bodyIds, FloatBuffer storeFactors)
      Return the gravity factors of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeFactors - storage for the values (not null, capacity≥numBodies, modified)
    • getInverseInertias

      public void getInverseInertias(BodyIdArray bodyIds, Mat44Array storeMatrices)
      Copy the inverses of the inertia tensors in system coordinates.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeMatrices - storage for the matrices (not null, modified)
    • getLinearVelocities

      public void getLinearVelocities(BodyIdArray bodyIds, FloatBuffer storeVelocities)
      Copy the linear velocities of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeVelocities - storage for the velocities (not null, interleaved X,Y,Z, capacity≥3*numBodies, modified)
    • getMotionQualities

      public void getMotionQualities(BodyIdArray bodyIds, ByteBuffer storeQualities)
      Return the motion qualities of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeQualities - storage for the ordinals (not null, capacity≥numBodies, modified)
    • getMotionTypes

      public void getMotionTypes(BodyIdArray bodyIds, ByteBuffer storeTypes)
      Return the motion types of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeTypes - storage for the ordinals (not null, capacity≥numBodies, modified)
    • getObjectLayers

      public void getObjectLayers(BodyIdArray bodyIds, IntBuffer storeLayers)
      Return the object layers of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeLayers - storage for the layers (not null, capacity≥numBodies, modified)
    • getPositions

      public void getPositions(BodyIdArray bodyIds, DoubleBuffer storeLocations)
      Copy the locations of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to locate (not null, unaffected)
      storeLocations - storage for the locations (not null, interleaved X,Y,Z, capacity≥3*numBodies, modified)
    • getRestitutions

      public void getRestitutions(BodyIdArray bodyIds, FloatBuffer storeRestitutions)
      Return the restitution ratios of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies to query (not null, unaffected)
      storeRestitutions - storage for the values (not null, capacity≥numBodies, modified)
    • getRotations

      public void getRotations(BodyIdArray bodyIds, FloatBuffer storeOrientations)
      Copy the orientations of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeOrientations - storage for the rotations (not null, interleaved X,Y,Z,W, capacity≥4*numBodies, modified)
    • getShapes

      public void getShapes(BodyIdArray bodyIds, ShapeRefCArray storeShapes)
      Access the shapes of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeShapes - storage for the references (not null, modified)
    • getTransformedShapes

      public void getTransformedShapes(BodyIdArray bodyIds, TransformedShapeArray storeShapes)
      Generate transformed shapes for the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeShapes - storage for the transformed shapes (not null, modified)
    • getUseManifoldReductions

      public void getUseManifoldReductions(BodyIdArray bodyIds, ByteBuffer storeStatus)
      Test whether manifold reduction is enabled for the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeStatus - storage for the statuses (not null, 1 for enabled, 0 for disabled, capacity≥numBodies, modified)
    • getUserData

      public void getUserData(BodyIdArray bodyIds, LongBuffer storeData)
      Return the user data of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      storeData - storage for the values (not null, capacity≥numBodies, modified)
    • setAngularVelocities

      public void setAngularVelocities(BodyIdArray bodyIds, FloatBuffer velocities)
      Alter the angular velocities of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      velocities - the desired velocities (not null, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)
    • setFrictions

      public void setFrictions(BodyIdArray bodyIds, FloatBuffer frictions)
      Alter the friction ratios of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      frictions - the desired values (not null, capacity≥numBodies)
    • setGravityFactors

      public void setGravityFactors(BodyIdArray bodyIds, FloatBuffer factors)
      Alter the gravity factors of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      factors - the desired values (not null, capacity≥numBodies, unaffected)
    • setLinearVelocities

      public void setLinearVelocities(BodyIdArray bodyIds, FloatBuffer velocities)
      Alter the linear velocities of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      velocities - the desired velocities (not null, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)
    • setObjectLayers

      public void setObjectLayers(BodyIdArray bodyIds, IntBuffer layers)
      Alter the object layers of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      layers - the desired layers (not null, capacity≥numBodies, unaffected)
    • setPositions

      public void setPositions(BodyIdArray bodyIds, DoubleBuffer locations, EActivation activation)
      Relocate the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      locations - the desired locations (not null, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)
      activation - whether to activate the bodies (not null)
    • setRestitutions

      public void setRestitutions(BodyIdArray bodyIds, FloatBuffer restitutions)
      Alter the restitution ratios of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      restitutions - the desired values (not null, capacity≥numBodies, unaffected)
    • setUserData

      public void setUserData(BodyIdArray bodyIds, LongBuffer data)
      Alter the user data of the specified bodies.
      Parameters:
      bodyIds - the IDs of the bodies (not null, unaffected)
      data - the desired values (not null, capacity≥numBodies, unaffected)