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 #pragma once
00030
00031 #include "../fwd.hpp"
00032 #include "type_vec2.hpp"
00033 #include "type_mat.hpp"
00034 #include <limits>
00035 #if GLM_HAS_INITIALIZER_LISTS
00036 # include <initializer_list>
00037 #endif
00038 #if GLM_HAS_RVALUE_REFERENCES
00039 # include <algorithm>
00040 #endif
00041 #include <limits>
00042 #include <cstddef>
00043
00044 namespace glm{
00045 namespace detail
00046 {
00047 template <typename T, precision P>
00048 struct tmat2x2
00049 {
00050 enum ctor{_null};
00051 typedef T value_type;
00052 typedef std::size_t size_type;
00053 typedef tvec2<T, P> col_type;
00054 typedef tvec2<T, P> row_type;
00055 typedef tmat2x2<T, P> type;
00056 typedef tmat2x2<T, P> transpose_type;
00057
00058 GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
00059
00060 template <typename U, precision Q>
00061 friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);
00062 template <typename U, precision Q>
00063 friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
00064
00065 private:
00067 col_type value[2];
00069
00070 public:
00072
00073 GLM_FUNC_DECL tmat2x2();
00074 GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m);
00075 template <precision Q>
00076 GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
00077
00078 GLM_FUNC_DECL explicit tmat2x2(
00079 ctor Null);
00080 GLM_FUNC_DECL explicit tmat2x2(
00081 T const & x);
00082 GLM_FUNC_DECL tmat2x2(
00083 T const & x1, T const & y1,
00084 T const & x2, T const & y2);
00085 GLM_FUNC_DECL tmat2x2(
00086 col_type const & v1,
00087 col_type const & v2);
00088
00090
00091 template <typename U, typename V, typename M, typename N>
00092 GLM_FUNC_DECL tmat2x2(
00093 U const & x1, V const & y1,
00094 M const & x2, N const & y2);
00095
00096 template <typename U, typename V>
00097 GLM_FUNC_DECL tmat2x2(
00098 tvec2<U, P> const & v1,
00099 tvec2<V, P> const & v2);
00100
00102
00103 template <typename U, precision Q>
00104 GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
00105
00106 GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
00107 GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
00108 GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T, P> const & x);
00109 GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T, P> const & x);
00110 GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T, P> const & x);
00111 GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T, P> const & x);
00112 GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T, P> const & x);
00113 GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T, P> const & x);
00114
00116
00117
00118 GLM_FUNC_DECL col_type & operator[](length_t i);
00119 GLM_FUNC_DECL col_type const & operator[](length_t i) const;
00120
00121 GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & m);
00122 template <typename U>
00123 GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
00124 template <typename U>
00125 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
00126 template <typename U>
00127 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m);
00128 template <typename U>
00129 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
00130 template <typename U>
00131 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m);
00132 template <typename U>
00133 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
00134 template <typename U>
00135 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m);
00136 template <typename U>
00137 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
00138 template <typename U>
00139 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
00140
00142
00143
00144 GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
00145 GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
00146 GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
00147 GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
00148 };
00149
00150
00151 template <typename T, precision P>
00152 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
00153 tmat2x2<T, P> const & m,
00154 T const & s);
00155
00156 template <typename T, precision P>
00157 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
00158 T const & s,
00159 tmat2x2<T, P> const & m);
00160
00161 template <typename T, precision P>
00162 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
00163 tmat2x2<T, P> const & m1,
00164 tmat2x2<T, P> const & m2);
00165
00166 template <typename T, precision P>
00167 GLM_FUNC_DECL tmat2x2<T, P> operator- (
00168 tmat2x2<T, P> const & m,
00169 T const & s);
00170
00171 template <typename T, precision P>
00172 GLM_FUNC_DECL tmat2x2<T, P> operator- (
00173 T const & s,
00174 tmat2x2<T, P> const & m);
00175
00176 template <typename T, precision P>
00177 GLM_FUNC_DECL tmat2x2<T, P> operator- (
00178 tmat2x2<T, P> const & m1,
00179 tmat2x2<T, P> const & m2);
00180
00181 template <typename T, precision P>
00182 GLM_FUNC_DECL tmat2x2<T, P> operator* (
00183 tmat2x2<T, P> const & m,
00184 T const & s);
00185
00186 template <typename T, precision P>
00187 GLM_FUNC_DECL tmat2x2<T, P> operator* (
00188 T const & s,
00189 tmat2x2<T, P> const & m);
00190
00191 template <typename T, precision P>
00192 GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator* (
00193 tmat2x2<T, P> const & m,
00194 typename tmat2x2<T, P>::row_type const & v);
00195
00196 template <typename T, precision P>
00197 GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator* (
00198 typename tmat2x2<T, P>::col_type const & v,
00199 tmat2x2<T, P> const & m);
00200
00201 template <typename T, precision P>
00202 GLM_FUNC_DECL tmat2x2<T, P> operator* (
00203 tmat2x2<T, P> const & m1,
00204 tmat2x2<T, P> const & m2);
00205
00206 template <typename T, precision P>
00207 GLM_FUNC_DECL tmat3x2<T, P> operator* (
00208 tmat2x2<T, P> const & m1,
00209 tmat3x2<T, P> const & m2);
00210
00211 template <typename T, precision P>
00212 GLM_FUNC_DECL tmat4x2<T, P> operator* (
00213 tmat2x2<T, P> const & m1,
00214 tmat4x2<T, P> const & m2);
00215
00216 template <typename T, precision P>
00217 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
00218 tmat2x2<T, P> const & m,
00219 T const & s);
00220
00221 template <typename T, precision P>
00222 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
00223 T const & s,
00224 tmat2x2<T, P> const & m);
00225
00226 template <typename T, precision P>
00227 GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/ (
00228 tmat2x2<T, P> const & m,
00229 typename tmat2x2<T, P>::row_type const & v);
00230
00231 template <typename T, precision P>
00232 GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/ (
00233 typename tmat2x2<T, P>::col_type const & v,
00234 tmat2x2<T, P> const & m);
00235
00236 template <typename T, precision P>
00237 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
00238 tmat2x2<T, P> const & m1,
00239 tmat2x2<T, P> const & m2);
00240
00241
00242 template <typename T, precision P>
00243 GLM_FUNC_DECL tmat2x2<T, P> const operator-(
00244 tmat2x2<T, P> const & m);
00245 }
00246 }
00247
00248 #ifndef GLM_EXTERNAL_TEMPLATE
00249 #include "type_mat2x2.inl"
00250 #endif