[Plib-cvs] CVS: plib/src/sg sg.cxx,1.27,1.28 sg.h,1.30,1.31
Brought to you by:
sjbaker
From: M?rten Str?m. <str...@us...> - 2002-01-25 16:28:04
|
Update of /cvsroot/plib/plib/src/sg In directory usw-pr-cvs1:/tmp/cvs-serv16016/src/sg Modified Files: sg.cxx sg.h Log Message: Added documentation for sgClassifyMat4. Index: sg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- sg.cxx 2001/11/07 23:51:09 1.27 +++ sg.cxx 2002/01/25 16:28:00 1.28 @@ -1603,7 +1603,7 @@ if ( n > 1 ) flags |= SG_ROTATION ; - if ( n % 2 ) + if ( n % 2 != 0 ) flags |= SG_MIRROR ; sx = m[0][0] * m[0][0] ; @@ -1640,12 +1640,13 @@ if ( sgAbs ( sx - sy ) > epsilon || sgAbs ( sx - sz ) > epsilon ) { - flags |= SG_GENERAL_SCALE ; + flags |= SG_NONORTHO ; + flags |= SG_GENERAL_SCALE ; // also set general scale bit, though it may be deleted in the future } else { if ( sgAbs ( sx - SG_ONE ) > epsilon ) - flags |= SG_UNIFORM_SCALE ; + flags |= SG_SCALE ; } Index: sg.h =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- sg.h 2002/01/01 15:40:32 1.30 +++ sg.h 2002/01/25 16:28:00 1.31 @@ -180,11 +180,15 @@ #define SG_IDENTITY 0x00 // for clarity #define SG_ROTATION 0x01 // includes a rotational component #define SG_MIRROR 0x02 // changes handedness (det < 0) -#define SG_UNIFORM_SCALE 0x04 // uniform scaling -#define SG_GENERAL_SCALE 0x08 // x, y and z scaled differently -#define SG_NONORTHO 0x10 // 3x3 row vectors not orthogonal +#define SG_SCALE 0x04 // uniform scaling +#define SG_NONORTHO 0x10 // 3x3 not orthogonal #define SG_TRANSLATION 0x20 // translates #define SG_PROJECTION 0x40 // forth column not 0,0,0,1 + +/* Are these needed? sgClassifyMat4() does set the general scale bit for some matrices, + * but it is not easily defined. Use SG_NONORTHO instead (which is also set). */ +#define SG_UNIFORM_SCALE SG_SCALE +#define SG_GENERAL_SCALE 0x08 // x, y and z scaled differently extern int sgClassifyMat4 ( const sgMat4 mat ) ; |