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 a subshape within the current compound shape (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSubShapeIdFromIndex

      public SubShapeIdCreator getSubShapeIdFromIndex(int subShapeIndex, SubShapeIdCreator parent)
      Convert a sub-shape index to a sub-shape ID. (native method: GetSubShapeIDFromIndex)
      Parameters:
      subShapeIndex - the index of a subshape within the current compound shape (≥0)
      parent - a path the the current compound shape (not null, unaffected)
      Returns:
      a new object
    • 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)