I do some modify and work well.
Code: Select all
/*
// get world to object space transform
core::matrix4 mat;
if (!current->getAbsoluteTransformation().getInverse(mat))
continue;
// transform vector from world space to object space
core::line3df line(ray);
mat.transformVect(line.start);
mat.transformVect(line.end);
const core::aabbox3df& box = current->getBoundingBox();
*/
core::line3df line(ray);
core::aabbox3df box = current->getTransformedBoundingBox();