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

2015-09-02 Thread Mattias Helsing
Thanks guys. Personally I third your opinions, but wanted to bring it up. cheers Mattias On Wed, Sep 2, 2015 at 9:56 AM, Sebastian Messerschmidt wrote: > Hi Matthias, > > I second Robert's opinion. Passing a zero-length vector simply causes in > invalid results to be calculated. > My vote would b

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

2015-09-02 Thread Sebastian Messerschmidt
Hi Matthias, I second Robert's opinion. Passing a zero-length vector simply causes in invalid results to be calculated. My vote would be towards using an assert, so the user is noticed in debug builds about the potentially wrong results. Thats what some other libraries do to hint invalid parame

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

2015-09-02 Thread Robert Osfield
Hi Mattias, On 2 September 2015 at 08:24, Mattias Helsing wrote: > 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? > For code that used in inner loops I generally prefer to avoid extr

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

2015-09-02 Thread Mattias Helsing
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 fur