Class ShapeRefCArray

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

public class ShapeRefCArray extends JoltPhysicsObject
A fixed-length array of counted references to shapes. (native type: ShapeRefC[])
  • Constructor Details

    • ShapeRefCArray

      public ShapeRefCArray(int length)
      Instantiate an array with the specified length.
      Parameters:
      length - the desired number of references (>0)
  • Method Details

    • get

      public ShapeRefC get(int elementIndex)
      Access the reference at the specified index.
      Parameters:
      elementIndex - the index (≥0, <length)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • length

      public int length()
      Return the length of the array.
      Returns:
      the length (in references, >0)
    • set

      public void set(int elementIndex, ShapeRefC ref)
      Store the specified reference at the specified index.
      Parameters:
      elementIndex - the index at which to store the reference (≥0, <length)
      ref - the reference to store (not null, unaffected)