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