Strange bug with "RootNode" [SOLVED]

Hi guys!

I’m playing with editor prototype and i found a very strange bug. If i change 2 lines which attach meshes to rootNode, then i have some kind of flickering.

I did video:

On the video i changed this class (lines 65 and 66):
http://code.google.com/p/jme-simple-examples/source/browse/JMESimpleExamples/src/com/simpleEditor/EditorBaseParts.java?spec=svn3294d28605d36d89350e160fa02db60a33c5e35d&r=3294d28605d36d89350e160fa02db60a33c5e35d

all code of the prototype is here:
http://code.google.com/p/jme-simple-examples/source/browse/#hg%2FJMESimpleExamples%2Fsrc%2Fcom%2FsimpleEditor
Editor.java is executable.

P.S. In the Editor.java i have a runnables on another thread. Can it cause such a problem?
Here line 252: http://code.google.com/p/jme-simple-examples/source/browse/JMESimpleExamples/src/com/simpleEditor/Editor.java?spec=svnefd8103d6df15335578ee661374d4b7243cf9d1b&r=efd8103d6df15335578ee661374d4b7243cf9d1b

Thanks.[video]http://www.youtube.com/watch?v=jz2_DalNAa0&feature=youtu.be[/video]

A swing window is always created on the EDT so calling anything scene-related in a swing window constructor is a no-go. The threading for the move tools in the SDK is already laid out so there you don’t have to worry about that :wink:

Anyway what do you mean by flickering? The tearing? Theres vsync for that ^^

1 Like

He means with one order, they both stay in sync but with the other order one moves at a lag from the other… at least I think.

I didn’t look into the code to see how one position is sync’ed to the other but it seems like a pretty classic update ordering problem.

@normen i had vsync on (Editor.java class). 60fps. Yes i mean tearing… some kind of a lag. Are SDK tools in a different thread?

@pspeed you are right too. Is there any solution of the problem?

And the main problem is if i change ordering:
[java]
rootNode.attachChild(camTrackHelper);
rootNode.attachChild(selectableNode);
[/java]

TO THIS Ordering:
[java]
rootNode.attachChild(selectableNode);
rootNode.attachChild(camTrackHelper);
[/java]

My manipulator tool bacomes lag a lot! Like you can see on the video starting from 0.50 time.
Class is here: http://code.google.com/p/jme-simple-examples/source/browse/JMESimpleExamples/src/com/simpleEditor/EditorBaseParts.java?spec=svn3294d28605d36d89350e160fa02db60a33c5e35d&r=3294d28605d36d89350e160fa02db60a33c5e35d

Thanks to coredevs. I fixed my issue:
http://code.google.com/p/jme-simple-examples/source/detail?r=0e0c90c49d64e3289780ea43a13ab7bc8506e2a6

what caused the issue?

@wezrule said: what caused the issue?

I moved a Node of a ChaseCamera with a control. It caused the issue.
I changed the movement to AnalogListener and flickering is gone.

As @pspeed explained… somehow some nodes with controls were updated after the ChaseCamera was moved.

1 Like

Simple explanation:
Node caused camera to move.
Another node moved based on the camera.

So if you swap the order then the node moved based on the camera will be looking at stale values… as I said originally, “classic update ordering problem”

1 Like

ah right