Interface ContactFilter
public interface ContactFilter
Decides, step by step, whether two touching bodies in a PhysicsWorld push
on each other. Install with PhysicsWorld#setContactFilter(ContactFilter).
Returning false lets the bodies pass through each other for this step only;
the question is asked again on the next step while they still overlap. That
is how one-way platforms, team pass-through and "ghost" pickups are made --
PhysicsWorld#setOneWay(PhysicsBody, boolean) is the stock one-way rule.
Called from inside PhysicsWorld#step(float). Do not create or destroy
bodies here.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldCollide(PhysicsBody a, PhysicsBody b, float normalX, float normalY) Whether two bodies collide this step.
-
Method Details
-
shouldCollide
Whether two bodies collide this step.
Parameters
a: one bodyb: the othernormalX: the contact normal fromatob, screen spacenormalY: the contact normal fromatob, screen space (positive is down)
Returns
false to let them pass through each other this step
-