How to detect collision but do not collide in box2d?

前端 未结 2 1955
攒了一身酷
攒了一身酷 2020-12-09 11:15

How to detect if body collides other body but do not react on this collision.

By default i - detect collision and bodies collide.

If i set fixture

2条回答
  •  清歌不尽
    2020-12-09 12:07

    If the fixture never needs to collide with anything you could make it a sensor. If you need it to collide with some things but not others you could do contact->SetEnabled(false) in the PreSolve of the collision listener, depending on what it collided with.

提交回复
热议问题