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

Bodies do not respond to gravity changes after being loaded #369

Closed
howardrj opened this issue Feb 16, 2017 · 4 comments
Closed

Bodies do not respond to gravity changes after being loaded #369

howardrj opened this issue Feb 16, 2017 · 4 comments
Labels

Comments

@howardrj
Copy link

Hi! I've been experimenting with saving and loading world configurations and noticed something I thought seemed odd. When a configuration is saved to local storage (by clicking the save button on the generated GUI from matter-tools.gui.js) and then loaded again, the bodies no longer respond to changes in either x or y components of gravity.

I can also reproduce this issue on the demo page (http://brm.io/matter-js/demo/).
Any idea what's going on?

Thanks in advance!

@liabru
Copy link
Owner

liabru commented Feb 18, 2017

I think it's because loading a new world also loads the original gravity settings, while the GUI maintains the reference to the previous world's gravity object, which is no longer used by the engine so changing it has no effect.

I'd say to log an issue on matter-tools about this, but don't because the GUI no longer includes the world save / load feature (though, I plan to add it to MatterTools.Demo eventually).

@liabru liabru closed this as completed Mar 7, 2017
@kmorris1077
Copy link

What's the point of having this editor if you can't load and save worlds?

@liabru
Copy link
Owner

liabru commented Aug 15, 2017

It's helpful for debugging and testing. It's not quite a world editor yet but I'd like it to be. I took the loading and saving out from the tool because it needed more work to be compatible with plugins. But the code still exists if you want to use it, check out MatterTools.Serializer.

@kmorris1077
Copy link

Will do. Thanks much!

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

No branches or pull requests

3 participants