type_mat4x4.hpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #ifndef glm_core_type_mat4x4
00030 #define glm_core_type_mat4x4
00031 
00032 #include "type_mat.hpp"
00033 
00034 namespace glm{
00035 namespace detail
00036 {
00037         template <typename T> struct tvec1;
00038         template <typename T> struct tvec2;
00039         template <typename T> struct tvec3;
00040         template <typename T> struct tvec4;
00041         template <typename T> struct tmat2x2;
00042         template <typename T> struct tmat2x3;
00043         template <typename T> struct tmat2x4;
00044         template <typename T> struct tmat3x2;
00045         template <typename T> struct tmat3x3;
00046         template <typename T> struct tmat3x4;
00047         template <typename T> struct tmat4x2;
00048         template <typename T> struct tmat4x3;
00049         template <typename T> struct tmat4x4;
00050 
00053         template <typename T> 
00054         struct tmat4x4
00055         {
00056                 enum ctor{null};
00057                 typedef T value_type;
00058                 typedef std::size_t size_type;
00059                 typedef tvec4<T> col_type;
00060                 typedef tvec4<T> row_type;
00061         GLM_FUNC_DECL size_type length() const;
00062                 static GLM_FUNC_DECL size_type col_size();
00063                 static GLM_FUNC_DECL size_type row_size();
00064 
00065                 typedef tmat4x4<T> type;
00066                 typedef tmat4x4<T> transpose_type;
00067 
00068         public:
00069                 // Implementation detail
00070                 GLM_FUNC_DECL tmat4x4<T> _inverse() const;
00071 
00072         private:
00073                 // Data 
00074                 col_type value[4];
00075 
00076         public:
00077                 // Constructors
00078                 GLM_FUNC_DECL tmat4x4();
00079                 GLM_FUNC_DECL tmat4x4(tmat4x4 const & m);
00080 
00081                 GLM_FUNC_DECL explicit tmat4x4(
00082                         ctor Null);
00083                 GLM_FUNC_DECL explicit tmat4x4(
00084                         value_type const & x);
00085                 GLM_FUNC_DECL explicit tmat4x4(
00086                         value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0,
00087                         value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1,
00088                         value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2,
00089                         value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3);
00090                 GLM_FUNC_DECL explicit tmat4x4(
00091                         col_type const & v0, 
00092                         col_type const & v1,
00093                         col_type const & v2,
00094                         col_type const & v3);
00095 
00097                 // Conversions
00098                 template <typename U> 
00099                 GLM_FUNC_DECL explicit tmat4x4(
00100             U const & x);
00101                         
00102                 template <
00103             typename X1, typename Y1, typename Z1, typename W1, 
00104             typename X2, typename Y2, typename Z2, typename W2, 
00105             typename X3, typename Y3, typename Z3, typename W3, 
00106             typename X4, typename Y4, typename Z4, typename W4> 
00107                 GLM_FUNC_DECL explicit tmat4x4(
00108             X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, 
00109             X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, 
00110             X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, 
00111             X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
00112                         
00113                 template <typename V1, typename V2, typename V3, typename V4> 
00114                 GLM_FUNC_DECL explicit tmat4x4(
00115             tvec4<V1> const & v1, 
00116             tvec4<V2> const & v2,
00117             tvec4<V3> const & v3,
00118             tvec4<V4> const & v4);
00119             
00120                 // Matrix conversions
00121                 template <typename U> 
00122                 GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U> const & m);
00123 
00124                 GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T> const & x);
00125                 GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T> const & x);
00126                 GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T> const & x);
00127                 GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T> const & x);
00128                 GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T> const & x);
00129                 GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T> const & x);
00130                 GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T> const & x);
00131                 GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T> const & x);
00132 
00133                 // Accesses
00134                 GLM_FUNC_DECL col_type & operator[](size_type i);
00135                 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
00136 
00137                 // Unary updatable operators
00138                 GLM_FUNC_DECL tmat4x4<T> & operator=  (tmat4x4<T> const & m);
00139                 template <typename U>
00140                 GLM_FUNC_DECL tmat4x4<T> & operator=  (tmat4x4<U> const & m);
00141                 template <typename U>
00142                 GLM_FUNC_DECL tmat4x4<T> & operator+= (U const & s);
00143                 template <typename U>
00144                 GLM_FUNC_DECL tmat4x4<T> & operator+= (tmat4x4<U> const & m);
00145                 template <typename U>
00146                 GLM_FUNC_DECL tmat4x4<T> & operator-= (U const & s);
00147                 template <typename U>
00148                 GLM_FUNC_DECL tmat4x4<T> & operator-= (tmat4x4<U> const & m);
00149                 template <typename U>
00150                 GLM_FUNC_DECL tmat4x4<T> & operator*= (U const & s);
00151                 template <typename U>
00152                 GLM_FUNC_DECL tmat4x4<T> & operator*= (tmat4x4<U> const & m);
00153                 template <typename U>
00154                 GLM_FUNC_DECL tmat4x4<T> & operator/= (U const & s);
00155                 template <typename U>
00156                 GLM_FUNC_DECL tmat4x4<T> & operator/= (tmat4x4<U> const & m);
00157                 GLM_FUNC_DECL tmat4x4<T> & operator++ ();
00158                 GLM_FUNC_DECL tmat4x4<T> & operator-- ();
00159         };
00160 
00161         // Binary operators
00162         template <typename T> 
00163         tmat4x4<T> operator+ (
00164                 tmat4x4<T> const & m, 
00165                 typename tmat4x4<T>::value_type const & s);
00166 
00167         template <typename T> 
00168         tmat4x4<T> operator+ (
00169                 typename tmat4x4<T>::value_type const & s, 
00170                 tmat4x4<T> const & m);
00171 
00172         template <typename T> 
00173         tmat4x4<T> operator+ (
00174                 tmat4x4<T> const & m1, 
00175                 tmat4x4<T> const & m2);
00176             
00177         template <typename T> 
00178         tmat4x4<T> operator- (
00179                 tmat4x4<T> const & m, 
00180                 typename tmat4x4<T>::value_type const & s);
00181 
00182         template <typename T> 
00183         tmat4x4<T> operator- (
00184                 typename tmat4x4<T>::value_type const & s, 
00185                 tmat4x4<T> const & m);
00186 
00187         template <typename T> 
00188         tmat4x4<T> operator- (
00189                 tmat4x4<T> const & m1, 
00190                 tmat4x4<T> const & m2);
00191 
00192         template <typename T> 
00193         tmat4x4<T> operator* (
00194                 tmat4x4<T> const & m, 
00195                 typename tmat4x4<T>::value_type const & s);
00196 
00197         template <typename T> 
00198         tmat4x4<T> operator* (
00199                 typename tmat4x4<T>::value_type const & s, 
00200                 tmat4x4<T> const & m);
00201 
00202         template <typename T> 
00203         typename tmat4x4<T>::col_type operator* (
00204                 tmat4x4<T> const & m, 
00205                 typename tmat4x4<T>::row_type const & v);
00206 
00207         template <typename T> 
00208         typename tmat4x4<T>::row_type operator* (
00209                 typename tmat4x4<T>::col_type const & v, 
00210                 tmat4x4<T> const & m);
00211                 
00212         template <typename T>
00213         tmat2x4<T> operator* (
00214                 tmat4x4<T> const & m1, 
00215                 tmat2x4<T> const & m2);
00216 
00217         template <typename T>
00218         tmat3x4<T> operator* (
00219                 tmat4x4<T> const & m1, 
00220                 tmat3x4<T> const & m2);
00221 
00222         template <typename T> 
00223         tmat4x4<T> operator* (
00224                 tmat4x4<T> const & m1, 
00225                 tmat4x4<T> const & m2);
00226 
00227         template <typename T> 
00228         tmat4x4<T> operator/ (
00229                 tmat4x4<T> const & m, 
00230                 typename tmat4x4<T>::value_type const & s);
00231 
00232         template <typename T> 
00233         tmat4x4<T> operator/ (
00234                 typename tmat4x4<T>::value_type const & s, 
00235                 tmat4x4<T> const & m);
00236 
00237         template <typename T> 
00238         typename tmat4x4<T>::col_type operator/ (
00239                 tmat4x4<T> const & m, 
00240                 typename tmat4x4<T>::row_type const & v);
00241 
00242         template <typename T> 
00243         typename tmat4x4<T>::row_type operator/ (
00244                 typename tmat4x4<T>::col_type & v, 
00245                 tmat4x4<T> const & m);
00246 
00247         template <typename T> 
00248         tmat4x4<T> operator/ (
00249                 tmat4x4<T> const & m1, 
00250                 tmat4x4<T> const & m2);
00251 
00252         // Unary constant operators
00253         template <typename T> 
00254         tmat4x4<T> const operator-  (
00255                 tmat4x4<T> const & m);
00256 
00257         template <typename T> 
00258         tmat4x4<T> const operator-- (
00259                 tmat4x4<T> const & m, int);
00260 
00261         template <typename T> 
00262         tmat4x4<T> const operator++ (
00263                 tmat4x4<T> const & m, int);
00264 
00265 } //namespace detail
00266 
00271         typedef detail::tmat4x4<lowp_float>             lowp_mat4;
00272 
00277         typedef detail::tmat4x4<mediump_float>  mediump_mat4;
00278 
00283         typedef detail::tmat4x4<highp_float>    highp_mat4;
00284 
00289         typedef detail::tmat4x4<lowp_float>             lowp_mat4x4;
00290 
00295         typedef detail::tmat4x4<mediump_float>  mediump_mat4x4;
00296 
00301         typedef detail::tmat4x4<highp_float>    highp_mat4x4;
00302 
00303 }//namespace glm
00304 
00305 #ifndef GLM_EXTERNAL_TEMPLATE
00306 #include "type_mat4x4.inl"
00307 #endif//GLM_EXTERNAL_TEMPLATE
00308 
00309 #endif//glm_core_type_mat4x4