Contacts count growing after restarting world

Topics: Developer Forum, User Forum
Sep 13, 2012 at 9:19 PM
Edited Sep 13, 2012 at 9:19 PM


I have implemented solution where I'm serializing world into file.

To get an ability to restart simulation after deserializing it.

But when I use this code for deserializing (So I don't create new world, but clears existing one, and fill it again from file):

new WorldXmlDeserializer().Deserialize(world, stream);

I have an problem with doubling contacts count after each restart (so simulation is after very slow after while, because of high contacts number).

If i use this code (So I will throw away old world and create new one from nothing):

return new WorldXmlDeserializer().Deserialize(stream);

Issue with contacts doubling is solved.


But it still looks like there is an problem in World.Clear() method.

So it doesn't really clear world?

Bodies and contacts count are really zero, after call to clear. But after start of simulation, contacts count is higher than it may be..




Sep 15, 2012 at 6:37 PM


I have found an bug in my code... I was adding floor very time I was deserializing the world. So multiple multiplying floor count means multypling contacts count...