Page 1 of 1

Transferring physics bodies to new worlds

Posted: Mon Oct 11, 2010 4:12 pm
by VideroBoy
Say I have a physics world representing the current level. I want to delete this world and create a new one to represent the next level. The next level has different dimensions and other properties that I can't change in the current world, so I have to create a new world. The player character has its own physics body.

Is it possible to transfer a physics body from its original world to a new world without destroying and recreating it, like for transferring the player character's body to the new level world?

Also, it's now Thanksgiving here in Canada. So...Happy Thanksgiving.

Re: Transferring physics bodies to new worlds

Posted: Mon Oct 11, 2010 6:15 pm
by ivan
Happy Thanksgiving. :)
VideroBoy wrote:Is it possible to transfer a physics body from its original world to a new world without destroying and recreating it, like for transferring the player character's body to the new level world?
No. You have to manually recreate the body along with all of its associated shapes (perhaps along with its former linear and angular velocities too). As long as the body you are transferring has no joints attached to it shouldn't be too dificult.