diff --git a/matrix.cpp b/matrix.cpp index 0ea559e1..fa539c58 100644 --- a/matrix.cpp +++ b/matrix.cpp @@ -19,56 +19,6 @@ using cruft::matrix; /////////////////////////////////////////////////////////////////////////////// -//----------------------------------------------------------------------------- -//template -//matrix& -//matrix::invert_affine (void) -//{ -// CHECK (is_affine ()); -// -// // inv ([ M b ] == [ inv(M) -inv(M).b ] -// // [ 0 1 ]) [ 0 1 ] -// -// // Invert the 3x3 M -// T A = (values[1][1] * values[2][2] - values[1][2] * values[2][1]); -// T B = (values[1][2] * values[2][0] - values[1][0] * values[2][2]); -// T C = (values[1][0] * values[2][1] - values[1][1] * values[2][0]); -// -// T D = (values[0][2] * values[2][1] - values[0][1] * values[2][2]); -// T E = (values[0][0] * values[2][2] - values[0][2] * values[2][0]); -// T F = (values[2][0] * values[0][1] - values[0][0] * values[2][1]); -// -// T G = (values[0][1] * values[1][2] - values[0][2] * values[1][1]); -// T H = (values[0][2] * values[1][0] - values[0][0] * values[1][2]); -// T K = (values[0][0] * values[1][1] - values[0][1] * values[1][0]); -// -// T d = values[0][0] * A + values[0][1] * B + values[0][2] * C; -// CHECK_NEQ (d, 0.0); -// -// values[0][0] = A / d; -// values[0][1] = D / d; -// values[0][2] = G / d; -// values[1][0] = B / d; -// values[1][1] = E / d; -// values[1][2] = H / d; -// values[2][0] = C / d; -// values[2][1] = F / d; -// values[2][2] = K / d; -// -// // Multiply the b -// T b0 = - values[0][0] * values[0][3] - values[0][1] * values[1][3] - values[0][2] * values[2][3]; -// T b1 = - values[1][0] * values[0][3] - values[1][1] * values[1][3] - values[1][2] * values[2][3]; -// T b2 = - values[2][0] * values[0][3] - values[2][1] * values[1][3] - values[2][2] * values[2][3]; -// -// values[0][3] = b0; -// values[1][3] = b1; -// values[2][3] = b2; -// -// return *this; -//} - - -//----------------------------------------------------------------------------- template T cruft::matrix::determinant (void) const @@ -223,53 +173,7 @@ cruft::look_at (const cruft::point<3,T> eye, template cruft::matrix4f cruft::look_at (cruft::point3f, cruft::point3f, cruft::vector3f); -//----------------------------------------------------------------------------- -//template -//cruft::matrix4 -//cruft::translation (cruft::vector<3,T> v) -//{ -// return { { -// { 1.f, 0.f, 0.f, v.x }, -// { 0.f, 1.f, 0.f, v.y }, -// { 0.f, 0.f, 1.f, v.z }, -// { 0.f, 0.f, 0.f, 1.f }, -// } }; -//} -// -// -//template cruft::matrix4f cruft::translation (cruft::vector3f); - - -//----------------------------------------------------------------------------- -#if 0 -template -cruft::matrix4 -cruft::scale (T mag) -{ - return scale (vector<3,T> (mag)); -} - -template cruft::matrix4f cruft::scale(float); -#endif - - -//----------------------------------------------------------------------------- -//template -//cruft::matrix4 -//cruft::scale (cruft::vector<3,T> v) -//{ -// return { { -// { v.x, 0.f, 0.f, 0.f }, -// { 0.f, v.y, 0.f, 0.f }, -// { 0.f, 0.f, v.z, 0.f }, -// { 0.f, 0.f, 0.f, 1.f } -// } }; -//} - -//template cruft::matrix4f cruft::scale(cruft::vector3f); - - -//----------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////////////// template cruft::matrix4 cruft::rotation (T angle, cruft::vector<3,T> about)