Everything disappears when I call setModelBound(new BoundingBox());

The subject sums it up pretty well.  I am trying to figure out GameStates, so I started making a game based on the code from TestGameStateSystem.  Everything worked fine, but I wanted to add a main menu with mouse input.  I decided to try mouse picking (based on code from HelloMousePick). 

When I called "txtMenu.setModelBound(new BoundingBox());" for my (Text) menu items, all the text disappeared.

I tried taking that out and just putting a Quad behind the Text, but as soon as I call "menuQuad.setModelBound(new BoundingBox());" everything disappears again, including all the text.

Does anyone know why that would happen, or how to make it stop happening?

Incidentally, I'm sure there's a better way to implement such a menu, so I would also be interested in any insights as far as a "best practice" for making a mouse-driven menu…  but either way I would still like to know what I am missing as far as my disappearing stuff.


Im just guessing but you could try


Umm… I dont know what values a new BoundingBox has initially, but maybe you try to call updateWorldBounds() after you add the boundingbox?



After setting a boundingbox with setModelBound(), you also need to update it with updateModelBound().

For Ortho items setCullHint(CullHint.Never); is no bad idea tho, since you want them always visible,

Thanks for the feedback everyone, larynx gave the winning answer.  After I set the cullhint to never, everything came back. 

I thought the cull hint was set to never by default.  Since I'm obviously wrong about that, out of curiosity, what is the default setting for cull hint?

Thanks again!

Default culling is Dynamic, and provide a simple way of optimization (don't try to render meshes which cant be view by camera).

When you turn culling of jME off, you force the renderer to render your mesh even if it's back to your camera.

So, I dont recommend to do this (moreover if you have a lot of mesh in your scene)…

Prefered method is to add bounding volume and updateWorldBounds()