whenever I add the setModelBound my objects all disappear. Can anyone tell me why?
Quad buttonQuad = new Quad(buttonName, 40f, 40f);
final TextureState ts = display.getRenderer().createTextureState();
final Texture texture = TextureManager.loadTexture(
getClass().getResource(texturePath),
Texture.MinificationFilter.Trilinear,
Texture.MagnificationFilter.Bilinear,
1.0f,
true);
ts.setTexture(texture);
int textureWidth = ts.getTexture().getImage().getWidth();
int textureHeight = ts.getTexture().getImage().getHeight();
ts.setEnabled(true);
final FloatBuffer texCoords = BufferUtils.createVector2Buffer(4);
texCoords.put(getUForPixel(0,textureWidth)).put(getVForPixel(0,textureHeight));
texCoords.put(getUForPixel(0,textureWidth)).put(getVForPixel(40,textureHeight));
texCoords.put(getUForPixel(40,textureWidth)).put(getVForPixel(40,textureHeight));
texCoords.put(getUForPixel(40,textureWidth)).put(getVForPixel(0,textureHeight));
buttonQuad.setTextureCoords(new TexCoords(texCoords));
buttonQuad.setRenderState(ts);
buttonQuad.setRenderQueueMode(Renderer.QUEUE_ORTHO);
buttonQuad.setLocalTranslation(localTranslation);
buttonQuad.setLightCombineMode(Spatial.LightCombineMode.Off);
buttonQuad.setModelBound(new BoundingBox() ); //<
THIS is line that removes/doesntshow objects on screen
buttonQuad.updateModelBound();
buttonQuad.updateRenderState();
return buttonQuad;