How can I recreate some body?
Posted: Fri Aug 23, 2013 6:05 am
I'm using b2dJson and I'd like to ask how I can load the rube file and get the `fixtureDef`, `bodyDef` instead of the `fixture` and `body`. I ask this because in my game I need to dynamically create new shapes, and I don't know if there's a simple way to copy the same body.
Another problem I've encountered is that I have to design all the elements in the same rube file because different rube files will share different `b2Worlds` when they load up. That means there isn't a simple way to add the body loaded from one rube file into the world created from another rube file (again, if I can get the `Def`s it might be straightforward). The implication is that I can't design the player in one file and use it across different chapters in different files.
I think these problems are fairly common and probably someone has already had solutions for them. I'm fairly inexperienced with Box2D so can that someone share some tips?
Another problem I've encountered is that I have to design all the elements in the same rube file because different rube files will share different `b2Worlds` when they load up. That means there isn't a simple way to add the body loaded from one rube file into the world created from another rube file (again, if I can get the `Def`s it might be straightforward). The implication is that I can't design the player in one file and use it across different chapters in different files.
I think these problems are fairly common and probably someone has already had solutions for them. I'm fairly inexperienced with Box2D so can that someone share some tips?