I need to check intersection between two moving nodes before they hit.
I have this code, which works, but it only is true when they already hit.
Is there a simple way to give an offset to the bounding box, so it gives true before they hit?
osg::ComputeBoundsVisitor cbv;
MatrixTransform* transform = new osg::MatrixTransform;
transform->addChild(node);
transform->accept(cbv);
osg::BoundingBox bb = cbv.getBoundingBox();
osg::ComputeBoundsVisitor cbv2;
MatrixTransform* transform2 = new osg::MatrixTransform;
transform2->addChild(node2);
transform2->accept(cbv2);
osg::BoundingBox bb2 = cbv2.getBoundingBox();
bool intersects=bb.intersects(bb2);