type_mat4x2.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_mat4x2
00030 #define glm_core_type_mat4x2
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 
00051         // \brief Template for 4 columns and 2 rows matrix of floating-point numbers.
00052         // \ingroup core_template
00053         template <typename T> 
00054         struct tmat4x2
00055         {
00056                 enum ctor{null};
00057                 typedef T value_type;
00058                 typedef std::size_t size_type;
00059                 typedef tvec2<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 tmat4x2<T> type;
00066                 typedef tmat2x4<T> transpose_type;
00067 
00068         private:
00069                 // Data 
00070                 col_type value[4];
00071 
00072         public:
00073                 // Constructors
00074                 GLM_FUNC_DECL tmat4x2();
00075                 GLM_FUNC_DECL tmat4x2(tmat4x2 const & m);
00076 
00077                 GLM_FUNC_DECL explicit tmat4x2(
00078                         ctor Null);
00079                 GLM_FUNC_DECL explicit tmat4x2(
00080                         value_type const & x);
00081                 GLM_FUNC_DECL explicit tmat4x2(
00082                         value_type const & x0, value_type const & y0,
00083                         value_type const & x1, value_type const & y1,
00084                         value_type const & x2, value_type const & y2,
00085                         value_type const & x3, value_type const & y3);
00086                 GLM_FUNC_DECL explicit tmat4x2(
00087                         col_type const & v0, 
00088                         col_type const & v1,
00089                         col_type const & v2,
00090                         col_type const & v3);
00091             
00093                 // Conversions
00094                 template <typename U> 
00095                 GLM_FUNC_DECL explicit tmat4x2(
00096             U const & x);
00097                         
00098                 template 
00099         <
00100             typename X1, typename Y1, 
00101             typename X2, typename Y2, 
00102             typename X3, typename Y3,
00103             typename X4, typename Y4
00104         > 
00105                 GLM_FUNC_DECL explicit tmat4x2(
00106             X1 const & x1, Y1 const & y1, 
00107             X2 const & x2, Y2 const & y2,
00108             X3 const & x3, Y3 const & y3,
00109             X4 const & x4, Y4 const & y4);
00110                         
00111                 template <typename V1, typename V2, typename V3, typename V4> 
00112                 GLM_FUNC_DECL explicit tmat4x2(
00113             tvec2<V1> const & v1, 
00114             tvec2<V2> const & v2,
00115             tvec2<V3> const & v3,
00116             tvec2<V4> const & v4);
00117             
00118                 // Matrix conversions
00119                 template <typename U> 
00120                 GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U> const & m);
00121                         
00122                 GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T> const & x);
00123                 GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T> const & x);
00124                 GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T> const & x);
00125                 GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T> const & x);
00126                 GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T> const & x);
00127                 GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T> const & x);
00128                 GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T> const & x);
00129                 GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T> const & x);
00130 
00131                 // Accesses
00132                 GLM_FUNC_DECL col_type & operator[](size_type i);
00133                 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
00134 
00135                 // Unary updatable operators
00136                 GLM_FUNC_DECL tmat4x2<T>& operator=  (tmat4x2<T> const & m);
00137                 template <typename U> 
00138                 GLM_FUNC_DECL tmat4x2<T>& operator=  (tmat4x2<U> const & m);
00139                 template <typename U> 
00140                 GLM_FUNC_DECL tmat4x2<T>& operator+= (U const & s);
00141                 template <typename U> 
00142                 GLM_FUNC_DECL tmat4x2<T>& operator+= (tmat4x2<U> const & m);
00143                 template <typename U> 
00144                 GLM_FUNC_DECL tmat4x2<T>& operator-= (U const & s);
00145                 template <typename U> 
00146                 GLM_FUNC_DECL tmat4x2<T>& operator-= (tmat4x2<U> const & m);
00147                 template <typename U> 
00148                 GLM_FUNC_DECL tmat4x2<T>& operator*= (U const & s);
00149                 template <typename U> 
00150                 GLM_FUNC_DECL tmat4x2<T>& operator*= (tmat4x2<U> const & m);
00151                 template <typename U> 
00152                 GLM_FUNC_DECL tmat4x2<T>& operator/= (U const & s);
00153 
00154                 GLM_FUNC_DECL tmat4x2<T>& operator++ ();
00155                 GLM_FUNC_DECL tmat4x2<T>& operator-- ();
00156         };
00157 
00158         // Binary operators
00159         template <typename T> 
00160         tmat4x2<T> operator+ (
00161                 tmat4x2<T> const & m, 
00162                 typename tmat4x2<T>::value_type const & s);
00163             
00164         template <typename T> 
00165         tmat4x2<T> operator+ (
00166                 tmat4x2<T> const & m1, 
00167                 tmat4x2<T> const & m2);
00168             
00169         template <typename T> 
00170         tmat4x2<T> operator- (
00171                 tmat4x2<T> const & m, 
00172                 typename tmat4x2<T>::value_type const & s);
00173 
00174         template <typename T> 
00175         tmat4x2<T> operator- (
00176                 tmat4x2<T> const & m1, 
00177                 tmat4x2<T> const & m2);
00178 
00179         template <typename T> 
00180         tmat4x2<T> operator* (
00181                 tmat4x2<T> const & m, 
00182                 typename tmat4x2<T>::value_type const & s);
00183 
00184         template <typename T> 
00185         tmat4x2<T> operator* (
00186                 typename tmat4x2<T>::value_type const & s, 
00187                 tmat4x2<T> const & m);
00188 
00189         template <typename T>
00190         typename tmat4x2<T>::col_type operator* (
00191                 tmat4x2<T> const & m, 
00192                 typename tmat4x2<T>::row_type const & v);
00193 
00194         template <typename T> 
00195         typename tmat4x2<T>::row_type operator* (
00196                 typename tmat4x2<T>::col_type const & v, 
00197                 tmat4x2<T> const & m);
00198 
00199         template <typename T>
00200         tmat3x2<T> operator* (
00201                 tmat4x2<T> const & m1, 
00202                 tmat3x4<T> const & m2);
00203                 
00204         template <typename T>
00205         tmat4x2<T> operator* (
00206                 tmat4x2<T> const & m1, 
00207                 tmat4x4<T> const & m2);
00208                 
00209         template <typename T>
00210         tmat2x3<T> operator* (
00211                 tmat4x3<T> const & m1, 
00212                 tmat2x4<T> const & m2);
00213 
00214         template <typename T> 
00215         tmat4x2<T> operator/ (
00216                 tmat4x2<T> const & m, 
00217                 typename tmat4x2<T>::value_type const & s);
00218 
00219         template <typename T> 
00220         tmat4x2<T> operator/ (
00221                 typename tmat4x2<T>::value_type const & s, 
00222                 tmat4x2<T> const & m);
00223 
00224         // Unary constant operators
00225         template <typename T> 
00226         tmat4x2<T> const operator-  (
00227                 tmat4x2<T> const & m);
00228 
00229         template <typename T> 
00230         tmat4x2<T> const operator-- (
00231                 tmat4x2<T> const & m, 
00232                 int);
00233 
00234         template <typename T> 
00235         tmat4x2<T> const operator++ (
00236                 tmat4x2<T> const & m, 
00237                 int);
00238 
00239 } //namespace detail
00240 
00243 
00249         typedef detail::tmat4x2<lowp_float>             lowp_mat4x2;
00250 
00256         typedef detail::tmat4x2<mediump_float>  mediump_mat4x2;
00257 
00263         typedef detail::tmat4x2<highp_float>    highp_mat4x2;
00264 
00266 }//namespace glm
00267 
00268 #ifndef GLM_EXTERNAL_TEMPLATE
00269 #include "type_mat4x2.inl"
00270 #endif
00271 
00272 #endif //glm_core_type_mat4x2