--- ray/src/common/mat4.c 1990/12/15 15:01:38 1.5 +++ ray/src/common/mat4.c 1991/11/12 16:54:53 2.1 @@ -12,22 +12,11 @@ static char SCCSid[] = "$SunId$ LBL"; #include "mat4.h" +MAT4 m4ident = MAT4IDENT; + static MAT4 m4tmp; /* for efficiency */ -setident4(m4) -MAT4 m4; -{ - static MAT4 ident = { - 1.,0.,0.,0., - 0.,1.,0.,0., - 0.,0.,1.,0., - 0.,0.,0.,1., - }; - copymat4(m4, ident); -} - - multmat4(m4a, m4b, m4c) /* multiply m4b X m4c and put into m4a */ MAT4 m4a; register MAT4 m4b, m4c; @@ -72,7 +61,6 @@ register MAT4 m4; } -#ifdef INVMAT /* * invmat - computes the inverse of mat into inverse. Returns 1 * if there exists an inverse, 0 otherwise. It uses Gaussian Elimination @@ -89,7 +77,7 @@ MAT4 mat, inverse; register double temp; copymat4(m4tmp, mat); - setident(inverse); + setident4(inverse); for(i = 0; i < 4; i++) { /* Look for row with largest pivot and swap rows */ @@ -127,4 +115,3 @@ MAT4 mat, inverse; #undef ABS #undef SWAP } -#endif