Restarting scene (specific bodies)

Impactus

17-04-2008 01:02:49

I am having trouble restarting the scene! (specific bodies)

My goal is to put the bodies in the same place where they were in the beginning, but this is not working.
What I am doing is: HALT everything -> setGlobalPosition(...) of the bodies I want to reset the position -> RESUME everything.

I tried to use setTimeModifier(0), then setGlobalPosition(...) the body in the right place, and then switch back the setTimeModifier(1) - doesn't work!

I also tried to use body->putToSleep on the bodies before resetting the position and wakeUp() after, but the same thing happens.

Any ideas on how to do this?

betajaen

17-04-2008 01:31:04

You'll have to advance a frame after moving the bodies or PhysX will not notice the changes and carry on as normal.