| 1.0.0 API documentation

type_mat2x3.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "type_vec2.hpp"
7 #include "type_vec3.hpp"
8 #include <limits>
9 #include <cstddef>
10
11 namespace glm
12 {
13 template<typename T, qualifier Q>
14 struct mat<2, 3, T, Q>
15 {
16 typedef vec<3, T, Q> col_type;
17 typedef vec<2, T, Q> row_type;
18 typedef mat<2, 3, T, Q> type;
19 typedef mat<3, 2, T, Q> transpose_type;
20 typedef T value_type;
21
22 private:
23 col_type value[2];
24
25 public:
26 // -- Accesses --
27
28 typedef length_t length_type;
29 GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
30
31 GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT;
32 GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT;
33
34 // -- Constructors --
35
36 GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR;
37 template<qualifier P>
38 GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 3, T, P> const& m);
39
40 GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar);
41 GLM_FUNC_DECL GLM_CONSTEXPR mat(
42 T x0, T y0, T z0,
43 T x1, T y1, T z1);
44 GLM_FUNC_DECL GLM_CONSTEXPR mat(
45 col_type const& v0,
46 col_type const& v1);
47
48 // -- Conversions --
49
50 template<typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
51 GLM_FUNC_DECL GLM_CONSTEXPR mat(
52 X1 x1, Y1 y1, Z1 z1,
53 X2 x2, Y2 y2, Z2 z2);
54
55 template<typename U, typename V>
56 GLM_FUNC_DECL GLM_CONSTEXPR mat(
57 vec<3, U, Q> const& v1,
58 vec<3, V, Q> const& v2);
59
60 // -- Matrix conversions --
61
62 template<typename U, qualifier P>
63 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, U, P> const& m);
64
65 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x);
66 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x);
67 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, 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<3, 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, 2, T, Q> const& x);
72 GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x);
73
74 // -- Unary arithmetic operators --
75
76 template<typename U>
77 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m);
78 template<typename U>
79 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(U s);
80 template<typename U>
81 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m);
82 template<typename U>
83 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(U s);
84 template<typename U>
85 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m);
86 template<typename U>
87 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator*=(U s);
88 template<typename U>
89 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator/=(U s);
90
91 // -- Increment and decrement operators --
92
93 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator++ ();
94 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-- ();
95 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator++(int);
96 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator--(int);
97 };
98
99 // -- Unary operators --
100
101 template<typename T, qualifier Q>
102 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m);
103
104 template<typename T, qualifier Q>
105 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m);
106
107 // -- Binary operators --
108
109 template<typename T, qualifier Q>
110 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar);
111
112 template<typename T, qualifier Q>
113 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
114
115 template<typename T, qualifier Q>
116 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar);
117
118 template<typename T, qualifier Q>
119 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
120
121 template<typename T, qualifier Q>
122 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar);
123
124 template<typename T, qualifier Q>
125 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m);
126
127 template<typename T, qualifier Q>
128 GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v);
129
130 template<typename T, qualifier Q>
131 GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m);
132
133 template<typename T, qualifier Q>
134 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
135
136 template<typename T, qualifier Q>
137 GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
138
139 template<typename T, qualifier Q>
140 GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
141
142 template<typename T, qualifier Q>
143 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar);
144
145 template<typename T, qualifier Q>
146 GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m);
147
148 // -- Boolean operators --
149
150 template<typename T, qualifier Q>
151 GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
152
153 template<typename T, qualifier Q>
154 GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
155 }//namespace glm
156
157 #ifndef GLM_EXTERNAL_TEMPLATE
158 #include "type_mat2x3.inl"
159 #endif
type_vec2.hpp
Core features
glm::length
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.
type_vec3.hpp
Core features