changing levels

goldman82

23-07-2007 21:18:40

hi,

i have an application with different levels / rooms.
if i go through a door i want to load a new level.
how is the best way to do this? i must destroy all scene nodes and build new ones. scene nodes can deleted seperately. but what is about the ogrenewt bodies? i found only a function to destroy all bodies at once...
when i do this i also kill the camera body. i dont want this!

so what to do???

thanks
goldman82

walaber

23-07-2007 22:06:14

you need to delete the individual bodies... the easiest way to do this is to keep a container of pointers to the OgreNewt::Body objects, and delete them.

goldman82

23-07-2007 22:13:19

ok, thanks.
now i made my personal item class. in this class i save all infos (node,body ...)
i save all item object as a vector... i think this should work... ;)

PS: you are really fast with answers. you are the best :)

goldman82

goldman82

23-07-2007 22:44:51

hi,

this works relative :?
my first level loads fine. when i switch the level it clears all nodes, entites and bodies. it loads the next level (similar to the first one)...
after finish loading it crash!