java.lang.IllegalStateException Error

1 reply [Last post]
Offline
Joined: 11/18/2012

java.lang.IllegalStateException: Scene graph is not properly updated for rendering.
State was changed after rootNode.updateGeometricState() call.
Make sure you do not modify the scene from another thread!
Problem spatial name: Root Node
    at com.jme3.scene.Spatial.checkCulling(Spatial.java:260)
    at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:649)
    at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:642)
    at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:976)
    at com.jme3.renderer.RenderManager.render(RenderManager.java:1031)
    at env3d.EnvBasic.update(EnvBasic.java:747)
    at env3d.advanced.EnvAdvanced.update(EnvAdvanced.java:123)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
    at env3d.Env.advanceOneFrame(Env.java:280)
 

i created a thread for the enemy AI and after i lower the Thread.sleep(100) to 50 this error would appear

and after re running my code again the window would only show black screen and would not show

the game world. I feared that ,maybe i can only use threads for updating the gameAI movements but not for changing graphic frames.

the game would only run if i set Thread.sleep to 100 but i want to reduce the value since the delay time would make the object move slower

including the movement animation.

Offline
Joined: 12/13/2010
You are correct in that you

You are correct in that you cannot use multiple threads to update the graphics.  This is a restriction in OpenGL.  Bascially, you can only have one thread updating the OpenGL context.  AI and other calculations can of course be done with other threads.