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());


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());


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.


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