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