type_mat4x4.hpp
00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
00009 
00010 #ifndef glm_core_type_mat4x4
00011 #define glm_core_type_mat4x4
00012 
00013 #include "type_mat.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 
00040                 template <typename T> 
00041                 struct tmat4x4
00042                 {
00043                         enum ctor{null};
00044                         typedef T value_type;
00045                         typedef std::size_t size_type;
00046                         typedef tvec4<T> col_type;
00047                         typedef tvec4<T> row_type;
00048                         static GLM_FUNC_DECL size_type col_size();
00049                         static GLM_FUNC_DECL size_type row_size();
00050 
00051                         typedef tmat4x4<T> type;
00052                         typedef tmat4x4<T> transpose_type;
00053 
00054                 public:
00055                         // Implementation detail
00056                         GLM_FUNC_DECL tmat4x4<T> _inverse() const;
00057 
00058                 private:
00059                         // Data 
00060                         col_type value[4];
00061 
00062                 public:
00063                         // Constructors
00064                         GLM_FUNC_DECL tmat4x4();
00065                         GLM_FUNC_DECL tmat4x4(tmat4x4 const & m);
00066 
00067                         GLM_FUNC_DECL explicit tmat4x4(
00068                                 ctor Null);
00069                         GLM_FUNC_DECL explicit tmat4x4(
00070                                 value_type const & x);
00071                         GLM_FUNC_DECL explicit tmat4x4(
00072                                 value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0,
00073                                 value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1,
00074                                 value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2,
00075                                 value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3);
00076                         GLM_FUNC_DECL explicit tmat4x4(
00077                                 col_type const & v0, 
00078                                 col_type const & v1,
00079                                 col_type const & v2,
00080                                 col_type const & v3);
00081 
00082                         // Conversions
00083                         template <typename U> 
00084                         GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U> const & m);
00085 
00086                         GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T> const & x);
00087                         GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T> const & x);
00088                         GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T> const & x);
00089                         GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T> const & x);
00090                         GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T> const & x);
00091                         GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T> const & x);
00092                         GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T> const & x);
00093                         GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T> const & x);
00094 
00095                         // Accesses
00096                         GLM_FUNC_DECL col_type & operator[](size_type i);
00097                         GLM_FUNC_DECL col_type const & operator[](size_type i) const;
00098 
00099                         // Unary updatable operators
00100                         GLM_FUNC_DECL tmat4x4<T> & operator=  (tmat4x4<T> const & m);
00101                         template <typename U>
00102                         GLM_FUNC_DECL tmat4x4<T> & operator=  (tmat4x4<U> const & m);
00103                         template <typename U>
00104                         GLM_FUNC_DECL tmat4x4<T> & operator+= (U const & s);
00105                         template <typename U>
00106                         GLM_FUNC_DECL tmat4x4<T> & operator+= (tmat4x4<U> const & m);
00107                         template <typename U>
00108                         GLM_FUNC_DECL tmat4x4<T> & operator-= (U const & s);
00109                         template <typename U>
00110                         GLM_FUNC_DECL tmat4x4<T> & operator-= (tmat4x4<U> const & m);
00111                         template <typename U>
00112                         GLM_FUNC_DECL tmat4x4<T> & operator*= (U const & s);
00113                         template <typename U>
00114                         GLM_FUNC_DECL tmat4x4<T> & operator*= (tmat4x4<U> const & m);
00115                         template <typename U>
00116                         GLM_FUNC_DECL tmat4x4<T> & operator/= (U const & s);
00117                         template <typename U>
00118                         GLM_FUNC_DECL tmat4x4<T> & operator/= (tmat4x4<U> const & m);
00119                         GLM_FUNC_DECL tmat4x4<T> & operator++ ();
00120                         GLM_FUNC_DECL tmat4x4<T> & operator-- ();
00121                 };
00122 
00123                 // Binary operators
00124                 template <typename T> 
00125                 tmat4x4<T> operator+ (
00126                         tmat4x4<T> const & m, 
00127                         typename tmat4x4<T>::value_type const & s);
00128 
00129                 template <typename T> 
00130                 tmat4x4<T> operator+ (
00131                         typename tmat4x4<T>::value_type const & s, 
00132                         tmat4x4<T> const & m);
00133 
00134                 template <typename T> 
00135                 tmat4x4<T> operator+ (
00136                         tmat4x4<T> const & m1, 
00137                         tmat4x4<T> const & m2);
00138             
00139                 template <typename T> 
00140                 tmat4x4<T> operator- (
00141                         tmat4x4<T> const & m, 
00142                         typename tmat4x4<T>::value_type const & s);
00143 
00144                 template <typename T> 
00145                 tmat4x4<T> operator- (
00146                         typename tmat4x4<T>::value_type const & s, 
00147                         tmat4x4<T> const & m);
00148 
00149                 template <typename T> 
00150                 tmat4x4<T> operator- (
00151                         tmat4x4<T> const & m1, 
00152                         tmat4x4<T> const & m2);
00153 
00154                 template <typename T> 
00155                 tmat4x4<T> operator* (
00156                         tmat4x4<T> const & m, 
00157                         typename tmat4x4<T>::value_type const & s);
00158 
00159                 template <typename T> 
00160                 tmat4x4<T> operator* (
00161                         typename tmat4x4<T>::value_type const & s, 
00162                         tmat4x4<T> const & m);
00163 
00164                 template <typename T> 
00165                 typename tmat4x4<T>::col_type operator* (
00166                         tmat4x4<T> const & m, 
00167                         typename tmat4x4<T>::row_type const & v);
00168 
00169                 template <typename T> 
00170                 typename tmat4x4<T>::row_type operator* (
00171                         typename tmat4x4<T>::col_type const & v, 
00172                         tmat4x4<T> const & m);
00173 
00174                 template <typename T> 
00175                 tmat4x4<T> operator* (
00176                         tmat4x4<T> const & m1, 
00177                         tmat4x4<T> const & m2);
00178 
00179                 template <typename T> 
00180                 tmat4x4<T> operator/ (
00181                         tmat4x4<T> const & m, 
00182                         typename tmat4x4<T>::value_type const & s);
00183 
00184                 template <typename T> 
00185                 tmat4x4<T> operator/ (
00186                         typename tmat4x4<T>::value_type const & s, 
00187                         tmat4x4<T> const & m);
00188 
00189                 template <typename T> 
00190                 typename tmat4x4<T>::col_type operator/ (
00191                         tmat4x4<T> const & m, 
00192                         typename tmat4x4<T>::row_type const & v);
00193 
00194                 template <typename T> 
00195                 typename tmat4x4<T>::row_type operator/ (
00196                         typename tmat4x4<T>::col_type & v, 
00197                         tmat4x4<T> const & m);
00198 
00199                 template <typename T> 
00200                 tmat4x4<T> operator/ (
00201                         tmat4x4<T> const & m1, 
00202                         tmat4x4<T> const & m2);
00203 
00204                 // Unary constant operators
00205                 template <typename T> 
00206                 tmat4x4<T> const operator-  (
00207                         tmat4x4<T> const & m);
00208 
00209                 template <typename T> 
00210                 tmat4x4<T> const operator-- (
00211                         tmat4x4<T> const & m, int);
00212 
00213                 template <typename T> 
00214                 tmat4x4<T> const operator++ (
00215                         tmat4x4<T> const & m, int);
00216 
00217         } //namespace detail
00218 
00219         namespace core{
00220         namespace type{
00221 
00222         namespace precision
00223         {
00228                 typedef detail::tmat4x4<lowp_float>             lowp_mat4x4;
00233                 typedef detail::tmat4x4<mediump_float>  mediump_mat4x4;
00238                 typedef detail::tmat4x4<highp_float>    highp_mat4x4;
00239         }
00240         //namespace precision
00241 
00242         }//namespace type
00243         }//namespace core
00244 } //namespace glm
00245 
00246 #ifndef GLM_EXTERNAL_TEMPLATE
00247 #include "type_mat4x4.inl"
00248 #endif
00249 
00250 #endif //glm_core_type_mat4x4