Hello
I have a Window class that creates a Camera and their own ViewPorts. It has 2 ViewPorts. One of the viewPorts is for the guiNode (also a Node from this Window class). This guiNode has bitmapText attached to it. The guiNode.updateLogicalState(tpf) and guiNode.updateGeometricState() are the only ones in the Window’s update() method. When using this class and calling the update, i receive errors that says
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
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: BitmapFont
at com.jme3.scene.Spatial.checkCulling(Spatial.java:227)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:466)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:462)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:655)
at com.jme3.renderer.RenderManager.render(RenderManager.java:687)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:216)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:141)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:198)
at java.lang.Thread.run(Thread.java:662)
Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion `map->l_init_called' failed!
Java Result: 127
Please help me how to solve these errors.
here is the code for the Window class
[java]public Window(Node rootNode, Node speedroid,
int width, int height, int splits, float[] portBounds,
Application app) {
this.app = app;
this.speedroid = speedroid;
this.width = width;
this.height = height;
setCamera(splits, portBounds);
setViewPort(rootNode);
setChaseCam();
guiNode.setQueueBucket(Bucket.Gui);
guiNode.setCullHint(CullHint.Never);
initBitmapText();
setGuiViewPort();
}
private void setCamera(int splits, float[] portBounds) {
cam = new Camera(width, height);
cam.setFrustumPerspective(45, (float)(width/splits)/height, 1, 1000);
cam.setViewPort(portBounds[0], portBounds[1], portBounds[2], portBounds[3]);
cam.setLocation(speedroid.getLocalTranslation().clone().addLocal(0, 0, 1));
cam.lookAt(speedroid.getLocalTranslation(), Vector3f.UNIT_Y);
}
private void setViewPort(Node rootNode) {
viewPort = app.getRenderManager().createMainView("Player Viewport", cam);
viewPort.setClearEnabled(true);
viewPort.attachScene(rootNode);
}
private void setChaseCam() {
chaseCam = new ChaseCamera(cam, speedroid);
chaseCam.setSmoothMotion(true);
chaseCam.setDefaultDistance(30.0f);
chaseCam.setMinDistance(28.0f);
chaseCam.setMaxDistance(40.0f);
chaseCam.setTrailingSensitivity(1);
}
private void setGuiViewPort() {
Camera guiCam = cam.clone();
guiViewPort = app.getRenderManager().createPostView("Player GUI ViewPort", guiCam);
guiViewPort.setClearEnabled(false);
guiViewPort.attachScene(guiNode);
}
private void initBitmapText() {
BitmapFont font = app.getAssetManager().loadFont("Interface/Fonts/Oloron/Oloron.fnt");
text = new BitmapText(font, false);
text.setColor(ColorRGBA.White);
text.setSize(font.getCharSet().getRenderedSize());
text.setText("Player Lap");
text.setLocalTranslation(130, 200, 0);
guiNode.attachChild(text);
}
public void update(float tpf) {
guiNode.updateLogicalState(tpf);
guiNode.updateGeometricState();
}[/java]
Commenting the guiNode.attachChild(text); makes the errors dont show...
heres how I use this Window class on a simpleApp
[java]
//on simpleInitApp
window = new Window(rootNode, character, width, height, 1, new float[]{0,1,0,1}, this);
//on simpleUpdate
window.update(tpf);
[/java]
THANK YOU SO MUCH