type_mat3x3.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_mat3x3
00030 #define glm_core_type_mat3x3
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 3 * 3 matrix of floating-point numbers.
00052         // @ingroup core_template
00053         template <typename T> 
00054         struct tmat3x3
00055         {
00056                 enum ctor{null};
00057                 typedef T value_type;
00058                 typedef std::size_t size_type;
00059                 typedef tvec3<T> col_type;
00060                 typedef tvec3<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 tmat3x3<T> type;
00066                 typedef tmat3x3<T> transpose_type;
00067 
00068         public:
00071                 GLM_FUNC_DECL tmat3x3<T> _inverse() const;
00073         
00074         private:
00075                 // Data
00076                 col_type value[3];
00077 
00078         public:
00079                 // Constructors
00080                 GLM_FUNC_DECL tmat3x3();
00081                 GLM_FUNC_DECL tmat3x3(tmat3x3 const & m);
00082 
00083                 GLM_FUNC_DECL explicit tmat3x3(
00084                         ctor Null);
00085                 GLM_FUNC_DECL explicit tmat3x3(
00086                         value_type const & s);
00087                 GLM_FUNC_DECL explicit tmat3x3(
00088                         value_type const & x0, value_type const & y0, value_type const & z0,
00089                         value_type const & x1, value_type const & y1, value_type const & z1,
00090                         value_type const & x2, value_type const & y2, value_type const & z2);
00091                 GLM_FUNC_DECL explicit tmat3x3(
00092                         col_type const & v0, 
00093                         col_type const & v1,
00094                         col_type const & v2);
00095 
00097                 // Conversions
00098                 template <typename U> 
00099                 GLM_FUNC_DECL explicit tmat3x3(
00100             U const & x);
00101                         
00102                 template 
00103         <
00104             typename X1, typename Y1, typename Z1, 
00105             typename X2, typename Y2, typename Z2, 
00106             typename X3, typename Y3, typename Z3
00107         > 
00108                 GLM_FUNC_DECL explicit tmat3x3(
00109             X1 const & x1, Y1 const & y1, Z1 const & z1, 
00110             X2 const & x2, Y2 const & y2, Z2 const & z2, 
00111             X3 const & x3, Y3 const & y3, Z3 const & z3);
00112                         
00113                 template <typename V1, typename V2, typename V3> 
00114                 GLM_FUNC_DECL explicit tmat3x3(
00115             tvec3<V1> const & v1, 
00116             tvec3<V2> const & v2,
00117             tvec3<V3> const & v3);
00118             
00119                 // Matrix conversions
00120                 template <typename U> 
00121                 GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U> const & m);
00122 
00123                 GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T> const & x);
00124                 GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T> const & x);
00125                 GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T> const & x);
00126                 GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T> const & x);
00127                 GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T> const & x);
00128                 GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T> const & x);
00129                 GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T> const & x);
00130                 GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T> const & x);
00131 
00132                 // Accesses
00133                 GLM_FUNC_DECL col_type & operator[](size_type i);
00134                 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
00135 
00136                 // Unary updatable operators
00137                 GLM_FUNC_DECL tmat3x3<T>& operator=  (tmat3x3<T> const & m);
00138                 template <typename U> 
00139                 GLM_FUNC_DECL tmat3x3<T>& operator=  (tmat3x3<U> const & m);
00140                 template <typename U> 
00141                 GLM_FUNC_DECL tmat3x3<T>& operator+= (U const & s);
00142                 template <typename U> 
00143                 GLM_FUNC_DECL tmat3x3<T>& operator+= (tmat3x3<U> const & m);
00144                 template <typename U> 
00145                 GLM_FUNC_DECL tmat3x3<T>& operator-= (U const & s);
00146                 template <typename U> 
00147                 GLM_FUNC_DECL tmat3x3<T>& operator-= (tmat3x3<U> const & m);
00148                 template <typename U> 
00149                 GLM_FUNC_DECL tmat3x3<T>& operator*= (U const & s);
00150                 template <typename U> 
00151                 GLM_FUNC_DECL tmat3x3<T>& operator*= (tmat3x3<U> const & m);
00152                 template <typename U> 
00153                 GLM_FUNC_DECL tmat3x3<T>& operator/= (U const & s);
00154                 template <typename U> 
00155                 GLM_FUNC_DECL tmat3x3<T>& operator/= (tmat3x3<U> const & m);
00156                 GLM_FUNC_DECL tmat3x3<T>& operator++ ();
00157                 GLM_FUNC_DECL tmat3x3<T>& operator-- ();
00158         };
00159 
00160         // Binary operators
00161         template <typename T> 
00162         tmat3x3<T> operator+ (
00163                 tmat3x3<T> const & m, 
00164                 typename tmat3x3<T>::value_type const & s);
00165 
00166         template <typename T> 
00167         tmat3x3<T> operator+ (
00168                 typename tmat3x3<T>::value_type const & s, 
00169                 tmat3x3<T> const & m);
00170 
00171         template <typename T> 
00172         tmat3x3<T> operator+ (
00173                 tmat3x3<T> const & m1, 
00174                 tmat3x3<T> const & m2);
00175             
00176         template <typename T> 
00177         tmat3x3<T> operator- (
00178                 tmat3x3<T> const & m, 
00179                 typename tmat3x3<T>::value_type const & s);
00180 
00181         template <typename T> 
00182         tmat3x3<T> operator- (
00183                 typename tmat3x3<T>::value_type const & s, 
00184                 tmat3x3<T> const & m);
00185 
00186         template <typename T> 
00187         tmat3x3<T> operator- (
00188                 tmat3x3<T> const & m1, 
00189                 tmat3x3<T> const & m2);
00190 
00191         template <typename T> 
00192         tmat3x3<T> operator* (
00193                 tmat3x3<T> const & m, 
00194                 typename tmat3x3<T>::value_type const & s);
00195 
00196         template <typename T> 
00197         tmat3x3<T> operator* (
00198                 typename tmat3x3<T>::value_type const & s, 
00199                 tmat3x3<T> const & m);
00200 
00201         template <typename T> 
00202         typename tmat3x3<T>::col_type operator* (
00203                 tmat3x3<T> const & m, 
00204                 typename tmat3x3<T>::row_type const & v);
00205 
00206         template <typename T> 
00207         typename tmat3x3<T>::row_type operator* (
00208                 typename tmat3x3<T>::col_type const & v, 
00209                 tmat3x3<T> const & m);
00210 
00211         template <typename T> 
00212         tmat3x3<T> operator* (
00213                 tmat3x3<T> const & m1, 
00214                 tmat3x3<T> const & m2);
00215                 
00216         template <typename T>
00217         tmat2x3<T> operator* (
00218                 tmat3x3<T> const & m1, 
00219                 tmat2x3<T> const & m2);
00220                 
00221         template <typename T>
00222         tmat4x3<T> operator* (
00223                 tmat3x3<T> const & m1, 
00224                 tmat4x3<T> const & m2);
00225 
00226         template <typename T> 
00227         tmat3x3<T> operator/ (
00228                 tmat3x3<T> const & m, 
00229                 typename tmat3x3<T>::value_type const & s);
00230 
00231         template <typename T> 
00232         tmat3x3<T> operator/ (
00233                 typename tmat3x3<T>::value_type const & s, 
00234                 tmat3x3<T> const & m);
00235 
00236         template <typename T> 
00237         typename tmat3x3<T>::col_type operator/ (
00238                 tmat3x3<T> const & m, 
00239                 typename tmat3x3<T>::row_type const & v);
00240 
00241         template <typename T> 
00242         typename tmat3x3<T>::row_type operator/ (
00243                 typename tmat3x3<T>::col_type const & v, 
00244                 tmat3x3<T> const & m);
00245 
00246         template <typename T> 
00247         tmat3x3<T> operator/ (
00248                 tmat3x3<T> const & m1, 
00249                 tmat3x3<T> const & m2);
00250 
00251         // Unary constant operators
00252         template <typename T> 
00253         tmat3x3<T> const operator-  (
00254                 tmat3x3<T> const & m);
00255 
00256         template <typename T> 
00257         tmat3x3<T> const operator-- (
00258                 tmat3x3<T> const & m, 
00259                 int);
00260 
00261         template <typename T> 
00262         tmat3x3<T> const operator++ (
00263                 tmat3x3<T> const & m, 
00264                 int);
00265 
00266 } //namespace detail
00267 
00270 
00276         typedef detail::tmat3x3<lowp_float>             lowp_mat3;
00277         
00283         typedef detail::tmat3x3<mediump_float>  mediump_mat3;
00284         
00290         typedef detail::tmat3x3<highp_float>    highp_mat3;
00291 
00297         typedef detail::tmat3x3<lowp_float>             lowp_mat3x3;
00298 
00304         typedef detail::tmat3x3<mediump_float>  mediump_mat3x3;
00305 
00311         typedef detail::tmat3x3<highp_float>    highp_mat3x3;
00312 
00314 }//namespace glm
00315 
00316 #ifndef GLM_EXTERNAL_TEMPLATE
00317 #include "type_mat3x3.inl"
00318 #endif
00319 
00320 #endif //glm_core_type_mat3x3