00001
00002
00004
00005
00006
00007
00009
00010 #ifndef glm_core_type_mat2x2
00011 #define glm_core_type_mat2x2
00012
00013 #include "type_size.hpp"
00014
00015 namespace glm
00016 {
00017 namespace test
00018 {
00019 void main_mat2x2();
00020 }
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
00039 template <typename T>
00040 struct tmat2x2
00041 {
00042 public:
00043 typedef tmat2x2<T>* pointer;
00044 typedef const tmat2x2<T>* const_pointer;
00045 typedef const tmat2x2<T>*const const_pointer_const;
00046 typedef tmat2x2<T>*const pointer_const;
00047 typedef tmat2x2<T>& reference;
00048 typedef const tmat2x2<T>& const_reference;
00049 typedef const tmat2x2<T>& param_type;
00050 typedef tmat2x2<T> transpose_type;
00051
00052 typedef T value_type;
00053 typedef detail::tvec2<T> col_type;
00054 typedef detail::tvec2<T> row_type;
00055 typedef glm::sizeType size_type;
00056 static size_type value_size();
00057 static size_type col_size();
00058 static size_type row_size();
00059 static bool is_matrix();
00060
00061 public:
00062 tmat2x2<T> _inverse() const;
00063
00064 private:
00065
00066 detail::tvec2<T> value[2];
00067
00068 public:
00069
00070 tmat2x2();
00071 tmat2x2(tmat2x2<T> const & m);
00072
00073 explicit tmat2x2(const T x);
00074 explicit tmat2x2(
00075 const T x1, const T y1,
00076 const T x2, const T y2);
00077 explicit tmat2x2(
00078 const detail::tvec2<T> & v1,
00079 const detail::tvec2<T> & v2);
00080
00081
00082 template <typename U>
00083 explicit tmat2x2(const tmat2x2<U>& m);
00084
00085 explicit tmat2x2(const tmat3x3<T>& x);
00086 explicit tmat2x2(const tmat4x4<T>& x);
00087 explicit tmat2x2(const tmat2x3<T>& x);
00088 explicit tmat2x2(const tmat3x2<T>& x);
00089 explicit tmat2x2(const tmat2x4<T>& x);
00090 explicit tmat2x2(const tmat4x2<T>& x);
00091 explicit tmat2x2(const tmat3x4<T>& x);
00092 explicit tmat2x2(const tmat4x3<T>& x);
00093
00095
00096
00097 detail::tvec2<T>& operator[](size_type i);
00098 detail::tvec2<T> const & operator[](size_type i) const;
00099
00100
00101 tmat2x2<T>& operator=(tmat2x2<T> const & m);
00102 tmat2x2<T>& operator+=(const T & s);
00103 tmat2x2<T>& operator+=(tmat2x2<T> const & m);
00104 tmat2x2<T>& operator-=(const T & s);
00105 tmat2x2<T>& operator-=(tmat2x2<T> const & m);
00106 tmat2x2<T>& operator*=(const T & s);
00107 tmat2x2<T>& operator*= (tmat2x2<T> const & m);
00108 tmat2x2<T>& operator/= (const T & s);
00109 tmat2x2<T>& operator/= (tmat2x2<T> const & m);
00110 tmat2x2<T>& operator++ ();
00111 tmat2x2<T>& operator-- ();
00112 };
00113
00114
00115 template <typename T>
00116 tmat2x2<T> operator+ (tmat2x2<T> const & m, const T & s);
00117
00118 template <typename T>
00119 tmat2x2<T> operator+ (const T & s, tmat2x2<T> const & m);
00120
00121 template <typename T>
00122 tmat2x2<T> operator+ (tmat2x2<T> const & m1, tmat2x2<T> const & m2);
00123
00124 template <typename T>
00125 tmat2x2<T> operator- (tmat2x2<T> const & m, const T & s);
00126
00127 template <typename T>
00128 tmat2x2<T> operator- (const T & s, tmat2x2<T> const & m);
00129
00130 template <typename T>
00131 tmat2x2<T> operator- (tmat2x2<T> const & m1, tmat2x2<T> const & m2);
00132
00133 template <typename T>
00134 tmat2x2<T> operator* (tmat2x2<T> const & m, const T & s);
00135
00136 template <typename T>
00137 tmat2x2<T> operator* (const T & s, tmat2x2<T> const & m);
00138
00139 template <typename T>
00140 tvec2<T> operator* (tmat2x2<T> const & m, const tvec2<T>& v);
00141
00142 template <typename T>
00143 tvec2<T> operator* (const tvec2<T>& v, tmat2x2<T> const & m);
00144
00145 template <typename T>
00146 tmat2x2<T> operator* (tmat2x2<T> const & m1, tmat2x2<T> const & m2);
00147
00148 template <typename T>
00149 tmat2x2<T> operator/ (tmat2x2<T> const & m, const T & s);
00150
00151 template <typename T>
00152 tmat2x2<T> operator/ (const T & s, tmat2x2<T> const & m);
00153
00154 template <typename T>
00155 tvec2<T> operator/ (tmat2x2<T> const & m, const tvec2<T>& v);
00156
00157 template <typename T>
00158 tvec2<T> operator/ (const tvec2<T>& v, tmat2x2<T> const & m);
00159
00160 template <typename T>
00161 tmat2x2<T> operator/ (tmat2x2<T> const & m1, tmat2x2<T> const & m2);
00162
00163
00164 template <typename valType>
00165 tmat2x2<valType> const operator- (tmat2x2<valType> const & m);
00166
00167 template <typename valType>
00168 tmat2x2<valType> const operator-- (tmat2x2<valType> const & m, int);
00169
00170 template <typename valType>
00171 tmat2x2<valType> const operator++ (tmat2x2<valType> const & m, int);
00172
00173 }
00174
00175 namespace core{
00176 namespace type{
00177 namespace matrix{
00178
00179 namespace precision
00180 {
00184 typedef detail::tmat2x2<lowp_float> lowp_mat2x2;
00188 typedef detail::tmat2x2<mediump_float> mediump_mat2x2;
00192 typedef detail::tmat2x2<highp_float> highp_mat2x2;
00193 }
00194
00195
00196 #ifndef GLM_PRECISION
00199 typedef detail::tmat2x2<mediump_float> mat2x2;
00200 #elif(GLM_PRECISION & GLM_PRECISION_HIGH)
00201 typedef detail::tmat2x2<highp_float> mat2x2;
00202 #elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)
00203 typedef detail::tmat2x2<mediump_float> mat2x2;
00204 #elif(GLM_PRECISION & GLM_PRECISION_LOW)
00205 typedef detail::tmat2x2<lowp_float> mat2x2;
00206 #else
00207 typedef detail::tmat2x2<mediump_float> mat2x2;
00208 #endif//GLM_PRECISION
00209
00212 typedef mat2x2 mat2;
00213
00214 }
00215 }
00216 }
00217 }
00218
00219 #include "type_mat2x2.inl"
00220
00221 #endif //glm_core_type_mat2x2