java.lang.IllegalStateException: Scene graph must be updated before checking collision


does anyone know this error? It occurs if I add a ParticleEmitter. Particles are created and fly but after some time I get this error…

java.lang.IllegalStateException: Scene graph must be updated before checking collision

at com.jme3.scene.Geometry.collideWith(

at com.jme3.scene.Node.collideWith(

at com.jme3.scene.Node.collideWith(


at com.jme3.input.InputManager.invokeActions(

at com.jme3.input.InputManager.onMouseButtonEvent(

at com.jme3.input.lwjgl.LwjglMouseInput.update(

at com.jme3.input.InputManager.update(



at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(


[catch] at

INFO [com.jme3.system.lwjgl.LwjglDisplay]: EDT: Sending re-init request…



The problem is what the error says: The scenegraph has to be updated. Do a rootNode.updateGeometricState() before picking.

I am getting the same exception, and it is from a picking collision test (as noted above) which I’m doing as per examples, something like:


public void onMouseMotionEvent(MouseMotionEvent arg0) {

Geometry n;

Vector2f mouseCoords = new Vector2f(arg0.getX(), arg0.getY());

Ray mouseRay = new Ray(cam.getWorldCoordinates(mouseCoords, 0),

cam.getWorldCoordinates(mouseCoords, 1).subtractLocal(

cam.getWorldCoordinates(mouseCoords, 0)).normalizeLocal());

rayResults = new CollisionResults();

collidables.collideWith(mouseRay, rayResults);


the exception seems to occur only sometimes when I add a new object to the scene graph. Wouldn’t calling rootNode.updateGeometricState() on every mousemotionevent be really bad for performance? any other suggestions?

as a side note, I really wish the mouse coordinates were carried in the MouseButtonEvent too, the data is available in both MouseInput implementations already, so for simple cases where a mouseover isn’t required it would make things just that little bit simpler.



as far as I know you have to call rootNode.updateGeometricState() there is no other way, or I didn’t find one till now.