Hi guys,
Well everything is pretty much in the title, I'm currently upgrading from my 1.4 version to the latest svn version and I searched for an entire day to discover this "bug".
The comment above the normalize() method is quite clear : "In case of the 0 vector the result is still 0" and now we get a -1.#IND000...
Bug tracker entry
(in my opinion it's a bug that needs a very quick fix)
[fixed] vector3d's normalize() doesn't handle null vector
I guess returning NAN and returning 0 would both be correct. I'm not even sure what I would prefer here, probably 0 because that wouldn't change the old behaviour (otherwise I would prefer NAN). I just googled a little around and found some discussion on stackoverflow about this: http://stackoverflow.com/questions/7220 ... ero-vector
In any case code certainly should do as the documentation says - so one of both has to be changed.
In any case code certainly should do as the documentation says - so one of both has to be changed.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere