Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2.World gravity broken after switching states #1292

Closed
englercj opened this issue Nov 3, 2014 · 1 comment
Closed

P2.World gravity broken after switching states #1292

englercj opened this issue Nov 3, 2014 · 1 comment

Comments

@englercj
Copy link
Contributor

englercj commented Nov 3, 2014

After switching states the InversePointProxy for the p2 world physics is broken, this is because the actual array the proxy refers to is no longer used by the p2 world.

On reset the world reruns the ctor which creates a new array for the world gravity. The InversePointProxy in Phaser's P2.World still refers to the old one so you have to access the world gravity manually instead of using the point proxy.

photonstorm added a commit that referenced this issue Nov 25, 2014
…. All of the bodies, springs, fixtures, materials and constraints are removed - but config settings such as gravity, restitution, the contact solver, etc are all retained. The P2.World object is only created the very first time you call Physics.startSystem. Every subsequent call hits P2.World.reset instead (#1292)
@photonstorm
Copy link
Collaborator

This should now be fixed in dev. Test example here: phaserjs/phaser-ce-examples@971f0c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants