0.9.7: type_mat3x2.hpp Source File

| 0.9.7

- Main Page
- Modules
- Files

- File List

type_mat3x2.hpp
Go to the documentation of this file.
1
33 #pragma once
34
35 #include "../fwd.hpp"
36 #include "type_vec2.hpp"
37 #include "type_vec3.hpp"
38 #include "type_mat.hpp"
39 #include <limits>
40 #include <cstddef>
41
42 namespace glm
43 {
44 template <typename T, precision P = defaultp>
45 struct tmat3x2
46 {
47 typedef tvec2<T, P> col_type;
48 typedef tvec3<T, P> row_type;
49 typedef tmat3x2<T, P> type;
50 typedef tmat2x3<T, P> transpose_type;
51 typedef T value_type;
52
53 # ifdef GLM_META_PROG_HELPERS
54 static GLM_RELAXED_CONSTEXPR length_t components = 3;
55 static GLM_RELAXED_CONSTEXPR length_t cols = 3;
56 static GLM_RELAXED_CONSTEXPR length_t rows = 2;
57 static GLM_RELAXED_CONSTEXPR precision prec = P;
58 # endif//GLM_META_PROG_HELPERS
59
60 private:
61 col_type value[3];
62
63 public:
64 // -- Constructors --
65
66 GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR;
67 GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
68 template <precision Q>
69 GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
70
71 GLM_FUNC_DECL explicit tmat3x2(ctor);
72 GLM_FUNC_DECL explicit tmat3x2(T const & s);
73 GLM_FUNC_DECL tmat3x2(
74 T const & x0, T const & y0,
75 T const & x1, T const & y1,
76 T const & x2, T const & y2);
77 GLM_FUNC_DECL tmat3x2(
78 col_type const & v0,
79 col_type const & v1,
80 col_type const & v2);
81
82 // -- Conversions --
83
84 template<
85 typename X1, typename Y1,
86 typename X2, typename Y2,
87 typename X3, typename Y3>
88 GLM_FUNC_DECL tmat3x2(
89 X1 const & x1, Y1 const & y1,
90 X2 const & x2, Y2 const & y2,
91 X3 const & x3, Y3 const & y3);
92
93 template <typename V1, typename V2, typename V3>
94 GLM_FUNC_DECL tmat3x2(
95 tvec2<V1, P> const & v1,
96 tvec2<V2, P> const & v2,
97 tvec2<V3, P> const & v3);
98
99 // -- Matrix conversions --
100
101 template <typename U, precision Q>
102 GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2<U, Q> const & m);
103
104 GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
105 GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
106 GLM_FUNC_DECL explicit tmat3x2(tmat4x4<T, P> const & x);
107 GLM_FUNC_DECL explicit tmat3x2(tmat2x3<T, P> const & x);
108 GLM_FUNC_DECL explicit tmat3x2(tmat2x4<T, P> const & x);
109 GLM_FUNC_DECL explicit tmat3x2(tmat3x4<T, P> const & x);
110 GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
111 GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
112
113 // -- Accesses --
114
115 # ifdef GLM_FORCE_SIZE_FUNC
116 typedef size_t size_type;
117 GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
118
119 GLM_FUNC_DECL col_type & operator[](size_type i);
120 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
121 # else
122 typedef length_t length_type;
123 GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
124
125 GLM_FUNC_DECL col_type & operator[](length_type i);
126 GLM_FUNC_DECL col_type const & operator[](length_type i) const;
127 # endif//GLM_FORCE_SIZE_FUNC
128
129 // -- Unary arithmetic operators --
130
131 GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m) GLM_DEFAULT;
132
133 template <typename U>
134 GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);
135 template <typename U>
136 GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s);
137 template <typename U>
138 GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m);
139 template <typename U>
140 GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s);
141 template <typename U>
142 GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m);
143 template <typename U>
144 GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s);
145 template <typename U>
146 GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s);
147
148 // -- Increment and decrement operators --
149
150 GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
151 GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
152 GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
153 GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
154 };
155
156 // -- Unary operators --
157
158 template <typename T, precision P>
159 GLM_FUNC_DECL tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m);
160
161 // -- Binary operators --
162
163 template <typename T, precision P>
164 GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s);
165
166 template <typename T, precision P>
167 GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
168
169 template <typename T, precision P>
170 GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s);
171
172 template <typename T, precision P>
173 GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
174
175 template <typename T, precision P>
176 GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s);
177
178 template <typename T, precision P>
179 GLM_FUNC_DECL tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m);
180
181 template <typename T, precision P>
182 GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v);
183
184 template <typename T, precision P>
185 GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m);
186
187 template <typename T, precision P>
188 GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2);
189
190 template <typename T, precision P>
191 GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2);
192
193 template <typename T, precision P>
194 GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2);
195
196 template <typename T, precision P>
197 GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s);
198
199 template <typename T, precision P>
200 GLM_FUNC_DECL tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m);
201
202 // -- Boolean operators --
203
204 template <typename T, precision P>
205 GLM_FUNC_DECL bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
206
207 template <typename T, precision P>
208 GLM_FUNC_DECL bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
209 }//namespace glm
210
211 #ifndef GLM_EXTERNAL_TEMPLATE
212 #include "type_mat3x2.inl"
213 #endif
type_vec3.hpp
OpenGL Mathematics (glm.g-truc.net)
glm::length
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
glm
Definition: _noise.hpp:40
type_vec2.hpp
OpenGL Mathematics (glm.g-truc.net)
type_mat.hpp
OpenGL Mathematics (glm.g-truc.net)