chp
03-04-2008 12:08:34
Hint: using NxOgre 0.9-38
I want to execute some code after the physics simulation has finished. I have tried to use the checkResults(...) method of the OgreNxScene, for checking if simulation has ended, but this doesn't work, because nxogre itself uses the method and "blocks" my call to it. To illustrate the problem I will describe what I want to accomplish.
Let's say one has a box which should hover. To accomplish that he has to add a force (mass * gravity). When a ogre framelistener is used to apply the force to the actor with addForceAtPos(). The box will fly away. Because the applied force will only be reset if physics simulation is done and there are more than one frames rendered while simulation is running, so the forces applied would accumulate.
Hence, I would get aware of the point of time when the physics simulation has finished. So I can set the force to apply only once per simulation run.
Somewhat like a listener would be nice. I have searched the forum but I found nothing appropriate.
Thanks for your help
I want to execute some code after the physics simulation has finished. I have tried to use the checkResults(...) method of the OgreNxScene, for checking if simulation has ended, but this doesn't work, because nxogre itself uses the method and "blocks" my call to it. To illustrate the problem I will describe what I want to accomplish.
Let's say one has a box which should hover. To accomplish that he has to add a force (mass * gravity). When a ogre framelistener is used to apply the force to the actor with addForceAtPos(). The box will fly away. Because the applied force will only be reset if physics simulation is done and there are more than one frames rendered while simulation is running, so the forces applied would accumulate.
Hence, I would get aware of the point of time when the physics simulation has finished. So I can set the force to apply only once per simulation run.
Somewhat like a listener would be nice. I have searched the forum but I found nothing appropriate.
Thanks for your help