Class BodyFilter

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

public class BodyFilter extends NonCopyable
Determine which bodies are candidates for a collision test.
  • Constructor Details

    • BodyFilter

      public BodyFilter()
      Instantiate a default filter that selects all layers.
  • Method Details

    • shouldCollide

      public boolean shouldCollide(ConstBodyId bodyId)
      Test whether the specified body is a candidate for collisions. The filter is unaffected.
      Parameters:
      bodyId - the body to test (not null, unaffected)
      Returns:
      true if may collide, false if filtered out