Re: [Plib-users] culling problems w/ off-axis projection
Brought to you by:
sjbaker
From: John F. F. <joh...@cy...> - 2010-06-01 11:50:15
|
As you can see, I had a bit of trouble with the Windows e-mail program (Eudora) deciphering the Linux (I think) message, but I think I got it right. I have put what I think is the correct change into SVN. Please test it out. - John At 08:45 AM 5/31/2010, you wrote: >Sending again, because I used the wrong email >address. Twice! Sigh. * John F. Fay -- Monday 31 >May 2010: > It uses the functions "_isnan" and >"_isfinite" which are just > fine on my >Windows/MSVC platform. For some reason MICROS~1 >is in love with these underscore functions, >which are, in the real world, just isnan() and >isfinite(). So this doesn't compile on >Linux: sg.cxx: In function âvoid >sgQuatToAngleAxis(float*, float*, const >float*)â: sg.cxx:1311: error: â_isnanâ >was not declared in this scope sg.cxx:1311: >error: â_finiteâ was not declared in this >scope I suggest to do something like this: diff >--git a/src/sg/sg.cxx b/src/sg/sg.cxx index >0e182fb..b6aa05c 100644 --- a/src/sg/sg.cxx +++ >b/src/sg/sg.cxx @@ -24,6 +24,12 @@ #include >"sg.h" +#ifdef UL_WIN32 +# define isnan _isnan >+# define finite _finite +#endif + + sgVec3 >_sgGravity = { 0.0f, 0.0f, -9.8f } ; void >sgVectorProductVec3 ( sgVec3 dst, const sgVec3 >a, const sgVec3 b ) @@ -1308,7 +1314,7 @@ void >sgQuatToAngleAxis ( SGfloat *angle, void >sgQuatToAngleAxis ( SGfloat *angle, sgVec3 axis, >const sgQuat src ) { SGfloat a = (SGfloat) >acos ( src[SG_W] ) ; - if ( _isnan(a) || >!_finite(a) ) { + if ( isnan(a) || !finite(a) ) >{ ulSetError(UL_WARNING,"sgQuatToAngleAxis: >acos(%f) %f",src[SG_W],a); if ( >src[SG_W] >= 1 ) a = 0; else if ( src[SG_W] ><= -1 ) a = SG_PI; m. >------------------------------------------------------------------------------ >_______________________________________________ >plib-users mailing list >pli...@li... >https://lists.sourceforge.net/lists/listinfo/plib-users |