Is it the good way to do? [SOLVED]

nord666

12-06-2008 04:35:32

Hi!

I'm not sure if the way i'm "pausing" my game is a good one. So, i want you opinion.

Firstly, i initialyse the BodyIterator.
OgreNewt::BodyIterator::getSingleton().Init(mWorld);

Secondly, i call a function according to the "pausing state".

if (!paused)
OgreNewt::BodyIterator::getSingleton().go(pause);
else
OgreNewt::BodyIterator::getSingleton().go(unpause);
paused = !paused;


The two functions:

void pause(OgreNewt::Body * _body)
{
_body->freeze();
}
void unpause(OgreNewt::Body * _body)
{
_body->unFreeze();
}


I'm almost sure that the way i do it isn't good. But it's the only one that i found.

If you have a better way, can you give it to me please.

Thank and sorry for my English!

scanmaster_k

14-06-2008 08:51:47

Hi, why don't you just skip updating the world while in pause.



Scanamster_K

nord666

14-06-2008 18:30:24

i'm using the OgreNewt::BasicFrameListener to update the world.

Yacoby

16-06-2008 10:56:59

i'm using the OgreNewt::BasicFrameListener to update the world.
Copy and paste the code from the basic frame listener, and then modifiy it to your hearts content ;)

walaber

20-06-2008 05:46:39

yup! you shouldn't use the BasicFrameListener I included for anything but simple demos.