Class BroadPhaseLayerInterfaceTable

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

public class BroadPhaseLayerInterfaceTable extends BroadPhaseLayerInterface
Map object layers to broad-phase layers using a lookup table.
  • Constructor Details

    • BroadPhaseLayerInterfaceTable

      public BroadPhaseLayerInterfaceTable(int numObjLayers, int numBpLayers)
      Instantiate a default map with the specified capacity. It maps every object layer to broad-phase layer zero.
      Parameters:
      numObjLayers - the desired capacity (number of object layers) (≥1)
      numBpLayers - the number of broad-phase layers (≥1)
  • Method Details

    • mapObjectToBroadPhaseLayer

      public BroadPhaseLayerInterfaceTable mapObjectToBroadPhaseLayer(int objLayer, int bpLayer)
      Add a mapping from the specified object layer to the specified broad-phase layer.
      Parameters:
      objLayer - the index of the object layer (≥0, < numObjectLayers)
      bpLayer - the index of the broad-phase layer (< numBpLayers)
      Returns:
      the modified map, for chaining