# GLM: type_mat4x4.hpp Source File

- Main Page
- Namespaces
- Files

- File List

# type_mat4x4.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)
    00004 // Created : 2005-01-27
    00005 // Updated : 2008-08-30
    00006 // Licence : This source is under MIT License
    00007 // File    : glm/core/type_mat4x4.h
    00009
    00010 #ifndef glm_core_type_mat4x4
    00011 #define glm_core_type_mat4x4
    00012
    00013 #include "type_size.hpp"
    00014
    00015 namespace glm
    00016 {
    00017         namespace test
    00018         {
    00019                 void main_mat4x4();
    00020         }//namespace test
    00021
    00022         namespace detail
    00023         {
    00024                 template <typename T> struct tvec1;
    00025                 template <typename T> struct tvec2;
    00026                 template <typename T> struct tvec3;
    00027                 template <typename T> struct tvec4;
    00028                 template <typename T> struct tmat2x2;
    00029                 template <typename T> struct tmat2x3;
    00030                 template <typename T> struct tmat2x4;
    00031                 template <typename T> struct tmat3x2;
    00032                 template <typename T> struct tmat3x3;
    00033                 template <typename T> struct tmat3x4;
    00034                 template <typename T> struct tmat4x2;
    00035                 template <typename T> struct tmat4x3;
    00036                 template <typename T> struct tmat4x4;
    00037
    00039                 template <typename T>
    00040                 struct tmat4x4
    00041                 {
    00042                 public:
    00043                         enum ctor{null};
    00044
    00045                         typedef tmat4x4<T>* pointer;
    00046                         typedef const tmat4x4<T>* const_pointer;
    00047                         typedef const tmat4x4<T>*const const_pointer_const;
    00048                         typedef tmat4x4<T>*const pointer_const;
    00049                         typedef tmat4x4<T>& reference;
    00050                         typedef const tmat4x4<T>& const_reference;
    00051                         typedef const tmat4x4<T>& param_type;
    00052                         typedef tmat4x4<T> transpose_type;
    00053
    00054                         typedef T value_type;
    00055                         typedef tvec4<T> col_type;
    00056                         typedef tvec4<T> row_type;
    00057                         typedef glm::sizeType size_type;
    00058                         static size_type value_size();
    00059                         static size_type col_size();
    00060                         static size_type row_size();
    00061                         static bool is_matrix();
    00062
    00063                 public:
    00064                         tmat4x4<T> _inverse() const;
    00065
    00066                 private:
    00067                         // Data
    00068                         detail::tvec4<T> value[4];
    00069
    00070                 public:
    00071                         // Constructors
    00072                         tmat4x4();
    00073                         explicit tmat4x4(ctor Null);
    00074                         explicit tmat4x4(T const & x);
    00075                         explicit tmat4x4(
    00076                                 const T x0, const T y0, const T z0, const T w0,
    00077                                 const T x1, const T y1, const T z1, const T w1,
    00078                                 const T x2, const T y2, const T z2, const T w2,
    00079                                 const T x3, const T y3, const T z3, const T w3);
    00080                         explicit tmat4x4(
    00081                                 detail::tvec4<T> const & v0,
    00082                                 detail::tvec4<T> const & v1,
    00083                                 detail::tvec4<T> const & v2,
    00084                                 detail::tvec4<T> const & v3);
    00085
    00086                         // Conversions
    00087                         template <typename U>
    00088                         explicit tmat4x4(tmat4x4<U> const & m);
    00089
    00090                         explicit tmat4x4(tmat2x2<T> const & x);
    00091                         explicit tmat4x4(tmat3x3<T> const & x);
    00092                         explicit tmat4x4(tmat2x3<T> const & x);
    00093                         explicit tmat4x4(tmat3x2<T> const & x);
    00094                         explicit tmat4x4(tmat2x4<T> const & x);
    00095                         explicit tmat4x4(tmat4x2<T> const & x);
    00096                         explicit tmat4x4(tmat3x4<T> const & x);
    00097                         explicit tmat4x4(tmat4x3<T> const & x);
    00098
    00099                         // Accesses
    00100                         detail::tvec4<T>& operator[](size_type i);
    00101                         detail::tvec4<T> const & operator[](size_type i) const;
    00102
    00103                         // Unary updatable operators
    00104                         tmat4x4<T>& operator= (tmat4x4<T> const & m);
    00105                         tmat4x4<T>& operator+= (T const & s);
    00106                         tmat4x4<T>& operator+= (tmat4x4<T> const & m);
    00107                         tmat4x4<T>& operator-= (T const & s);
    00108                         tmat4x4<T>& operator-= (tmat4x4<T> const & m);
    00109                         tmat4x4<T>& operator*= (T const & s);
    00110                         tmat4x4<T>& operator*= (tmat4x4<T> const & m);
    00111                         tmat4x4<T>& operator/= (T const & s);
    00112                         tmat4x4<T>& operator/= (tmat4x4<T> const & m);
    00113                         tmat4x4<T>& operator++ ();
    00114                         tmat4x4<T>& operator-- ();
    00115                 };
    00116
    00117                 // Binary operators
    00118                 template <typename valType>
    00119                 tmat4x4<valType> operator+ (const tmat4x4<valType>& m, valType const & s);
    00120
    00121                 template <typename valType>
    00122                 tmat4x4<valType> operator+ (valType const & s, const tmat4x4<valType>& m);
    00123
    00124                 template <typename T>
    00125                 tmat4x4<T> operator+ (const tmat4x4<T>& m1, const tmat4x4<T>& m2);
    00126
    00127                 template <typename T>
    00128                 tmat4x4<T> operator- (const tmat4x4<T>& m, const T & s);
    00129
    00130                 template <typename T>
    00131                 tmat4x4<T> operator- (const T & s, const tmat4x4<T>& m);
    00132
    00133                 template <typename T>
    00134                 tmat4x4<T> operator- (const tmat4x4<T>& m1, const tmat4x4<T>& m2);
    00135
    00136                 template <typename T>
    00137                 tmat4x4<T> operator* (const tmat4x4<T>& m, const T & s);
    00138
    00139                 template <typename T>
    00140                 tmat4x4<T> operator* (const T & s, const tmat4x4<T>& m);
    00141
    00142                 template <typename T>
    00143                 detail::tvec4<T> operator* (const tmat4x4<T>& m, const detail::tvec4<T>& v);
    00144
    00145                 template <typename T>
    00146                 detail::tvec4<T> operator* (const detail::tvec4<T>& v, const tmat4x4<T>& m);
    00147
    00148                 template <typename T>
    00149                 tmat4x4<T> operator* (const tmat4x4<T>& m1, const tmat4x4<T>& m2);
    00150
    00151                 template <typename T>
    00152                 tmat4x4<T> operator/ (const tmat4x4<T>& m, const T & s);
    00153
    00154                 template <typename T>
    00155                 tmat4x4<T> operator/ (const T & s, const tmat4x4<T>& m);
    00156
    00157                 template <typename T>
    00158                 detail::tvec4<T> operator/ (const tmat4x4<T>& m, const detail::tvec4<T>& v);
    00159
    00160                 template <typename T>
    00161                 detail::tvec4<T> operator/ (const detail::tvec4<T>& v, const tmat4x4<T>& m);
    00162
    00163                 template <typename T>
    00164                 tmat4x4<T> operator/ (const tmat4x4<T>& m1, const tmat4x4<T>& m2);
    00165
    00166                 // Unary constant operators
    00167                 template <typename valType>
    00168                 tmat4x4<valType> const operator-  (tmat4x4<valType> const & m);
    00169
    00170                 template <typename valType>
    00171                 tmat4x4<valType> const operator-- (tmat4x4<valType> const & m, int);
    00172
    00173                 template <typename valType>
    00174                 tmat4x4<valType> const operator++ (tmat4x4<valType> const & m, int);
    00175
    00176         } //namespace detail
    00177
    00178         namespace core{
    00179         namespace type{
    00180         namespace matrix{
    00181
    00182         namespace precision
    00183         {
    00187                 typedef detail::tmat4x4<lowp_float>             lowp_mat4x4;
    00191                 typedef detail::tmat4x4<mediump_float>  mediump_mat4x4;
    00195                 typedef detail::tmat4x4<highp_float>    highp_mat4x4;
    00196         }
    00197         //namespace precision
    00198
    00199 #ifndef GLM_PRECISION
    00202         typedef detail::tmat4x4<mediump_float>  mat4x4;
    00203 #elif(GLM_PRECISION & GLM_PRECISION_HIGH)
    00204         typedef detail::tmat4x4<highp_float>    mat4x4;
    00205 #elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)
    00206         typedef detail::tmat4x4<mediump_float>  mat4x4;
    00207 #elif(GLM_PRECISION & GLM_PRECISION_LOW)
    00208         typedef detail::tmat4x4<lowp_float>             mat4x4;
    00209 #else
    00210         typedef detail::tmat4x4<mediump_float>  mat4x4;
    00211 #endif//GLM_PRECISION
    00212
    00215         typedef mat4x4                                                  mat4;
    00216
    00217         }//namespace matrix
    00218         }//namespace type
    00219         }//namespace core
    00220 } //namespace glm
    00221
    00222 #include "type_mat4x4.inl"
    00223
    00224 #endif //glm_core_type_mat4x4