Greetings all!
My name is Raymond Jacobs, owner of Ethereal Darkness Interactive (makers of Morning's Wrath and The Lost City of Malathedra)
We're currently working on a new game engine and have chosen Box2D for our physics engine. Overall it's worked great, but I am having one issue.
In our games we have various separate 'rooms' which are considered to be completely isolated from one another.
Box2D seems to present us with only a single large 'simulation pool', I've read the documentation and it says you can create multiple 'worlds'
which seem to essentially be simulation contexts, but there doesn't seem to be a mechanism for moving bodies from one world to the next.
Short of using multiple worlds there are lots of tricks I can think of to get the multi-room functionality i'm looking for but none seem ideal.
1. move unused objects ouside of simulation area, move back in later (hackish, plus seems like a lot of objects would remain in the simulation)
2. remove all bodies from simulation, create new ones, rinse and repeat for each room change (box2D makes up our positional model and i'd rather not store the transient data of moving, plus still a lot of objects in simulation at once)
3. contact filterer (tons of processing overhead)
So the question is what is the 'right' way to do this?
Thanks in advance for any help 🙂
-Raymond
My name is Raymond Jacobs, owner of Ethereal Darkness Interactive (makers of Morning's Wrath and The Lost City of Malathedra)
We're currently working on a new game engine and have chosen Box2D for our physics engine. Overall it's worked great, but I am having one issue.
In our games we have various separate 'rooms' which are considered to be completely isolated from one another.
Box2D seems to present us with only a single large 'simulation pool', I've read the documentation and it says you can create multiple 'worlds'
which seem to essentially be simulation contexts, but there doesn't seem to be a mechanism for moving bodies from one world to the next.
Short of using multiple worlds there are lots of tricks I can think of to get the multi-room functionality i'm looking for but none seem ideal.
1. move unused objects ouside of simulation area, move back in later (hackish, plus seems like a lot of objects would remain in the simulation)
2. remove all bodies from simulation, create new ones, rinse and repeat for each room change (box2D makes up our positional model and i'd rather not store the transient data of moving, plus still a lot of objects in simulation at once)
3. contact filterer (tons of processing overhead)
So the question is what is the 'right' way to do this?
Thanks in advance for any help 🙂
-Raymond