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

public class ContactList extends Array<Contact>
A variable-length list (array) of character contacts. (native type: Array<Contact>)
  • Method Details

    • capacity

      public int capacity()
      Count how many contacts the currently allocated storage can hold. The list is unaffected.
      Specified by:
      capacity in class Array<Contact>
      Returns:
      the number of contacts (≥size)
    • erase

      public void erase(int startIndex, int stopIndex)
      Remove all contacts in the specified range of indices.
      Specified by:
      erase in class Array<Contact>
      Parameters:
      startIndex - the index of the first element to remove (≥0)
      stopIndex - one plus the index of the last element to remove (≥0)
    • get

      public Contact get(int elementIndex)
      Access the contact at the specified index.
      Specified by:
      get in class Array<Contact>
      Parameters:
      elementIndex - the index from which to get the contact (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • resize

      public void resize(int numContacts)
      Expand or truncate the list.
      Specified by:
      resize in class Array<Contact>
      Parameters:
      numContacts - the desired size (number of elements, ≥0)
    • set

      public void set(int elementIndex, Contact contact)
      Put the specified contact at the specified index.
      Specified by:
      set in class Array<Contact>
      Parameters:
      elementIndex - the index at which to put the contact (≥0)
      contact - the contact to put (not null)
    • size

      public int size()
      Count how many contacts are in the list. The list is unaffected.
      Specified by:
      size in class Array<Contact>
      Returns:
      the number of contacts (≥0, ≤capacity)