[osg-users] Quat::makeRotate potential division by zero

Mattias Helsing helsing72 at gmail.com
Wed Sep 2 00:24:08 PDT 2015


Hi

Our team chased down a bug where we passed an invalid rotation vector to:

void osg::Quat::makeRotate(const osg::Vec3d& from, const osg::Vec3d& to)

we passed an all zeroes Vec3d in the from parameter. This is then used
to normalize the vector, which causes INF values and lots of bad
things further down the line in our code. I know the bug is in our
code but I also see that there are divide-by-zero checks made in other
variations of makeRotate(...). The makeRotate_original even had a
warning print-out.

I guess it's to old performance vs user-friendliness problem, and
that's why I wanted to bring it up here before submitting anything.

What do you think?

/Mattias



More information about the osg-users mailing list