Class ObjectLayerPairFilter

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstObjectLayerPairFilter, AutoCloseable, Comparable<ConstJoltPhysicsObject>
Direct Known Subclasses:
ObjVsObjFilter

public abstract class ObjectLayerPairFilter extends NonCopyable implements ConstObjectLayerPairFilter
Filter collisions between object layers.
  • Method Details

    • shouldCollide

      public boolean shouldCollide(int layer1, int layer2)
      Test whether the specified layers should collide.
      Specified by:
      shouldCollide in interface ConstObjectLayerPairFilter
      Parameters:
      layer1 - the index of the first object layer (≥0, <numObjectLayers)
      layer2 - the index of the 2nd object layer (≥0, <numObjectLayers)
      Returns:
      true if they should collide, otherwise false