is there a way to determine the exact bounding box of a node in Ardor3d? The provided "getWorldBounds" method does not return the expected result.
Imagine you have a sphere with radius 0.5. If you compute the axis-aligned world bounding box you get size 1 in all three dimensions.
Now, imagine you have the same sphere and rotate it around x by 45 degrees. You would expect the same bounding box but "getWorldBounds" returns a different result. It seems like there is a invisible box around the sphere which gets rotated and the bounds are computed for that box.
Is there a way to avoid this behavior? I couldn't find a solution for it.
This would work, but imagine the sphere is defined in a geometry file as a pile of triangles that is not known to be a sphere (no primitive). Then it breaks again.
I recognized something: at the time when the code was working correctly, the OrientedBoundingBox's internal attributes "_xAxis", "_yAxis", and "_zAxis" were different from (1,0,0) (0,1,0) (0,0,1) - according to the rotation.
fixed this issue and the bounding box was axis-aligned again. Everything was fine.
At the moment, the internal variables "_xAxis", "_yAxis", and "_zAxis" still have default direction (1,0,0) (0,1,0) (0,0,1) after the call to "spatial.getWorldBound().asType(Type.OBB);".
It seems like the rotation has no influence on the axis of the OrientedBoundingBox anymore - no idea why. I am sure that it had an influence before. Up to now, I could not reproduce the previous behavior.