0.9.9 API documenation: type_mat3x3.hpp Source File

| 0.9.9 API documenation

- Main Page
- Modules
- Files

- File List

type_mat3x3.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "../fwd.hpp"
7 #include "type_vec3.hpp"
8 #include "type_mat.hpp"
9 #include <limits>
10 #include <cstddef>
11
12 namespace glm
13 {
14 template<typename T, qualifier Q>
15 struct mat<3, 3, T, Q>
16 {
17 typedef vec<3, T, Q> col_type;
18 typedef vec<3, T, Q> row_type;
19 typedef mat<3, 3, T, Q> type;
20 typedef mat<3, 3, T, Q> transpose_type;
21 typedef T value_type;
22
23 private:
24 col_type value[3];
25
26 public:
27 // -- Accesses --
28
29 typedef length_t length_type;
30 GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
31
32 GLM_FUNC_DECL col_type & operator[](length_type i);
33 GLM_FUNC_DECL col_type const& operator[](length_type i) const;
34
35 // -- Constructors --
36
37 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
38 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
39 template<qualifier P>
40 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m);
41
42 GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar);
43 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(
44 T x0, T y0, T z0,
45 T x1, T y1, T z1,
46 T x2, T y2, T z2);
47 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(
48 col_type const& v0,
49 col_type const& v1,
50 col_type const& v2);
51
52 // -- Conversions --
53
54 template<
55 typename X1, typename Y1, typename Z1,
56 typename X2, typename Y2, typename Z2,
57 typename X3, typename Y3, typename Z3>
58 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(
59 X1 x1, Y1 y1, Z1 z1,
60 X2 x2, Y2 y2, Z2 z2,
61 X3 x3, Y3 y3, Z3 z3);
62
63 template<typename V1, typename V2, typename V3>
64 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(
65 vec<3, V1, Q> const& v1,
66 vec<3, V2, Q> const& v2,
67 vec<3, V3, Q> const& v3);
68
69 // -- Matrix conversions --
70
71 template<typename U, qualifier P>
72 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, U, P> const& m);
73
74 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x);
75 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x);
76 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x);
77 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x);
78 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x);
79 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x);
80 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x);
81 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x);
82
83 // -- Unary arithmetic operators --
84
85 GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
86
87 template<typename U>
88 GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m);
89 template<typename U>
90 GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s);
91 template<typename U>
92 GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m);
93 template<typename U>
94 GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s);
95 template<typename U>
96 GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m);
97 template<typename U>
98 GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s);
99 template<typename U>
100 GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m);
101 template<typename U>
102 GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s);
103 template<typename U>
104 GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m);
105
106 // -- Increment and decrement operators --
107
108 GLM_FUNC_DECL mat<3, 3, T, Q> & operator++();
109 GLM_FUNC_DECL mat<3, 3, T, Q> & operator--();
110 GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int);
111 GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int);
112 };
113
114 // -- Unary operators --
115
116 template<typename T, qualifier Q>
117 GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m);
118
119 template<typename T, qualifier Q>
120 GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m);
121
122 // -- Binary operators --
123
124 template<typename T, qualifier Q>
125 GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar);
126
127 template<typename T, qualifier Q>
128 GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m);
129
130 template<typename T, qualifier Q>
131 GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
132
133 template<typename T, qualifier Q>
134 GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar);
135
136 template<typename T, qualifier Q>
137 GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m);
138
139 template<typename T, qualifier Q>
140 GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
141
142 template<typename T, qualifier Q>
143 GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar);
144
145 template<typename T, qualifier Q>
146 GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m);
147
148 template<typename T, qualifier Q>
149 GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
150
151 template<typename T, qualifier Q>
152 GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m);
153
154 template<typename T, qualifier Q>
155 GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
156
157 template<typename T, qualifier Q>
158 GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
159
160 template<typename T, qualifier Q>
161 GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
162
163 template<typename T, qualifier Q>
164 GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar);
165
166 template<typename T, qualifier Q>
167 GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m);
168
169 template<typename T, qualifier Q>
170 GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
171
172 template<typename T, qualifier Q>
173 GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m);
174
175 template<typename T, qualifier Q>
176 GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
177
178 // -- Boolean operators --
179
180 template<typename T, qualifier Q>
181 GLM_FUNC_DECL bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
182
183 template<typename T, qualifier Q>
184 GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
185 }//namespace glm
186
187 #ifndef GLM_EXTERNAL_TEMPLATE
188 #include "type_mat3x3.inl"
189 #endif
type_vec3.hpp
Core features
glm
Definition: common.hpp:20
glm::length
GLM_FUNC_DECL T length(vec< L, T, Q > const &x)
Returns the length of x, i.e., sqrt(x * x).
type_mat.hpp
Core features