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 desired 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
    • setBroadPhaseLayerName

      public BroadPhaseLayerInterfaceTable setBroadPhaseLayerName(int bpLayer, String name)
      If profiling is enabled, alter the name of the specified layer. Otherwise this has no effect.
      Parameters:
      bpLayer - the index of the broad-phase layer to modify (≥0, < numBpLayers)
      name - the desired name (not null)
      Returns:
      the modified map, for chaining