12 template<
typename T, qualifier Q>
13 struct mat<2, 2, T, Q>
15 typedef vec<2, T, Q> col_type;
16 typedef vec<2, T, Q> row_type;
17 typedef mat<2, 2, T, Q> type;
18 typedef mat<2, 2, T, Q> transpose_type;
27 typedef length_t length_type;
28 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length() {
return 2; }
30 GLM_FUNC_DECL col_type & operator[](length_type i);
31 GLM_FUNC_DECL GLM_CONSTEXPR col_type
const& operator[](length_type i)
const;
35 GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT;
37 GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m);
39 GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar);
40 GLM_FUNC_DECL GLM_CONSTEXPR mat(
41 T const& x1, T const& y1,
42 T const& x2, T const& y2);
43 GLM_FUNC_DECL GLM_CONSTEXPR mat(
49 template<typename U, typename V, typename M, typename N>
50 GLM_FUNC_DECL GLM_CONSTEXPR mat(
51 U const& x1, V const& y1,
52 M const& x2, N const& y2);
54 template<typename U, typename V>
55 GLM_FUNC_DECL GLM_CONSTEXPR mat(
56 vec<2, U, Q> const& v1,
57 vec<2, V, Q> const& v2);
61 template<typename U, qualifier P>
62 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m);
64 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x);
65 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x);
66 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x);
67 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x);
68 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x);
69 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x);
70 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x);
71 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x);
76 GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m);
78 GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s);
80 GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m);
82 GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s);
84 GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m);
86 GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s);
88 GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m);
90 GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s);
92 GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m);
96 GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ ();
97 GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- ();
98 GLM_FUNC_DECL mat<2, 2, T, Q> operator++(
int);
99 GLM_FUNC_DECL mat<2, 2, T, Q> operator--(
int);
104 template<typename T, qualifier Q>
105 GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m);
107 template<typename T, qualifier Q>
108 GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m);
112 template<typename T, qualifier Q>
113 GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar);
115 template<typename T, qualifier Q>
116 GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m);
118 template<typename T, qualifier Q>
119 GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
121 template<typename T, qualifier Q>
122 GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar);
124 template<typename T, qualifier Q>
125 GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m);
127 template<typename T, qualifier Q>
128 GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
130 template<typename T, qualifier Q>
131 GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar);
133 template<typename T, qualifier Q>
134 GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m);
136 template<typename T, qualifier Q>
137 GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
139 template<typename T, qualifier Q>
140 GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
142 template<typename T, qualifier Q>
143 GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
145 template<typename T, qualifier Q>
146 GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
148 template<typename T, qualifier Q>
149 GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
151 template<typename T, qualifier Q>
152 GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar);
154 template<typename T, qualifier Q>
155 GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m);
157 template<typename T, qualifier Q>
158 GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
160 template<typename T, qualifier Q>
161 GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
163 template<typename T, qualifier Q>
164 GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
168 template<typename T, qualifier Q>
169 GLM_FUNC_DECL
bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
171 template<typename T, qualifier Q>
172 GLM_FUNC_DECL
bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
175 #ifndef GLM_EXTERNAL_TEMPLATE 176 #include "type_mat2x2.inl"
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.