Re: [Plib-users] sgCompareVec* documented incorrectly?
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-08-09 14:09:56
|
lo...@sl... wrote: > > Unless I'm misunderstanding C++/PLIB it appears that the sgCompareVec* > functions are documented incorrectly. > > http://plib.sourceforge.net/sg/index.html > > says that sgCompareVec* returns TRUE if the vectors being compared are > equal. But sg.h sure looks like it is returning -1 or 1 if the vectors > are not "equal". Unless TRUE == 0 in C++/PLIB the documentation appears > incorrect. Yes - you are correct, there is a code error (the documentation is OK). Please use sgEqualVecN to test for exact equality - or if you need a tolerance for slight inequality, do: if ( sgDistanceSquaredVecN ( ... ) < tol*tol ) ...which does the right thing. We knew about this error already - but didn't want to just change sgCompareVecN in PLIB 1.4.x because we were not sure whether any packages relied upon the broken behavior...then we just forgot to fix it! It'll be fixed in the next 1.5.x release - and it's fixed in CVS right now. Sorry! ----------------------------- Steve Baker ------------------------------- HomeMail : <sjb...@ai...> WorkMail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sf.net http://tuxaqfh.sf.net http://prettypoly.sf.net http://tuxkart.sf.net http://freeglut.sf.net http://toobular.sf.net |