type_mat2x3.hpp
00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2006-10-01
00005 // Updated : 2010-02-03
00006 // Licence : This source is under MIT License
00007 // File    : glm/core/type_mat2x3.hpp
00009 
00010 #ifndef glm_core_type_mat2x3
00011 #define glm_core_type_mat2x3
00012 
00013 #include "type_mat.hpp"
00014 
00015 namespace glm{
00016 namespace detail
00017 {
00018         template <typename T> struct tvec1;
00019         template <typename T> struct tvec2;
00020         template <typename T> struct tvec3;
00021         template <typename T> struct tvec4;
00022         template <typename T> struct tmat2x2;
00023         template <typename T> struct tmat2x3;
00024         template <typename T> struct tmat2x4;
00025         template <typename T> struct tmat3x2;
00026         template <typename T> struct tmat3x3;
00027         template <typename T> struct tmat3x4;
00028         template <typename T> struct tmat4x2;
00029         template <typename T> struct tmat4x3;
00030         template <typename T> struct tmat4x4;
00031 
00034         template <typename T> 
00035         struct tmat2x3
00036         {
00037                 enum ctor{null};
00038                 typedef T value_type;
00039                 typedef std::size_t size_type;
00040                 typedef tvec3<T> col_type;
00041                 typedef tvec2<T> row_type;
00042                 static GLM_FUNC_DECL size_type col_size();
00043                 static GLM_FUNC_DECL size_type row_size();
00044 
00045                 typedef tmat2x3<T> type;
00046                 typedef tmat3x2<T> transpose_type;
00047 
00048         private:
00049                 // Data 
00050                 col_type value[2];
00051 
00052         public:
00053                 // Constructors
00054                 GLM_FUNC_DECL tmat2x3();
00055                 GLM_FUNC_DECL tmat2x3(tmat2x3 const & m);
00056 
00057                 GLM_FUNC_DECL explicit tmat2x3(
00058                         ctor);
00059                 GLM_FUNC_DECL explicit tmat2x3(
00060                         value_type const & s);
00061                 GLM_FUNC_DECL explicit tmat2x3(
00062                         value_type const & x0, value_type const & y0, value_type const & z0,
00063                         value_type const & x1, value_type const & y1, value_type const & z1);
00064                 GLM_FUNC_DECL explicit tmat2x3(
00065                         col_type const & v0, 
00066                         col_type const & v1);
00067 
00068             
00070                 // Conversions
00071                 template <typename U> 
00072                 GLM_FUNC_DECL explicit tmat2x3(
00073             U const & x);
00074                         
00075                 template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> 
00076                 GLM_FUNC_DECL explicit tmat2x3(
00077             X1 const & x1, Y1 const & y1, Z1 const & z1, 
00078             X2 const & x2, Y2 const & y2, Z2 const & z2);
00079                         
00080                 template <typename U, typename V> 
00081                 GLM_FUNC_DECL explicit tmat2x3(
00082             tvec3<U> const & v1, 
00083             tvec3<V> const & v2);
00084             
00086         // Matrix conversion
00087                 template <typename U> 
00088                 GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U> const & m);
00089 
00090                 GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T> const & x);
00091                 GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T> const & x);
00092                 GLM_FUNC_DECL explicit tmat2x3(tmat4x4<T> const & x);
00093                 GLM_FUNC_DECL explicit tmat2x3(tmat2x4<T> const & x);
00094                 GLM_FUNC_DECL explicit tmat2x3(tmat3x2<T> const & x);
00095                 GLM_FUNC_DECL explicit tmat2x3(tmat3x4<T> const & x);
00096                 GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T> const & x);
00097                 GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T> const & x);
00098 
00099                 // Accesses
00100                 col_type & operator[](size_type i);
00101                 col_type const & operator[](size_type i) const;
00102 
00103                 // Unary updatable operators
00104                 GLM_FUNC_DECL tmat2x3<T> & operator=  (tmat2x3<T> const & m);
00105                 template <typename U> 
00106                 GLM_FUNC_DECL tmat2x3<T> & operator=  (tmat2x3<U> const & m);
00107                 template <typename U> 
00108                 GLM_FUNC_DECL tmat2x3<T> & operator+= (U const & s);
00109                 template <typename U> 
00110                 GLM_FUNC_DECL tmat2x3<T> & operator+= (tmat2x3<U> const & m);
00111                 template <typename U> 
00112                 GLM_FUNC_DECL tmat2x3<T> & operator-= (U const & s);
00113                 template <typename U> 
00114                 GLM_FUNC_DECL tmat2x3<T> & operator-= (tmat2x3<U> const & m);
00115                 template <typename U> 
00116                 GLM_FUNC_DECL tmat2x3<T> & operator*= (U const & s);
00117                 template <typename U> 
00118                 GLM_FUNC_DECL tmat2x3<T> & operator*= (tmat2x3<U> const & m);
00119                 template <typename U> 
00120                 GLM_FUNC_DECL tmat2x3<T> & operator/= (U const & s);
00121 
00122                 GLM_FUNC_DECL tmat2x3<T> & operator++ ();
00123                 GLM_FUNC_DECL tmat2x3<T> & operator-- ();
00124         };
00125 
00126         // Binary operators
00127         template <typename T> 
00128         tmat2x3<T> operator+ (
00129                 tmat2x3<T> const & m, 
00130                 typename tmat2x3<T>::value_type const & s);
00131             
00132         template <typename T> 
00133         tmat2x3<T> operator+ (
00134                 tmat2x3<T> const & m1, 
00135                 tmat2x3<T> const & m2);
00136             
00137         template <typename T> 
00138         tmat2x3<T> operator- (
00139                 tmat2x3<T> const & m, 
00140                 typename tmat2x3<T>::value_type const & s);
00141 
00142         template <typename T> 
00143         tmat2x3<T> operator- (
00144                 tmat2x3<T> const & m1, 
00145                 tmat2x3<T> const & m2);
00146 
00147         template <typename T> 
00148         tmat2x3<T> operator* (
00149                 tmat2x3<T> const & m, 
00150                 typename tmat2x3<T>::value_type const & s);
00151 
00152         template <typename T> 
00153         tmat2x3<T> operator* (
00154                 typename tmat2x3<T>::value_type const & s, 
00155                 tmat2x3<T> const & m);
00156 
00157         template <typename T>
00158         typename tmat2x3<T>::col_type operator* (
00159                 tmat2x3<T> const & m, 
00160                 typename tmat2x3<T>::row_type const & v);
00161 
00162         template <typename T> 
00163         typename tmat2x3<T>::row_type operator* (
00164                 typename tmat2x3<T>::col_type const & v, 
00165                 tmat2x3<T> const & m);
00166 
00167         template <typename T>
00168         tmat3x3<T> operator* (
00169                 tmat2x3<T> const & m1, 
00170                 tmat3x2<T> const & m2);
00171 
00172         template <typename T> 
00173         tmat2x3<T> operator/ (
00174                 tmat2x3<T> const & m, 
00175                 typename tmat2x3<T>::value_type const & s);
00176 
00177         template <typename T> 
00178         tmat2x3<T> operator/ (
00179                 typename tmat2x3<T>::value_type const & s,
00180                 tmat2x3<T> const & m);
00181 
00182         // Unary constant operators
00183         template <typename T> 
00184         tmat2x3<T> const operator-  (
00185                 tmat2x3<T> const & m);
00186 
00187         template <typename T> 
00188         tmat2x3<T> const operator-- (
00189                 tmat2x3<T> const & m, 
00190                 int);
00191 
00192         template <typename T> 
00193         tmat2x3<T> const operator++ (
00194                 tmat2x3<T> const & m, 
00195                 int);
00196 
00197 } //namespace detail
00198 
00199 namespace core{
00200 namespace type{
00201 namespace precision
00202 {
00207         typedef detail::tmat2x3<lowp_float>             lowp_mat2x3;
00212         typedef detail::tmat2x3<mediump_float>  mediump_mat2x3;
00217         typedef detail::tmat2x3<highp_float>    highp_mat2x3;
00218 }//namespace precision
00219 }//namespace type
00220 }//namespace core
00221 }//namespace glm
00222 
00223 #ifndef GLM_EXTERNAL_TEMPLATE
00224 #include "type_mat2x3.inl"
00225 #endif
00226 
00227 #endif //glm_core_type_mat2x3