Object behavior is incorrect when reloaded from binary

I noticed that the behavior between bodies was different when a scene was exported and then reloaded in the binary format. I observed it in a scene like this:

The cube above is a standard 1x1x1 with a mass of 1. The floor below has a calculated mass of about 20 and is not affected by gravity. The original scene has the cube fall to the floor and floor slowly accelerates downward and begins a counterclockwise rotation. When this scene is exported and then loaded, the cube hits the floor and the floor quickly spins around its center of mass as the cube continues to fall.

A getMass() call on the floor returns the correct mass that was stored, and call like setMass(getMass()) after loading seems to fix the behavior. It appears to me that maybe the loaded body is no longer the same shape/dimension, or it acts like the entire mass is concentrated at its center.

Maybe something is not being saved for the body?

Good catch. We'll have a look at that in January.

It's not exactly January anymore, but at last I found time to apply a workaround which recomputes the mass after loading.


As with the other changes, please test it, as it worked in my tests, but might not do so for your's.


Hey thanks! I'll report back when I get a chance.

The change looks good in my tests. Thanks alot!  :slight_smile: