Update order

Do I NEED to call rootNode.updateGeometricState( time , true ) before i update the physicsSpace?

Does the PhysicsSpace rely on the scene being freshly updated?



I would like some controllers to update after the physicsSpace did. ( they only do work when the character touches the floor, and that is checked by the Physics )



I tried it in a VERY small test app, and everything worked fine ( provided you updated the scenegraph just once after initializing the gameState ), would a bigger app start to behave funny?

Well, you don't have to do it the way it is done in SimplePhysicsGame. But it makes sense, because the changes to the scenegraph are propagated to the physics representation in the update methods of the scenegraph. Physics changes are propagated to the scenegraph in the physics update method.

So

  • modify position of some dpn
  • update scenegraph
  • update physics

    works.
  • update scenegraph
  • modify position of some dpn
  • update physics

    does not work.


  • update physics
  • update scenegraph
  • modify position of some dpn

    works (same as first example!).



    So actually what means before and after in a loop :slight_smile:

well. thanks for the answer.



The question has become obsolete since I changed my app’s structure.



I don’t use controllers for that core game stuff anymore

see:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=9323.0



my game loop is now just like in SimplePhysicsGame

updateScene

updatePhysics

updateFAV’s Homebrew Game stuff