Partile Emitter, mainNode, rootNode.updateGeometricState()

When action button is pressed a partial emitter is created and then it is attached to the mainNode, which is then attached to the rootNode.(this is due to the water processor).

But when I attached this code, the following error appears.

java.lang.IllegalStateException: Scene graph is not properly updated for rendering.

Make sure scene graph state was not changed after

rootNode.updateGeometricState() call.

Problem spatial name: null

at com.jme3.scene.Spatial.checkCulling(

at com.jme3.renderer.RenderManager.renderScene(

at com.jme3.renderer.RenderManager.renderViewPort(

at com.jme3.renderer.RenderManager.render(


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

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



But If I attached the particle emitter directly to the rootNode, this problem goes away. But, i want to attach it to the mainNode.

I have the following two line at the start of the simpleUpdate function,(i am using ray casting to determine on which object the player is standing)

[java] rootNode.updateLogicalState(tpf);


If I add [java]mainNode.updateGeometricState();[/java] after the particle emitter is attached to the mainNode, then the following error appears

java.lang.NullPointerException: Geometry: Emitter has null mesh
at com.jme3.scene.Geometry.updateWorldBound(
at com.jme3.scene.Spatial.updateGeometricState(
at com.jme3.scene.Node.updateGeometricState(
at mygame.Main.throwFireball(
at mygame.Main$3.onAction(
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.LwjglDisplay.runLoop(

ok, somehow, updateXXX issue has been solved.

Now for the actual problem, I am using actionListener, like the following





freeRotate = true;




freeRotate = false;




and the method is

[java] public void throwFireball()


pe_fire = new ParticleEmitter(“Emitter”, Type.Triangle, 30);

Material mat_red = new Material(assetManager, “Common/MatDefs/Misc/Particle.j3md”);

mat_red.setTexture(“m_Texture”, assetManager.loadTexture(“Effects/Explosion/flame.png”));


pe_fire.setImagesX(2); pe_fire.setImagesY(2); // 2x2 texture animation

pe_fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red

pe_fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow

pe_fire.setInitialVelocity(new Vector3f(0, 7, 0));









SphereCollisionShape cs_fire = new SphereCollisionShape(2);

pn_fire = new PhysicsNode(pe_fire, cs_fire, 1);

pn_fire.setLocalTranslation(-300, 11, 122);

pn_fire.setGravity(new Vector3f(0,-1,0));

pn_fire.applyForce( pn_fire.getLocalTranslation().subtract(pn_player.getLocalTranslation()).mult(30).negate(), pn_fire.getLocalTranslation());






But, when the action takes place, following error occures

java.lang.NullPointerException: Geometry: Emitter has null mesh

at com.jme3.scene.Geometry.updateWorldBound(

at com.jme3.scene.Spatial.checkDoBoundUpdate(

at com.jme3.scene.Geometry.collideWith(

at com.jme3.scene.Node.collideWith(

at com.jme3.scene.Node.collideWith(

at mygame.Main.updateStandingOnRay(

at mygame.Main.simpleUpdate(


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

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



But, if i use rootNode instead of mainNode, the code runs, but, doesn’t perform as it supposed to.

Like physics shapes collide with the charcter, but, their debug shape is not visible, and some time the come out of thin air(!!!) and at Vector3f.ZERO those particle appears along with the flying balls. But, they shouldn’t be there.

Try removing the updateXXX lines from your simpleUpdate(), they should not be needed anymore.

I am using raycasting and to determing wherer the player is standing, If i remover those lines, the a new error occures.

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

That error is incorrect and shouldn’t be there, since we added local scene graph updates.

I fixed it and removed the error in last revision, so you no longer need to call updateGeometricState() to check collision

[java] standingOnRayResults = new CollisionResults();

standingOnRay = new Ray(new Vector3f(pn_player.getLocalTranslation().getX(), pn_player.getLocalTranslation().getY()-3f,pn_player.getLocalTranslation().getZ()), Vector3f.UNIT_Y.negate());

mainNode.collideWith(standingOnRay, standingOnRayResults);

if(standingOnRayResults.size() != 0 & pn_player.onGround())

standingOnRayString = standingOnRayResults.getClosestCollision().getGeometry().getName();


standingOnRayString = “nothing”;[/java]

this code doesn’t word unless I add “updateGeometryStatic()”… :?

Is this the line, that is causing the main problem?(i cannt add particle emitter on another node except rootNode)

You might have to add updateGeometricState() to update the physics state … I am not sure about that, perhaps normen knows better

No, physics doesnt use updateGeometricState anymore.

Ok, i have tried by removing all the updateXXX from my code, but still, the errors of the ‘first post’ remains.

any idea? :?

Okay then you’re gonna have to give us more detail. I removed the usage of updateGeometricState() in the official jME collision/picking tests and they work fine without it.

iamcreasy said:
When action button is pressed [..]

I hope this doesnt mean you directly do the call from the AWT thread then? Wrap it to be executed from the OpenGL thread when you want to do this in the buttonPressed method:
[snippet id="10"]