type_mat2x4.hpp

00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2006-08-05
00005 // Updated : 2010-02-11
00006 // Licence : This source is under MIT License
00007 // File    : glm/core/type_mat2x4.hpp
00009 
00010 #ifndef glm_core_type_mat2x4
00011 #define glm_core_type_mat2x4
00012 
00013 #include "type_mat.hpp"
00014 
00015 namespace glm
00016 {
00017         namespace test
00018         {
00019                 void main_mat2x4();
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 tmat2x4
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 tvec2<T> row_type;
00048                         static size_type col_size();
00049                         static size_type row_size();
00050 
00051                         typedef tmat2x4<T> type;
00052                         typedef tmat4x2<T> transpose_type;
00053 
00054                 private:
00055                         // Data 
00056                         col_type value[2];
00057 
00058                 public:
00059                         // Constructors
00060                         tmat2x4();
00061                         tmat2x4(tmat2x4 const & m);
00062 
00063                         explicit tmat2x4(
00064                                 ctor);
00065                         explicit tmat2x4(
00066                                 value_type const & s);
00067                         explicit tmat2x4(
00068                                 value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0,
00069                                 value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1);
00070                         explicit tmat2x4(
00071                                 col_type const & v0, 
00072                                 col_type const & v1);
00073 
00074                         // Conversion
00075                         template <typename U> 
00076                         explicit tmat2x4(tmat2x4<U> const & m);
00077 
00078                         explicit tmat2x4(tmat2x2<T> const & x);
00079                         explicit tmat2x4(tmat3x3<T> const & x);
00080                         explicit tmat2x4(tmat4x4<T> const & x);
00081                         explicit tmat2x4(tmat2x3<T> const & x);
00082                         explicit tmat2x4(tmat3x2<T> const & x);
00083                         explicit tmat2x4(tmat3x4<T> const & x);
00084                         explicit tmat2x4(tmat4x2<T> const & x);
00085                         explicit tmat2x4(tmat4x3<T> const & x);
00086 
00087                         // Accesses
00088                         col_type & operator[](size_type i);
00089                         col_type const & operator[](size_type i) const;
00090 
00091                         // Unary updatable operators
00092                         tmat2x4<T>& operator=  (tmat2x4<T> const & m);
00093                         template <typename U> 
00094                         tmat2x4<T>& operator=  (tmat2x4<U> const & m);
00095                         template <typename U> 
00096                         tmat2x4<T>& operator+= (U const & s);
00097                         template <typename U> 
00098                         tmat2x4<T>& operator+= (tmat2x4<U> const & m);
00099                         template <typename U> 
00100                         tmat2x4<T>& operator-= (U const & s);
00101                         template <typename U> 
00102                         tmat2x4<T>& operator-= (tmat2x4<U> const & m);
00103                         template <typename U> 
00104                         tmat2x4<T>& operator*= (U const & s);
00105                         template <typename U> 
00106                         tmat2x4<T>& operator*= (tmat2x4<U> const & m);
00107                         template <typename U> 
00108                         tmat2x4<T>& operator/= (U const & s);
00109 
00110                         tmat2x4<T>& operator++ ();
00111                         tmat2x4<T>& operator-- ();
00112                 };
00113 
00114                 // Binary operators
00115                 template <typename T> 
00116                 tmat2x4<T> operator+ (
00117                         tmat2x4<T> const & m, 
00118                         typename tmat2x4<T>::value_type const & s);
00119             
00120                 template <typename T> 
00121                 tmat2x4<T> operator+ (
00122                         tmat2x4<T> const & m1, 
00123                         tmat2x4<T> const & m2);
00124             
00125                 template <typename T> 
00126                 tmat2x4<T> operator- (
00127                         tmat2x4<T> const & m, 
00128                         typename tmat2x4<T>::value_type const & s);
00129 
00130                 template <typename T> 
00131                 tmat2x4<T> operator- (
00132                         tmat2x4<T> const & m1, 
00133                         tmat2x4<T> const & m2);
00134 
00135                 template <typename T> 
00136                 tmat2x4<T> operator* (
00137                         tmat2x4<T> const & m, 
00138                         typename tmat2x4<T>::value_type const & s);
00139 
00140                 template <typename T> 
00141                 tmat2x4<T> operator* (
00142                         typename tmat2x4<T>::value_type const & s, 
00143                         tmat2x4<T> const & m);
00144 
00145                 template <typename T>
00146                 typename tmat2x4<T>::col_type operator* (
00147                         tmat2x4<T> const & m, 
00148                         typename tmat2x4<T>::row_type const & v);
00149 
00150                 template <typename T> 
00151                 typename tmat2x4<T>::row_type operator* (
00152                         typename tmat2x4<T>::col_type const & v, 
00153                         tmat2x4<T> const & m);
00154 
00155                 template <typename T>
00156                 tmat2x4<T> operator* (
00157                         tmat2x4<T> const & m1, 
00158                         tmat2x4<T> const & m2);
00159 
00160                 template <typename T> 
00161                 tmat2x4<T> operator/ (
00162                         tmat2x4<T> const & m, 
00163                         typename tmat2x4<T>::value_type const & s);
00164 
00165                 template <typename T> 
00166                 tmat2x4<T> operator/ (
00167                         typename tmat2x4<T>::value_type const & s, 
00168                         tmat2x4<T> const & m);
00169 
00170                 // Unary constant operators
00171                 template <typename T> 
00172                 tmat2x4<T> const operator-  (
00173                         tmat2x4<T> const & m);
00174 
00175                 template <typename T> 
00176                 tmat2x4<T> const operator-- (
00177                         tmat2x4<T> const & m, 
00178                         int);
00179 
00180                 template <typename T> 
00181                 tmat2x4<T> const operator++ (
00182                         tmat2x4<T> const & m, 
00183                         int);
00184 
00185         } //namespace detail
00186 
00187         namespace core{
00188         namespace type{
00189 
00190         namespace precision
00191         {
00195                 typedef detail::tmat2x4<lowp_float>             lowp_mat2x4;
00199                 typedef detail::tmat2x4<mediump_float>  mediump_mat2x4;
00203                 typedef detail::tmat2x4<highp_float>    highp_mat2x4;
00204         }
00205         //namespace precision
00206 
00207         }//namespace type
00208         }//namespace core
00209 } //namespace glm
00210 
00211 #ifndef GLM_EXTERNAL_TEMPLATE
00212 #include "type_mat2x4.inl"
00213 #endif
00214 
00215 #endif //glm_core_type_mat2x4