Karan
16-09-2009 15:32:17
I'm using yesterday's commit.
The situation is: The ball (OGRE3DBody) lies on the ground, creates contact reports all the time (I'm using NxOgre::Callback), but they're ignored based on game state. Then I translate the ball somwhere into midair with setGlobalPosition() and suspend it there using putToSleep(). And I change the game state, so that future collisions are handled (gameplay-wise). But in the next simulation step the ContactCallback is still called - the ball supposedly still has contact with the ground. That messes up the gameplay. Why is that? The PhysX docs say that moving a dynamic actor is ok, so there shouldn't be another collision, should there?
I thought about changing the game state after the next simulation step after I translate the ball, but unfortunately I don't know when the next simulation step actually happens because of NxOgre's accumulative timer (In debug mode it's in the next frame, in release mode about 15 frames later because of the much higher framerate).
Any ideas?
The situation is: The ball (OGRE3DBody) lies on the ground, creates contact reports all the time (I'm using NxOgre::Callback), but they're ignored based on game state. Then I translate the ball somwhere into midair with setGlobalPosition() and suspend it there using putToSleep(). And I change the game state, so that future collisions are handled (gameplay-wise). But in the next simulation step the ContactCallback is still called - the ball supposedly still has contact with the ground. That messes up the gameplay. Why is that? The PhysX docs say that moving a dynamic actor is ok, so there shouldn't be another collision, should there?
I thought about changing the game state after the next simulation step after I translate the ball, but unfortunately I don't know when the next simulation step actually happens because of NxOgre's accumulative timer (In debug mode it's in the next frame, in release mode about 15 frames later because of the much higher framerate).
Any ideas?