Class SimShapeFilter

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

public class SimShapeFilter extends NonCopyable
A shape filter for simulation.
  • Constructor Details

    • SimShapeFilter

      public SimShapeFilter()
      Instantiate a default filter.
  • Method Details

    • shouldCollide

      public boolean shouldCollide(ConstBody body1, ConstShape shape1, int subShapeId1, ConstBody body2, ConstShape shape2, int subShapeId2)
      Test whether the specified collision should be simulated. The filter is unaffected.
      Parameters:
      body1 - the first colliding body (not null, unaffected)
      shape1 - the first colliding shape (not null, unaffected)
      subShapeId1 - the sub-shape ID leading from body1.getShape() to shape1 (not null, unaffected)
      body2 - the 2nd colliding body (not null, unaffected)
      shape2 - the 2nd colliding shape (not null, unaffected)
      subShapeId2 - the sub-shape ID leading from body2.getShape() to shape2 (not null, unaffected)
      Returns:
      true if simulated, false if filtered out