I have an animated mesh and it seems like the animation is messing with the bounding box calculation.
When I create a bounding box using getHierarchyBoundingVectors
’, the output min/max values translates into a much larger box than what showBoundingBox
is showing.
The animated properties are position, rotationQuaternion and visibility. It seems the rotation animation is what messes things up.
I got a workaround going where I create dummy TransformNodes using the min/max as positions and parent them to the animated mesh before the animation gets applied. That way I can get the bounding box by taking the absolute position of these nodes once the animation is applied.
I wonder if there is a proper way do deal with it?