14 template<
typename T, qualifier P>
15 struct mat<2, 2, T, P>
17 typedef vec<2, T, P> col_type;
18 typedef vec<2, T, P> row_type;
19 typedef mat<2, 2, T, P> type;
20 typedef mat<2, 2, T, P> transpose_type;
29 typedef length_t length_type;
30 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length() {
return 2; }
32 GLM_FUNC_DECL col_type & operator[](length_type i);
33 GLM_FUNC_DECL col_type
const & operator[](length_type i)
const;
37 GLM_FUNC_DECL mat() GLM_DEFAULT;
38 GLM_FUNC_DECL mat(mat<2, 2, T, P> const & m) GLM_DEFAULT;
40 GLM_FUNC_DECL mat(mat<2, 2, T, Q> const & m);
42 GLM_FUNC_DECL explicit mat(T scalar);
44 T const & x1, T const & y1,
45 T const & x2, T const & y2);
52 template<typename U, typename V, typename M, typename N>
54 U const & x1, V const & y1,
55 M const & x2, N const & y2);
57 template<typename U, typename V>
59 vec<2, U, P> const & v1,
60 vec<2, V, P> const & v2);
64 template<typename U, qualifier Q>
65 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const & m);
67 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
68 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
69 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
70 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
71 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
72 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
73 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
74 GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
78 GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT;
81 GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const & m);
83 GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s);
85 GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const & m);
87 GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s);
89 GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const & m);
91 GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s);
93 GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const & m);
95 GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s);
97 GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const & m);
101 GLM_FUNC_DECL mat<2, 2, T, P> & operator++ ();
102 GLM_FUNC_DECL mat<2, 2, T, P> & operator-- ();
103 GLM_FUNC_DECL mat<2, 2, T, P> operator++(
int);
104 GLM_FUNC_DECL mat<2, 2, T, P> operator--(
int);
109 template<typename T, qualifier P>
110 GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m);
112 template<typename T, qualifier P>
113 GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m);
117 template<typename T, qualifier P>
118 GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar);
120 template<typename T, qualifier P>
121 GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m);
123 template<typename T, qualifier P>
124 GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
126 template<typename T, qualifier P>
127 GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar);
129 template<typename T, qualifier P>
130 GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m);
132 template<typename T, qualifier P>
133 GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
135 template<typename T, qualifier P>
136 GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar);
138 template<typename T, qualifier P>
139 GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m);
141 template<typename T, qualifier P>
142 GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
144 template<typename T, qualifier P>
145 GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
147 template<typename T, qualifier P>
148 GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
150 template<typename T, qualifier P>
151 GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
153 template<typename T, qualifier P>
154 GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
156 template<typename T, qualifier P>
157 GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar);
159 template<typename T, qualifier P>
160 GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m);
162 template<typename T, qualifier P>
163 GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
165 template<typename T, qualifier P>
166 GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
168 template<typename T, qualifier P>
169 GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
173 template<typename T, qualifier P>
174 GLM_FUNC_DECL
bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
176 template<typename T, qualifier P>
177 GLM_FUNC_DECL
bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
180 #ifndef GLM_EXTERNAL_TEMPLATE
181 #include "type_mat2x2.inl"
GLM_FUNC_DECL T length(vec< L, T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).