【发布时间】:2018-06-28 18:06:00
【问题描述】:
在我的游戏中,我使用了很多 Box2D 实体,其中包含多个固定装置。 而且我还使用 Contact Listener 来检测不同物体之间的碰撞。 不幸的是,我遇到了一个可怕的问题。当身体发生碰撞时,Contact Listener 会检测到不止一次。如何去抖动 Contact Listener? 我的日志:
...
postSolve A: brows B: bShape
endContact A: brows B: bShape
endContact A: brows B: bShape
endContact A: brows B: bShape
endContact A: brows B: bShape
endContact A: brows B: bShape
endContact A: brows B: bShape
在我为我身体的每个固定装置分配唯一的用户数据之后。
新日志:
...
endContact A: f-3 B: f-0
endContact A: f-4 B: f-0
endContact A: f-5 B: f-0
endContact A: f-7 B: f-0
【问题讨论】: