Interface ConstPhysicsScene
- All Superinterfaces:
AutoCloseable,Comparable<JoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Implementing Classes:
PhysicsScene
Read-only access to a
PhysicsScene.-
Method Summary
Modifier and TypeMethodDescriptionAccess the body-creation settings as a Java array.Access the constraints as a Java array.intCount the bodies in the scene.intCount the constraints in the scene.intCount the soft bodies in the scene.Access the soft-body creation settings as a Java array.voidsaveBinaryState(StreamOut stream, boolean saveShapes, boolean saveGroupFilter) Save the scene to the specified binary stream.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa, targetVaOrZero
-
Method Details
-
getBodies
ConstBodyCreationSettings[] getBodies()Access the body-creation settings as a Java array. The scene is unaffected.- Returns:
- a new array of new JVM objects with the pre-existing native objects assigned
-
getConstraints
ConstConnectedConstraint[] getConstraints()Access the constraints as a Java array. The scene is unaffected.- Returns:
- a new array of new JVM objects with the pre-existing native objects assigned
-
getNumBodies
int getNumBodies()Count the bodies in the scene. The scene is unaffected.- Returns:
- the count (≥0)
-
getNumConstraints
int getNumConstraints()Count the constraints in the scene. The scene is unaffected.- Returns:
- the count (≥0)
-
getNumSoftBodies
int getNumSoftBodies()Count the soft bodies in the scene. The scene is unaffected.- Returns:
- the count (≥0)
-
getSoftBodies
ConstSoftBodyCreationSettings[] getSoftBodies()Access the soft-body creation settings as a Java array. The scene is unaffected.- Returns:
- a new array of new JVM objects with pre-existing native objects assigned
-
saveBinaryState
Save the scene to the specified binary stream. The scene is unaffected.- Parameters:
stream- the stream to write to (notnull)saveShapes- if true, save the shapessaveGroupFilter- if true, save the group filter
-