type_mat3x3.hpp
00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2005-01-27
00005 // Updated : 2010-02-03
00006 // Licence : This source is under MIT License
00007 // File    : glm/core/type_mat3x3.hpp
00009 
00010 #ifndef glm_core_type_mat3x3
00011 #define glm_core_type_mat3x3
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 tmat3x3
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 tvec3<T> row_type;
00042                 static GLM_FUNC_DECL size_type col_size();
00043                 static GLM_FUNC_DECL size_type row_size();
00044 
00045                 typedef tmat3x3<T> type;
00046                 typedef tmat3x3<T> transpose_type;
00047 
00048         public:
00049                 // Implementation detail
00050                 GLM_FUNC_DECL tmat3x3<T> _inverse() const;
00051 
00052         private:
00053                 // Data
00054                 col_type value[3];
00055 
00056         public:
00057                 // Constructors
00058                 GLM_FUNC_DECL tmat3x3();
00059                 GLM_FUNC_DECL tmat3x3(tmat3x3 const & m);
00060 
00061                 GLM_FUNC_DECL explicit tmat3x3(
00062                         ctor Null);
00063                 GLM_FUNC_DECL explicit tmat3x3(
00064                         value_type const & s);
00065                 GLM_FUNC_DECL explicit tmat3x3(
00066                         value_type const & x0, value_type const & y0, value_type const & z0,
00067                         value_type const & x1, value_type const & y1, value_type const & z1,
00068                         value_type const & x2, value_type const & y2, value_type const & z2);
00069                 GLM_FUNC_DECL explicit tmat3x3(
00070                         col_type const & v0, 
00071                         col_type const & v1,
00072                         col_type const & v2);
00073 
00075                 // Conversions
00076                 template <typename U> 
00077                 GLM_FUNC_DECL explicit tmat3x3(
00078             U const & x);
00079                         
00080                 template 
00081         <
00082             typename X1, typename Y1, typename Z1, 
00083             typename X2, typename Y2, typename Z2, 
00084             typename X3, typename Y3, typename Z3
00085         > 
00086                 GLM_FUNC_DECL explicit tmat3x3(
00087             X1 const & x1, Y1 const & y1, Z1 const & z1, 
00088             X2 const & x2, Y2 const & y2, Z2 const & z2, 
00089             X3 const & x3, Y3 const & y3, Z3 const & z3);
00090                         
00091                 template <typename V1, typename V2, typename V3> 
00092                 GLM_FUNC_DECL explicit tmat3x3(
00093             tvec3<V1> const & v1, 
00094             tvec3<V2> const & v2,
00095             tvec3<V3> const & v3);
00096             
00097                 // Matrix conversions
00098                 template <typename U> 
00099                 GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U> const & m);
00100 
00101                 GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T> const & x);
00102                 GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T> const & x);
00103                 GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T> const & x);
00104                 GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T> const & x);
00105                 GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T> const & x);
00106                 GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T> const & x);
00107                 GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T> const & x);
00108                 GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T> const & x);
00109 
00110                 // Accesses
00111                 GLM_FUNC_DECL col_type & operator[](size_type i);
00112                 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
00113 
00114                 // Unary updatable operators
00115                 GLM_FUNC_DECL tmat3x3<T>& operator=  (tmat3x3<T> const & m);
00116                 template <typename U> 
00117                 GLM_FUNC_DECL tmat3x3<T>& operator=  (tmat3x3<U> const & m);
00118                 template <typename U> 
00119                 GLM_FUNC_DECL tmat3x3<T>& operator+= (U const & s);
00120                 template <typename U> 
00121                 GLM_FUNC_DECL tmat3x3<T>& operator+= (tmat3x3<U> const & m);
00122                 template <typename U> 
00123                 GLM_FUNC_DECL tmat3x3<T>& operator-= (U const & s);
00124                 template <typename U> 
00125                 GLM_FUNC_DECL tmat3x3<T>& operator-= (tmat3x3<U> const & m);
00126                 template <typename U> 
00127                 GLM_FUNC_DECL tmat3x3<T>& operator*= (U const & s);
00128                 template <typename U> 
00129                 GLM_FUNC_DECL tmat3x3<T>& operator*= (tmat3x3<U> const & m);
00130                 template <typename U> 
00131                 GLM_FUNC_DECL tmat3x3<T>& operator/= (U const & s);
00132                 template <typename U> 
00133                 GLM_FUNC_DECL tmat3x3<T>& operator/= (tmat3x3<U> const & m);
00134                 GLM_FUNC_DECL tmat3x3<T>& operator++ ();
00135                 GLM_FUNC_DECL tmat3x3<T>& operator-- ();
00136         };
00137 
00138         // Binary operators
00139         template <typename T> 
00140         tmat3x3<T> operator+ (
00141                 tmat3x3<T> const & m, 
00142                 typename tmat3x3<T>::value_type const & s);
00143 
00144         template <typename T> 
00145         tmat3x3<T> operator+ (
00146                 typename tmat3x3<T>::value_type const & s, 
00147                 tmat3x3<T> const & m);
00148 
00149         template <typename T> 
00150         tmat3x3<T> operator+ (
00151                 tmat3x3<T> const & m1, 
00152                 tmat3x3<T> const & m2);
00153             
00154         template <typename T> 
00155         tmat3x3<T> operator- (
00156                 tmat3x3<T> const & m, 
00157                 typename tmat3x3<T>::value_type const & s);
00158 
00159         template <typename T> 
00160         tmat3x3<T> operator- (
00161                 typename tmat3x3<T>::value_type const & s, 
00162                 tmat3x3<T> const & m);
00163 
00164         template <typename T> 
00165         tmat3x3<T> operator- (
00166                 tmat3x3<T> const & m1, 
00167                 tmat3x3<T> const & m2);
00168 
00169         template <typename T> 
00170         tmat3x3<T> operator* (
00171                 tmat3x3<T> const & m, 
00172                 typename tmat3x3<T>::value_type const & s);
00173 
00174         template <typename T> 
00175         tmat3x3<T> operator* (
00176                 typename tmat3x3<T>::value_type const & s, 
00177                 tmat3x3<T> const & m);
00178 
00179         template <typename T> 
00180         typename tmat3x3<T>::col_type operator* (
00181                 tmat3x3<T> const & m, 
00182                 typename tmat3x3<T>::row_type const & v);
00183 
00184         template <typename T> 
00185         typename tmat3x3<T>::row_type operator* (
00186                 typename tmat3x3<T>::col_type const & v, 
00187                 tmat3x3<T> const & m);
00188 
00189         template <typename T> 
00190         tmat3x3<T> operator* (
00191                 tmat3x3<T> const & m1, 
00192                 tmat3x3<T> const & m2);
00193 
00194         template <typename T> 
00195         tmat3x3<T> operator/ (
00196                 tmat3x3<T> const & m, 
00197                 typename tmat3x3<T>::value_type const & s);
00198 
00199         template <typename T> 
00200         tmat3x3<T> operator/ (
00201                 typename tmat3x3<T>::value_type const & s, 
00202                 tmat3x3<T> const & m);
00203 
00204         template <typename T> 
00205         typename tmat3x3<T>::col_type operator/ (
00206                 tmat3x3<T> const & m, 
00207                 typename tmat3x3<T>::row_type const & v);
00208 
00209         template <typename T> 
00210         typename tmat3x3<T>::row_type operator/ (
00211                 typename tmat3x3<T>::col_type const & v, 
00212                 tmat3x3<T> const & m);
00213 
00214         template <typename T> 
00215         tmat3x3<T> operator/ (
00216                 tmat3x3<T> const & m1, 
00217                 tmat3x3<T> const & m2);
00218 
00219         // Unary constant operators
00220         template <typename T> 
00221         tmat3x3<T> const operator-  (
00222                 tmat3x3<T> const & m);
00223 
00224         template <typename T> 
00225         tmat3x3<T> const operator-- (
00226                 tmat3x3<T> const & m, 
00227                 int);
00228 
00229         template <typename T> 
00230         tmat3x3<T> const operator++ (
00231                 tmat3x3<T> const & m, 
00232                 int);
00233 
00234 } //namespace detail
00235 
00236 namespace core{
00237 namespace type{
00238 namespace precision
00239 {
00244         typedef detail::tmat3x3<lowp_float>             lowp_mat3;
00249         typedef detail::tmat3x3<mediump_float>  mediump_mat3;
00254         typedef detail::tmat3x3<highp_float>    highp_mat3;
00255 
00260         typedef detail::tmat3x3<lowp_float>             lowp_mat3x3;
00261 
00266         typedef detail::tmat3x3<mediump_float>  mediump_mat3x3;
00267 
00272         typedef detail::tmat3x3<highp_float>    highp_mat3x3;
00273 
00274 }//namespace precision
00275 }//namespace type
00276 }//namespace core
00277 }//namespace glm
00278 
00279 #ifndef GLM_EXTERNAL_TEMPLATE
00280 #include "type_mat3x3.inl"
00281 #endif
00282 
00283 #endif //glm_core_type_mat3x3