al2950
01-10-2009 19:31:08
I have been stepping through the NxOgre code line by line and i have come across something that i not seem quite right or atleast i dont understand why it is the way it is!!
When you call update in NxOgre it seems to do the following;
1) call the PhysX simulate method
2) call the PhysX fetchResults method
3) update the objects in Ogre/Glut with the new data
When looking at this and looking at the PhysX examples it does not seem right to me, as should you not call simulate() at the end so the PhysX threads have a whole Ogre frame to crunch numbers before you call fetchResults()? (The reason i say this is becuase that is how it is in the PhysX examples
I relise that in doing this then everyone has to be aware of this;
but it would alteast be nice to have the option to call NxOgre::simulate() and NxOgre::fetchResults() seperately from our render loop?
I appologise if i have once again got things completely wrong, i dont mean to pick holes in this great library/plugin, just curious!!
When you call update in NxOgre it seems to do the following;
1) call the PhysX simulate method
2) call the PhysX fetchResults method
3) update the objects in Ogre/Glut with the new data
When looking at this and looking at the PhysX examples it does not seem right to me, as should you not call simulate() at the end so the PhysX threads have a whole Ogre frame to crunch numbers before you call fetchResults()? (The reason i say this is becuase that is how it is in the PhysX examples
I relise that in doing this then everyone has to be aware of this;
Every time we hit âtâ, we call NxActor::setGlobalPosition(NxVec3(0,5,0)) on our box actor. This places the actor at a position 5 units above the origin.
As with adding forces, we need to do this in between the NxScene::fetchResults() call in GetPhysicsResults() and the NxScene::simulate() call in StartPhysics()). It is an input to the physics scene which we need to perform while the scene is not being calculated by the hardware.
but it would alteast be nice to have the option to call NxOgre::simulate() and NxOgre::fetchResults() seperately from our render loop?
I appologise if i have once again got things completely wrong, i dont mean to pick holes in this great library/plugin, just curious!!