I must be doing something stupid with this but:
I create a PreView
I attach a scene
On the rootNode is a spatial whose material has
(The idea being that it will be invisible but still hide objects behind it - works as expected)
In the simpleupdate, I update my game stuff, I look at the player, and finally update the stuff I attached to the PreView, since it’s not attached to the root node.
When I looked at the player, it looks at his feet, so I figured I’d raise the Y value…
lookAt.x = player.player.getWorldTranslation().x; lookAt.y = player.player.getWorldTranslation().y+5; lookAt.z = player.player.getWorldTranslation().z; cam.lookAt(lookAt, Vector3f.UNIT_Y);
When I do that +5 bit, depth no longer works
(shown below, +5 on the left, and without the +5 on the right)
The bottom picture has it working though. I added an int dl = 0;
Then in the update after setting the lookAt to the players values…
lookAt.y+=dl; if(dl<5)dl++; cam.lookAt(lookAt, Vector3f.UNIT_Y);
So it increases by 1 per update until it gets to 5.
If I went back and did
lookAt.y = player.player.getWorldTranslation().y+1;
It again does not work and depth is gone. Just asking out of curiosity really since that horrible dl bit does fix it, despite my hatred of it - why does me changing the value directly cause depth to stop working?