You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What should happen: physics left bound should stop player
What happens instead: player can move right through until he hits world bound with very strange effect
There seems to be an issue with world bounds or to be more precise a combination of world bounds and P2 physics bounds that has been introduced in Phaser 2.7.0 and is still there in 2.10.1.
Setting up a world with world bounds slightly bigger than P2 physics bounds has the effect that top, right and bottom bounds work as expected but left is broken.
Same code is working fine in Phaser 2.6.2.
p2.setBounds sets p2.walls.left.angle to 1.5707963267948966. Setting this to a different number--even just changing the least significant digit--seems to fix collisions. (Make sure you actually change it though. On my machine if I try to set it to ...965 javascript actually sets it back to ...966.)
Could be some sort of rounding error in P2JS's collisions. Maybe @schteppe has some insight?
I haven’t debugged this, but my guess is that it’s about a p2.Plane shape. There’s optimized code paths for vertical/horizontal planes, and they had bugs in them at one point... what version of p2 is this?
This Issue is about
There seems to be an issue with world bounds or to be more precise a combination of world bounds and P2 physics bounds that has been introduced in Phaser 2.7.0 and is still there in 2.10.1.
Setting up a world with world bounds slightly bigger than P2 physics bounds has the effect that top, right and bottom bounds work as expected but left is broken.
Same code is working fine in Phaser 2.6.2.
Working (2.6.2): https://codepen.io/anon/pen/GxgVQp
Broken (2.7.0): https://codepen.io/anon/pen/bvNXmW
The text was updated successfully, but these errors were encountered: