Best way to compute specific BoundingVolume for Node?

Hi.

Since jbullet-jme is meant to use jme BoundingVolumes to compute its CollisionShapes I am searching for a failsafe way to get a specific BoundingVolume (e.g. BoundingBox, BoundingCapsule) from a Node that contains all of its children.



Currently, I have the PhysicsNode (which is a normal jme Node) and I attach the child Spatial and try to get a specific BoundingVolume like this, which only seems to work with simple Geometry Objects attached to the Node:


physicsNode.attach(physicsChildSpatial);
physicsNode.setModelBound(new BoundingBox());
physicsNode.updateModelBound();
physicsNode.updateWorldBound();
BoundingBox volume=(BoundingBox) physicsNode.getWorldBound();



As it seems, with loaded Meshes consisting of a root Node and multiple leafs as physicsChildNode this does not work, volume==null.
What would be the best way to do this?

Cheers,
Normen

Insert:


physicsNode.updateGeometricState(0,true);



This will process the whole tree and calculates the bounds of the spatials which are needed to calculate the node's worldbound.

Good night,ToM