Class CompoundShape

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShape, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
MutableCompoundShape, StaticCompoundShape

public abstract class CompoundShape extends Shape
A Shape composed from a union of simpler sub-shapes.
  • Method Details

    • getNumSubShapes

      public int getNumSubShapes()
      Count the sub-shapes.
      Returns:
      the count (≥0)
    • getSubShape

      public SubShape getSubShape(int subShapeIndex)
      Access the specified sub-shape.
      Parameters:
      subShapeIndex - the index of the sub-shape (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSubShapes

      public SubShape[] getSubShapes()
      Access all the sub-shapes as an array.
      Returns:
      a new array of new JVM objects with pre-existing native objects assigned
    • restoreSubShapeState

      public void restoreSubShapeState(ShapeList subshapes)
      Restore the sub-shape references after invoking sRestoreFromBinaryState().
      Parameters:
      subshapes - the desired sub-shape references (not null)