BoundingBox's from BoundingVolume

Hey there, I need to calculate a bounding box from a node, and then get that bounding box back so that I can calculate the distance of the box, I try to do this but it gives me a null ptr:

tb.setModelBound(new BoundingBox());

tb.updateModelBound();



BoundingBox b = (BoundingBox) tb.getWorldBound();



When I do this I am getting a zero distance for the box:



BoundingBox b;



tb.setModelBound(b = new BoundingBox());

tb.updateModelBound();



Vector3f extents = new Vector3f(b.getCenter());



I am expecting that it creates a new instance of the bounding box and cuts off my reference?  Ok anyways thanks for the help if anyone can figure it out I would appreciate it.

-Nate

The world bounds need updating prior to using getWorldBounds(). This normally happens during updateGeometricState() but can be called directly, too. (updateModelBound is still required)