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

Serializing the entire World #460

Open
zakaton opened this issue Apr 6, 2021 · 1 comment
Open

Serializing the entire World #460

zakaton opened this issue Apr 6, 2021 · 1 comment

Comments

@zakaton
Copy link

zakaton commented Apr 6, 2021

I'm working on a replicated multi-user A-FRAME demo using cannon.js for the physics and Croquet for networking, where each user runs an independent CANNON.World.

It works at first when everyone starts with a new CANNON.World and replicates timestepping, but when we serialize the world using cannon.serialize.js we found out it just serializes the bodies (not including stuff like velocity and inertia). We were hoping it would serialize EVERYTHING (including gravity, time, and all the other stuff) so it would replicate an exact copy of the world.

Is there a quick way to do this or will I need to go through the world's properties and manually serialize all the stuff myself?

@marcofugaro
Copy link

As it says here

These methods are not complete but works for simple cases.

That code works for bodies only I guess, you would have to write the rest of the code if you want other properties in the json. It shouldn't be that hard.

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