Package com.github.stephengold.joltjni
Class BatchBodyInterface
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.BodyInterface
com.github.stephengold.joltjni.BatchBodyInterface
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
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 Summary
Modifier and TypeMethodDescriptionvoidareActive(BodyIdArray bodyIds, ByteBuffer storeStatus) Test whether the specified bodies are active.voidareAdded(BodyIdArray bodyIds, ByteBuffer storeStatus) Test whether the specified bodies are added to the system.voidareSensors(BodyIdArray bodyIds, ByteBuffer storeStatus) Test whether the specified bodies are sensors.voidgetAngularVelocities(BodyIdArray bodyIds, FloatBuffer storeVelocities) Copy the angular velocities of the specified bodies.voidgetBodyTypes(BodyIdArray bodyIds, ByteBuffer storeTypes) Return the types of the specified bodies.voidgetCenterOfMassPositions(BodyIdArray bodyIds, DoubleBuffer storePositions) Locate the centers of mass of the specified bodies.voidgetCenterOfMassTransforms(BodyIdArray bodyIds, RMat44Array storeMatrices) Return the center-of-mass transforms of the specified bodies.voidgetFrictions(BodyIdArray bodyIds, FloatBuffer storeFrictions) Return the friction ratios of the specified bodies.voidgetGravityFactors(BodyIdArray bodyIds, FloatBuffer storeFactors) Return the gravity factors of the specified bodies.voidgetInverseInertias(BodyIdArray bodyIds, Mat44Array storeMatrices) Copy the inverses of the inertia tensors in system coordinates.voidgetLinearVelocities(BodyIdArray bodyIds, FloatBuffer storeVelocities) Copy the linear velocities of the specified bodies.voidgetMotionQualities(BodyIdArray bodyIds, ByteBuffer storeQualities) Return the motion qualities of the specified bodies.voidgetMotionTypes(BodyIdArray bodyIds, ByteBuffer storeTypes) Return the motion types of the specified bodies.voidgetObjectLayers(BodyIdArray bodyIds, IntBuffer storeLayers) Return the object layers of the specified bodies.voidgetPositions(BodyIdArray bodyIds, DoubleBuffer storeLocations) Copy the locations of the specified bodies.voidgetRestitutions(BodyIdArray bodyIds, FloatBuffer storeRestitutions) Return the restitution ratios of the specified bodies.voidgetRotations(BodyIdArray bodyIds, FloatBuffer storeOrientations) Copy the orientations of the specified bodies.voidgetShapes(BodyIdArray bodyIds, ShapeRefCArray storeShapes) Access the shapes of the specified bodies.voidgetTransformedShapes(BodyIdArray bodyIds, TransformedShapeArray storeShapes) Generate transformed shapes for the specified bodies.voidgetUseManifoldReductions(BodyIdArray bodyIds, ByteBuffer storeStatus) Test whether manifold reduction is enabled for the specified bodies.voidgetUserData(BodyIdArray bodyIds, LongBuffer storeData) Return the user data of the specified bodies.voidsetAngularVelocities(BodyIdArray bodyIds, FloatBuffer velocities) Alter the angular velocities of the specified bodies.voidsetFrictions(BodyIdArray bodyIds, FloatBuffer frictions) Alter the friction ratios of the specified bodies.voidsetGravityFactors(BodyIdArray bodyIds, FloatBuffer factors) Alter the gravity factors of the specified bodies.voidsetLinearVelocities(BodyIdArray bodyIds, FloatBuffer velocities) Alter the linear velocities of the specified bodies.voidsetObjectLayers(BodyIdArray bodyIds, IntBuffer layers) Alter the object layers of the specified bodies.voidsetPositions(BodyIdArray bodyIds, DoubleBuffer locations, EActivation activation) Relocate the specified bodies.voidsetRestitutions(BodyIdArray bodyIds, FloatBuffer restitutions) Alter the restitution ratios of the specified bodies.voidsetUserData(BodyIdArray bodyIds, LongBuffer data) Alter the user data of the specified bodies.Methods inherited from class com.github.stephengold.joltjni.BodyInterface
activateBodiesInAaBox, activateBody, activateConstraint, addAngularImpulse, addBodiesAbort, addBodiesAbort, addBodiesFinalize, addBodiesFinalize, addBodiesPrepare, addBodiesPrepare, addBody, addBody, addForce, addForce, addImpulse, addImpulse, addTorque, createAndAddBody, createAndAddSoftBody, createBody, createConstraint, createSoftBody, deactivateBody, destroyBodies, destroyBodies, destroyBody, getAngularVelocity, getAngularVelocity, getBodyType, getCenterOfMassPosition, getCenterOfMassTransform, getFriction, getGravityFactor, getInverseInertia, getLinearVelocity, getLinearVelocity, getMotionQuality, getMotionType, getObjectLayer, getPosition, getPosition, getPositionAndRotation, getRestitution, getRotation, getRotation, getShape, getSystem, getTransformedShape, getUseManifoldReduction, getUserData, isActive, isAdded, isSensor, moveKinematic, notifyShapeChanged, removeBodies, removeBodies, removeBody, setAngularVelocity, setFriction, setGravityFactor, setIsSensor, setLinearAndAngularVelocity, setLinearVelocity, setLinearVelocity, setMotionQuality, setMotionType, setObjectLayer, setPosition, setPositionAndRotation, setRestitution, setShape, setUserDataMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
areActive
Test whether the specified bodies are active.- Parameters:
bodyIds- the IDs of the bodies to test (notnull, unaffected)storeStatus- storage for the statuses (notnull, 1 for active, 0 for inactive, modified)
-
areAdded
Test whether the specified bodies are added to the system.- Parameters:
bodyIds- the IDs of the bodies to search for (notnull, unaffected)storeStatus- storage for the statuses (notnull, 1 for added, 0 for not added, modified)
-
areSensors
Test whether the specified bodies are sensors.- Parameters:
bodyIds- the IDs of the bodies to test (notnull, unaffected)storeStatus- storage for the statuses (notnull, 1 for sensor, 0 for non-sensor, modified)
-
getAngularVelocities
Copy the angular velocities of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeVelocities- storage for the velocities (notnull, interleaved X,Y,Z, capacity≥3*numBodies, modified)
-
getBodyTypes
Return the types of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeTypes- storage for the ordinals (notnull, capacity≥numBodies, modified)
-
getCenterOfMassPositions
Locate the centers of mass of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to locate (notnull, unaffected)storePositions- storage for the locations (notnull, interleaved X,Y,Z, capacity≥3*numBodies, modified)
-
getCenterOfMassTransforms
Return the center-of-mass transforms of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to locate (notnull, unaffected)storeMatrices- storage for the matrices (notnull, modified)
-
getFrictions
Return the friction ratios of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeFrictions- storage for the values (notnull, capacity≥numBodies, modified)
-
getGravityFactors
Return the gravity factors of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeFactors- storage for the values (notnull, capacity≥numBodies, modified)
-
getInverseInertias
Copy the inverses of the inertia tensors in system coordinates.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeMatrices- storage for the matrices (notnull, modified)
-
getLinearVelocities
Copy the linear velocities of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeVelocities- storage for the velocities (notnull, interleaved X,Y,Z, capacity≥3*numBodies, modified)
-
getMotionQualities
Return the motion qualities of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeQualities- storage for the ordinals (notnull, capacity≥numBodies, modified)
-
getMotionTypes
Return the motion types of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeTypes- storage for the ordinals (notnull, capacity≥numBodies, modified)
-
getObjectLayers
Return the object layers of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeLayers- storage for the layers (notnull, capacity≥numBodies, modified)
-
getPositions
Copy the locations of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to locate (notnull, unaffected)storeLocations- storage for the locations (notnull, interleaved X,Y,Z, capacity≥3*numBodies, modified)
-
getRestitutions
Return the restitution ratios of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies to query (notnull, unaffected)storeRestitutions- storage for the values (notnull, capacity≥numBodies, modified)
-
getRotations
Copy the orientations of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeOrientations- storage for the rotations (notnull, interleaved X,Y,Z,W, capacity≥4*numBodies, modified)
-
getShapes
Access the shapes of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeShapes- storage for the references (notnull, modified)
-
getTransformedShapes
Generate transformed shapes for the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeShapes- storage for the transformed shapes (notnull, modified)
-
getUseManifoldReductions
Test whether manifold reduction is enabled for the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeStatus- storage for the statuses (notnull, 1 for enabled, 0 for disabled, capacity≥numBodies, modified)
-
getUserData
Return the user data of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)storeData- storage for the values (notnull, capacity≥numBodies, modified)
-
setAngularVelocities
Alter the angular velocities of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)velocities- the desired velocities (notnull, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)
-
setFrictions
Alter the friction ratios of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)frictions- the desired values (notnull, capacity≥numBodies)
-
setGravityFactors
Alter the gravity factors of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)factors- the desired values (notnull, capacity≥numBodies, unaffected)
-
setLinearVelocities
Alter the linear velocities of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)velocities- the desired velocities (notnull, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)
-
setObjectLayers
Alter the object layers of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)layers- the desired layers (notnull, capacity≥numBodies, unaffected)
-
setPositions
Relocate the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)locations- the desired locations (notnull, interleaved X,Y,Z, capacity≥3*numBodies, unaffected)activation- whether to activate the bodies (notnull)
-
setRestitutions
Alter the restitution ratios of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)restitutions- the desired values (notnull, capacity≥numBodies, unaffected)
-
setUserData
Alter the user data of the specified bodies.- Parameters:
bodyIds- the IDs of the bodies (notnull, unaffected)data- the desired values (notnull, capacity≥numBodies, unaffected)
-