1 /***************************************************************************** 2 * $LastChangedDate: 2011-08-20 12:07:38 -0400 (Sat, 20 Aug 2011) $ 3 * @file 4 * @author Jim E. Brooks http://www.palomino3d.org 5 * @brief Matrix definitions. 6 *//* 7 * LEGAL: COPYRIGHT (C) 2004 JIM E. BROOKS 8 * THIS SOURCE CODE IS RELEASED UNDER THE TERMS 9 * OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2). 10 *****************************************************************************/ 11 12 #ifndef MATH_MATRIX_DEFS_HH 13 #define MATH_MATRIX_DEFS_HH 1 14 15 namespace math { 16 17 //////////////////////////////////////////////////////////////////////////////// 18 /////////////////////////// Matrix definitions /////////////////////////////// 19 //////////////////////////////////////////////////////////////////////////////// 20 21 /// Elements in Matrix class (4x3 matrix). 22 const uint MATRIX_ELEMS = 16; 23 24 // The sign of the origin coordinates of the eye matrix is negative. 25 const fp EYE_MATRIX_ORIGIN_SIGN = -1.0; 26 27 // Row-major or column-major. 28 // If row-major, to go to row i, multiply i by amount of columns. 29 #ifndef MATRIX_ROW_MAJOR 30 #define MATRIX_ROW_MAJOR 0 31 #endif 32 33 // Matrix element offsets. 34 #if MATRIX_ROW_MAJOR 35 enum { Xx, Xy, Xz, Ox, 36 Yx, Yy, Yz, Oy, 37 Zx, Zy, Zz, Oz, 38 Xw, Yw, Zw, Ow }; 39 #else 40 enum { Xx, Yx, Zx, Xw, 41 Xy, Yy, Zy, Yw, 42 Xz, Yz, Zz, Zw, 43 Ox, Oy, Oz, Ow }; 44 #endif // MATRIX_ROW_MAJOR 45 46 } // namespace math 47 48 #endif // MATH_MATRIX_DEFS_HH 49