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

public class BodyIdArray extends JoltPhysicsObject
A fixed-length array of body IDs. (native type: BodyID[])
  • Constructor Details

    • BodyIdArray

      public BodyIdArray(int length)
      Instantiate an array with the specified length.
      Parameters:
      length - the desired number of IDs (≥0)
  • Method Details

    • get

      public int get(int elementIndex)
      Return the ID at the specified index.
      Parameters:
      elementIndex - the index from which to copy the ID (≥0)
      Returns:
      the BodyID value
    • set

      public void set(int elementIndex, int bodyId)
      Store the specified ID at the specified index.
      Parameters:
      elementIndex - the index at which to store the ID (≥0)
      bodyId - the ID to store