- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List

# type_mat2x2.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_mat2x2
    00030 #define glm_core_type_mat2x2
    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 tmat2x2
    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 tvec2<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 tmat2x2<T> type;
    00066                 typedef tmat2x2<T> transpose_type;
    00067
    00068         public:
    00069                 // Implementation detail
    00070                 GLM_FUNC_DECL tmat2x2<T> _inverse() const;
    00071
    00072         private:
    00074                 // Data
    00075                 col_type value[2];
    00076
    00077         public:
    00079                 // Constructors
    00080                 GLM_FUNC_DECL tmat2x2();
    00081                 GLM_FUNC_DECL tmat2x2(
    00082                         tmat2x2 const & m);
    00083
    00084                 GLM_FUNC_DECL explicit tmat2x2(
    00085                         ctor Null);
    00086                 GLM_FUNC_DECL explicit tmat2x2(
    00087                         value_type const & x);
    00088                 GLM_FUNC_DECL explicit tmat2x2(
    00089                         value_type const & x1, value_type const & y1,
    00090                         value_type const & x2, value_type const & y2);
    00091                 GLM_FUNC_DECL explicit tmat2x2(
    00092                         col_type const & v1,
    00093                         col_type const & v2);
    00094
    00096                 // Conversions
    00097                 template <typename U>
    00098                 GLM_FUNC_DECL explicit tmat2x2(
    00099                         U const & x);
    00100
    00101                 template <typename U, typename V, typename M, typename N>
    00102                 GLM_FUNC_DECL explicit tmat2x2(
    00103                         U const & x1, V const & y1,
    00104                         M const & x2, N const & y2);
    00105
    00106                 template <typename U, typename V>
    00107                 GLM_FUNC_DECL explicit tmat2x2(
    00108                         tvec2<U> const & v1,
    00109                         tvec2<V> const & v2);
    00110
    00112                 // Matrix conversions
    00113                 template <typename U>
    00114                 GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U> const & m);
    00115
    00116                 GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T> const & x);
    00117                 GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T> const & x);
    00118                 GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T> const & x);
    00119                 GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T> const & x);
    00120                 GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T> const & x);
    00121                 GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T> const & x);
    00122                 GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T> const & x);
    00123                 GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T> const & x);
    00124
    00126                 // Accesses
    00127
    00128                 GLM_FUNC_DECL col_type & operator[](size_type i);
    00129                 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
    00130
    00131                 // Unary updatable operators
    00132                 GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<T> const & m);
    00133                 template <typename U>
    00134                 GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<U> const & m);
    00135                 template <typename U>
    00136                 GLM_FUNC_DECL tmat2x2<T> & operator+=(U const & s);
    00137                 template <typename U>
    00138                 GLM_FUNC_DECL tmat2x2<T> & operator+=(tmat2x2<U> const & m);
    00139                 template <typename U>
    00140                 GLM_FUNC_DECL tmat2x2<T> & operator-=(U const & s);
    00141                 template <typename U>
    00142                 GLM_FUNC_DECL tmat2x2<T> & operator-=(tmat2x2<U> const & m);
    00143                 template <typename U>
    00144                 GLM_FUNC_DECL tmat2x2<T> & operator*=(U const & s);
    00145                 template <typename U>
    00146                 GLM_FUNC_DECL tmat2x2<T> & operator*=(tmat2x2<U> const & m);
    00147                 template <typename U>
    00148                 GLM_FUNC_DECL tmat2x2<T> & operator/=(U const & s);
    00149                 template <typename U>
    00150                 GLM_FUNC_DECL tmat2x2<T> & operator/=(tmat2x2<U> const & m);
    00151                 GLM_FUNC_DECL tmat2x2<T> & operator++();
    00152                 GLM_FUNC_DECL tmat2x2<T> & operator--();
    00153         };
    00154
    00155         // Binary operators
    00156         template <typename T>
    00157         tmat2x2<T> operator+ (
    00158                 tmat2x2<T> const & m,
    00159                 typename tmat2x2<T>::value_type const & s);
    00160
    00161         template <typename T>
    00162         tmat2x2<T> operator+ (
    00163                 typename tmat2x2<T>::value_type const & s,
    00164                 tmat2x2<T> const & m);
    00165
    00166         template <typename T>
    00167         tmat2x2<T> operator+ (
    00168                 tmat2x2<T> const & m1,
    00169                 tmat2x2<T> const & m2);
    00170
    00171         template <typename T>
    00172         tmat2x2<T> operator- (
    00173                 tmat2x2<T> const & m,
    00174                 typename tmat2x2<T>::value_type const & s);
    00175
    00176         template <typename T>
    00177         tmat2x2<T> operator- (
    00178                 typename tmat2x2<T>::value_type const & s,
    00179                 tmat2x2<T> const & m);
    00180
    00181         template <typename T>
    00182         tmat2x2<T> operator- (
    00183                 tmat2x2<T> const & m1,
    00184                 tmat2x2<T> const & m2);
    00185
    00186         template <typename T>
    00187         tmat2x2<T> operator* (
    00188                 tmat2x2<T> const & m,
    00189                 typename tmat2x2<T>::value_type const & s);
    00190
    00191         template <typename T>
    00192         tmat2x2<T> operator* (
    00193                 typename tmat2x2<T>::value_type const & s,
    00194                 tmat2x2<T> const & m);
    00195
    00196         template <typename T>
    00197         typename tmat2x2<T>::col_type operator* (
    00198                 tmat2x2<T> const & m,
    00199                 typename tmat2x2<T>::row_type const & v);
    00200
    00201         template <typename T>
    00202         typename tmat2x2<T>::row_type operator* (
    00203                 typename tmat2x2<T>::col_type const & v,
    00204                 tmat2x2<T> const & m);
    00205
    00206         template <typename T>
    00207         tmat2x2<T> operator* (
    00208                 tmat2x2<T> const & m1,
    00209                 tmat2x2<T> const & m2);
    00210
    00211         template <typename T>
    00212         tmat3x2<T> operator* (
    00213                 tmat2x2<T> const & m1,
    00214                 tmat3x2<T> const & m2);
    00215
    00216         template <typename T>
    00217         tmat4x2<T> operator* (
    00218                 tmat2x2<T> const & m1,
    00219                 tmat4x2<T> const & m2);
    00220
    00221         template <typename T>
    00222         tmat2x2<T> operator/ (
    00223                 tmat2x2<T> const & m,
    00224                 typename tmat2x2<T>::value_type const & s);
    00225
    00226         template <typename T>
    00227         tmat2x2<T> operator/ (
    00228                 typename tmat2x2<T>::value_type const & s,
    00229                 tmat2x2<T> const & m);
    00230
    00231         template <typename T>
    00232         typename tmat2x2<T>::col_type operator/ (
    00233                 tmat2x2<T> const & m,
    00234                 typename tmat2x2<T>::row_type const & v);
    00235
    00236         template <typename T>
    00237         typename tmat2x2<T>::row_type operator/ (
    00238                 typename tmat2x2<T>::col_type const & v,
    00239                 tmat2x2<T> const & m);
    00240
    00241         template <typename T>
    00242         tmat2x2<T> operator/ (
    00243                 tmat2x2<T> const & m1,
    00244                 tmat2x2<T> const & m2);
    00245
    00246         // Unary constant operators
    00247         template <typename T>
    00248         tmat2x2<T> const operator-  (
    00249                 tmat2x2<T> const & m);
    00250
    00251         template <typename T>
    00252         tmat2x2<T> const operator-- (
    00253                 tmat2x2<T> const & m,
    00254                 int);
    00255
    00256         template <typename T>
    00257         tmat2x2<T> const operator++ (
    00258                 tmat2x2<T> const & m,
    00259                 int);
    00260 } //namespace detail
    00261
    00266         typedef detail::tmat2x2<lowp_float>             lowp_mat2;
    00267
    00272         typedef detail::tmat2x2<mediump_float>  mediump_mat2;
    00273
    00278         typedef detail::tmat2x2<highp_float>    highp_mat2;
    00279
    00284         typedef detail::tmat2x2<lowp_float>             lowp_mat2x2;
    00285
    00290         typedef detail::tmat2x2<mediump_float>  mediump_mat2x2;
    00291
    00296         typedef detail::tmat2x2<highp_float>    highp_mat2x2;
    00297
    00298 }//namespace glm
    00299
    00300 #ifndef GLM_EXTERNAL_TEMPLATE
    00301 #include "type_mat2x2.inl"
    00302 #endif
    00303
    00304 #endif //glm_core_type_mat2x2