Question

I want to add turn physics on button in my game editor, something similar to Havoc button in TES Construction Set (something like this: http://youtu.be/6RzxXWiqb8M?t=7m40s). It's job would be to make the objects I've placed fall into desired natural position. Unfortunately, I cannot find any mechanism that would let me simulate only a part of Box2D world and since my world is pretty big this can cause unwanted changes.

Is there any way to do it? I haven't found any suitable answer on the internet.

So far I've only thought of manual bodies deletion before simulation, but seriously this is a lot of work, probably not needed.

Was it helpful?

Solution

You can set/unset if body is active. http://www.box2dflash.org/docs/2.1a/reference/Box2D/Dynamics/b2Body.html#SetActive()

Set all bodies except you want to simulate as inactive and run the simulation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top