Hi,
After testing the case above, I found that named nodes are not added to the scene, and don't have implicitly associated VWorld -> don't have Vworld bounds.
I modified the test case to sidplay named note's parents:
1 2 3 4 5
| for(int i = 0; i < modelNames.length; i++) { TransformGroup no = model.getNamedObject(modelNames[i]); System.out.println("Model: " + modelNames[i] + " " + no + " " + no.getParent() + " getVworldBounds: " + no.getVworldBounds()); } |
and the result is:
1 2 3 4
| The main Model.getVworldVounds: BoundingSphere [-0.42404148,-0.18567085,-0.09359161 radius 12.151663] Model: redBox com.xith3d.scenegraph.TransformGroup@b02efa null getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0] Model: redBox2 com.xith3d.scenegraph.TransformGroup@dc57db null getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0] Model: redBox1 com.xith3d.scenegraph.TransformGroup@c24c0 null getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0] |
Please note null values in place where parent should be.
You should add nodes to the scene before requesting the Vworld bounds (they depend on Vworld transform).
So, result is following: this is not a bug in Xith3D bounds calculation code, but with the scene tested.
Yuri