diff --git a/doc/api/a00002.html b/doc/api/a00002.html index 2edc50849..37fcdc9eb 100644 --- a/doc/api/a00002.html +++ b/doc/api/a00002.html @@ -5,7 +5,7 @@ -1.0.0 API documentation: common.hpp File Reference +1.0.2 API documentation: common.hpp File Reference @@ -22,7 +22,7 @@ Logo -
1.0.0 API documentation +
1.0.2 API documentation
@@ -73,7 +73,7 @@ $(function() {
-

Core features +

Core features More...

Go to the source code of this file.

@@ -81,160 +81,160 @@ $(function() {

Functions

template<typename genType > -GLM_FUNC_DECL GLM_CONSTEXPR genType abs (genType x) - Returns x if x >= 0; otherwise, it returns -x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR genType abs (genType x) + Returns x if x >= 0; otherwise, it returns -x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > abs (vec< L, T, Q > const &x) - Returns x if x >= 0; otherwise, it returns -x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > abs (vec< L, T, Q > const &x) + Returns x if x >= 0; otherwise, it returns -x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > ceil (vec< L, T, Q > const &x) - Returns a value equal to the nearest integer that is greater than or equal to x. More...
+GLM_FUNC_DECL vec< L, T, Q > ceil (vec< L, T, Q > const &x) + Returns a value equal to the nearest integer that is greater than or equal to x. More...
  template<typename genType > -GLM_FUNC_DECL GLM_CONSTEXPR genType clamp (genType x, genType minVal, genType maxVal) - Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
+GLM_FUNC_DECL GLM_CONSTEXPR genType clamp (genType x, genType minVal, genType maxVal) + Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp (vec< L, T, Q > const &x, T minVal, T maxVal) - Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp (vec< L, T, Q > const &x, T minVal, T maxVal) + Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp (vec< L, T, Q > const &x, vec< L, T, Q > const &minVal, vec< L, T, Q > const &maxVal) - Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp (vec< L, T, Q > const &x, vec< L, T, Q > const &minVal, vec< L, T, Q > const &maxVal) + Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. More...
  -GLM_FUNC_DECL int floatBitsToInt (float v) - Returns a signed integer value representing the encoding of a floating-point value. More...
+GLM_FUNC_DECL int floatBitsToInt (float v) + Returns a signed integer value representing the encoding of a floating-point value. More...
  template<length_t L, qualifier Q> -GLM_FUNC_DECL vec< L, int, Q > floatBitsToInt (vec< L, float, Q > const &v) - Returns a signed integer value representing the encoding of a floating-point value. More...
+GLM_FUNC_DECL vec< L, int, Q > floatBitsToInt (vec< L, float, Q > const &v) + Returns a signed integer value representing the encoding of a floating-point value. More...
  -GLM_FUNC_DECL uint floatBitsToUint (float v) - Returns a unsigned integer value representing the encoding of a floating-point value. More...
+GLM_FUNC_DECL uint floatBitsToUint (float v) + Returns a unsigned integer value representing the encoding of a floating-point value. More...
  template<length_t L, qualifier Q> -GLM_FUNC_DECL vec< L, uint, Q > floatBitsToUint (vec< L, float, Q > const &v) - Returns a unsigned integer value representing the encoding of a floating-point value. More...
+GLM_FUNC_DECL vec< L, uint, Q > floatBitsToUint (vec< L, float, Q > const &v) + Returns a unsigned integer value representing the encoding of a floating-point value. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > floor (vec< L, T, Q > const &x) - Returns a value equal to the nearest integer that is less then or equal to x. More...
+GLM_FUNC_DECL vec< L, T, Q > floor (vec< L, T, Q > const &x) + Returns a value equal to the nearest integer that is less then or equal to x. More...
  template<typename genType > -GLM_FUNC_DECL genType fma (genType const &a, genType const &b, genType const &c) - Computes and returns a * b + c. More...
+GLM_FUNC_DECL genType fma (genType const &a, genType const &b, genType const &c) + Computes and returns a * b + c. More...
  template<typename genType > -GLM_FUNC_DECL genType fract (genType x) - Return x - floor(x). More...
+GLM_FUNC_DECL genType fract (genType x) + Return x - floor(x). More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > fract (vec< L, T, Q > const &x) - Return x - floor(x). More...
+GLM_FUNC_DECL vec< L, T, Q > fract (vec< L, T, Q > const &x) + Return x - floor(x). More...
  template<typename genType > -GLM_FUNC_DECL genType frexp (genType x, int &exp) - Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two, such that: x = significand * exp(2, exponent) More...
+GLM_FUNC_DECL genType frexp (genType x, int &exp) + Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two, such that: x = significand * exp(2, exponent) More...
  -GLM_FUNC_DECL float intBitsToFloat (int v) - Returns a floating-point value corresponding to a signed integer encoding of a floating-point value. More...
+GLM_FUNC_DECL float intBitsToFloat (int v) + Returns a floating-point value corresponding to a signed integer encoding of a floating-point value. More...
  template<length_t L, qualifier Q> -GLM_FUNC_DECL vec< L, float, Q > intBitsToFloat (vec< L, int, Q > const &v) - Returns a floating-point value corresponding to a signed integer encoding of a floating-point value. More...
+GLM_FUNC_DECL vec< L, float, Q > intBitsToFloat (vec< L, int, Q > const &v) + Returns a floating-point value corresponding to a signed integer encoding of a floating-point value. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, bool, Q > isinf (vec< L, T, Q > const &x) - Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. More...
+GLM_FUNC_DECL vec< L, bool, Q > isinf (vec< L, T, Q > const &x) + Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, bool, Q > isnan (vec< L, T, Q > const &x) - Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. More...
+GLM_FUNC_DECL vec< L, bool, Q > isnan (vec< L, T, Q > const &x) + Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. More...
  template<typename genType > -GLM_FUNC_DECL genType ldexp (genType const &x, int const &exp) - Builds a floating-point number from x and the corresponding integral exponent of two in exp, returning: significand * exp(2, exponent) More...
+GLM_FUNC_DECL genType ldexp (genType const &x, int const &exp) + Builds a floating-point number from x and the corresponding integral exponent of two in exp, returning: significand * exp(2, exponent) More...
  template<typename genType > -GLM_FUNC_DECL GLM_CONSTEXPR genType max (genType x, genType y) - Returns y if x < y; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR genType max (genType x, genType y) + Returns y if x < y; otherwise, it returns x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, T y) - Returns y if x < y; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, T y) + Returns y if x < y; otherwise, it returns x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, vec< L, T, Q > const &y) - Returns y if x < y; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, vec< L, T, Q > const &y) + Returns y if x < y; otherwise, it returns x. More...
  template<typename genType > -GLM_FUNC_DECL GLM_CONSTEXPR genType min (genType x, genType y) - Returns y if y < x; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR genType min (genType x, genType y) + Returns y if y < x; otherwise, it returns x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &x, T y) - Returns y if y < x; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &x, T y) + Returns y if y < x; otherwise, it returns x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &x, vec< L, T, Q > const &y) - Returns y if y < x; otherwise, it returns x. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &x, vec< L, T, Q > const &y) + Returns y if y < x; otherwise, it returns x. More...
  template<typename genTypeT , typename genTypeU > -GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix (genTypeT x, genTypeT y, genTypeU a) - If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. More...
+GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix (genTypeT x, genTypeT y, genTypeU a) + If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > mod (vec< L, T, Q > const &x, vec< L, T, Q > const &y) - Modulus. More...
+GLM_FUNC_DECL vec< L, T, Q > mod (vec< L, T, Q > const &x, vec< L, T, Q > const &y) + Modulus. More...
  template<typename genType > -GLM_FUNC_DECL genType modf (genType x, genType &i) - Returns the fractional part of x and sets i to the integer part (as a whole number floating point value). More...
+GLM_FUNC_DECL genType modf (genType x, genType &i) + Returns the fractional part of x and sets i to the integer part (as a whole number floating point value). More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > round (vec< L, T, Q > const &x) - Returns a value equal to the nearest integer to x. More...
+GLM_FUNC_DECL vec< L, T, Q > round (vec< L, T, Q > const &x) + Returns a value equal to the nearest integer to x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > roundEven (vec< L, T, Q > const &x) - Returns a value equal to the nearest integer to x. More...
+GLM_FUNC_DECL vec< L, T, Q > roundEven (vec< L, T, Q > const &x) + Returns a value equal to the nearest integer to x. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > sign (vec< L, T, Q > const &x) - Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. More...
+GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > sign (vec< L, T, Q > const &x) + Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. More...
  template<typename genType > -GLM_FUNC_DECL genType smoothstep (genType edge0, genType edge1, genType x) - Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. More...
+GLM_FUNC_DECL genType smoothstep (genType edge0, genType edge1, genType x) + Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. More...
  template<typename genType > -GLM_FUNC_DECL genType step (genType edge, genType x) - Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. More...
+GLM_FUNC_DECL genType step (genType edge, genType x) + Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > step (T edge, vec< L, T, Q > const &x) - Returns 0.0 if x < edge, otherwise it returns 1.0. More...
+GLM_FUNC_DECL vec< L, T, Q > step (T edge, vec< L, T, Q > const &x) + Returns 0.0 if x < edge, otherwise it returns 1.0. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > step (vec< L, T, Q > const &edge, vec< L, T, Q > const &x) - Returns 0.0 if x < edge, otherwise it returns 1.0. More...
+GLM_FUNC_DECL vec< L, T, Q > step (vec< L, T, Q > const &edge, vec< L, T, Q > const &x) + Returns 0.0 if x < edge, otherwise it returns 1.0. More...
  template<length_t L, typename T , qualifier Q> -GLM_FUNC_DECL vec< L, T, Q > trunc (vec< L, T, Q > const &x) - Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x. More...
+GLM_FUNC_DECL vec< L, T, Q > trunc (vec< L, T, Q > const &x) + Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x. More...
  -GLM_FUNC_DECL float uintBitsToFloat (uint v) - Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value. More...
+GLM_FUNC_DECL float uintBitsToFloat (uint v) + Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value. More...
  template<length_t L, qualifier Q> -GLM_FUNC_DECL vec< L, float, Q > uintBitsToFloat (vec< L, uint, Q > const &v) - Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value. More...
+GLM_FUNC_DECL vec< L, float, Q > uintBitsToFloat (vec< L, uint, Q > const &v) + Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value. More...
 

Detailed Description

-

Core features

+

Core features

See also
GLSL 4.20.8 specification, section 8.3 Common Functions

Definition in file common.hpp.

diff --git a/doc/api/a00002_source.html b/doc/api/a00002_source.html index 273e287a7..aac0ef854 100644 --- a/doc/api/a00002_source.html +++ b/doc/api/a00002_source.html @@ -5,7 +5,7 @@ -1.0.0 API documentation: common.hpp Source File +1.0.2 API documentation: common.hpp Source File @@ -22,7 +22,7 @@ Logo -
1.0.0 API documentation +
1.0.2 API documentation
@@ -80,173 +80,173 @@ $(function() {
21 {
24 
31  template<typename genType>
-
32  GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x);
+
32  GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x);
33 
42  template<length_t L, typename T, qualifier Q>
-
43  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> abs(vec<L, T, Q> const& x);
+
43  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> abs(vec<L, T, Q> const& x);
44 
53  template<length_t L, typename T, qualifier Q>
-
54  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);
+
54  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);
55 
64  template<length_t L, typename T, qualifier Q>
-
65  GLM_FUNC_DECL vec<L, T, Q> floor(vec<L, T, Q> const& x);
+
65  GLM_FUNC_DECL vec<L, T, Q> floor(vec<L, T, Q> const& x);
66 
76  template<length_t L, typename T, qualifier Q>
-
77  GLM_FUNC_DECL vec<L, T, Q> trunc(vec<L, T, Q> const& x);
+
77  GLM_FUNC_DECL vec<L, T, Q> trunc(vec<L, T, Q> const& x);
78 
91  template<length_t L, typename T, qualifier Q>
-
92  GLM_FUNC_DECL vec<L, T, Q> round(vec<L, T, Q> const& x);
+
92  GLM_FUNC_DECL vec<L, T, Q> round(vec<L, T, Q> const& x);
93 
105  template<length_t L, typename T, qualifier Q>
-
106  GLM_FUNC_DECL vec<L, T, Q> roundEven(vec<L, T, Q> const& x);
+
106  GLM_FUNC_DECL vec<L, T, Q> roundEven(vec<L, T, Q> const& x);
107 
117  template<length_t L, typename T, qualifier Q>
-
118  GLM_FUNC_DECL vec<L, T, Q> ceil(vec<L, T, Q> const& x);
+
118  GLM_FUNC_DECL vec<L, T, Q> ceil(vec<L, T, Q> const& x);
119 
126  template<typename genType>
-
127  GLM_FUNC_DECL genType fract(genType x);
+
127  GLM_FUNC_DECL genType fract(genType x);
128 
137  template<length_t L, typename T, qualifier Q>
-
138  GLM_FUNC_DECL vec<L, T, Q> fract(vec<L, T, Q> const& x);
+
138  GLM_FUNC_DECL vec<L, T, Q> fract(vec<L, T, Q> const& x);
139 
140  template<typename genType>
-
141  GLM_FUNC_DECL genType mod(genType x, genType y);
+
141  GLM_FUNC_DECL genType mod(genType x, genType y);
142 
143  template<length_t L, typename T, qualifier Q>
-
144  GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);
+
144  GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);
145 
155  template<length_t L, typename T, qualifier Q>
-
156  GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
+
156  GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
157 
167  template<typename genType>
-
168  GLM_FUNC_DECL genType modf(genType x, genType& i);
+
168  GLM_FUNC_DECL genType modf(genType x, genType& i);
169 
176  template<typename genType>
-
177  GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y);
+
177  GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y);
178 
187  template<length_t L, typename T, qualifier Q>
-
188  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, T y);
+
188  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, T y);
189 
198  template<length_t L, typename T, qualifier Q>
-
199  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
+
199  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
200 
207  template<typename genType>
-
208  GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y);
+
208  GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y);
209 
218  template<length_t L, typename T, qualifier Q>
-
219  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, T y);
+
219  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, T y);
220 
229  template<length_t L, typename T, qualifier Q>
-
230  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
+
230  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
231 
239  template<typename genType>
-
240  GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal);
+
240  GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal);
241 
251  template<length_t L, typename T, qualifier Q>
-
252  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal);
+
252  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal);
253 
263  template<length_t L, typename T, qualifier Q>
-
264  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal);
+
264  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal);
265 
308  template<typename genTypeT, typename genTypeU>
-
309  GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
+
309  GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
310 
311  template<length_t L, typename T, typename U, qualifier Q>
-
312  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
+
312  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
313 
314  template<length_t L, typename T, typename U, qualifier Q>
-
315  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
+
315  GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
316 
321  template<typename genType>
-
322  GLM_FUNC_DECL genType step(genType edge, genType x);
+
322  GLM_FUNC_DECL genType step(genType edge, genType x);
323 
332  template<length_t L, typename T, qualifier Q>
-
333  GLM_FUNC_DECL vec<L, T, Q> step(T edge, vec<L, T, Q> const& x);
+
333  GLM_FUNC_DECL vec<L, T, Q> step(T edge, vec<L, T, Q> const& x);
334 
343  template<length_t L, typename T, qualifier Q>
-
344  GLM_FUNC_DECL vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x);
+
344  GLM_FUNC_DECL vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x);
345 
360  template<typename genType>
-
361  GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
+
361  GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
362 
363  template<length_t L, typename T, qualifier Q>
-
364  GLM_FUNC_DECL vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x);
+
364  GLM_FUNC_DECL vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x);
365 
366  template<length_t L, typename T, qualifier Q>
-
367  GLM_FUNC_DECL vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x);
+
367  GLM_FUNC_DECL vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x);
368 
383  template<length_t L, typename T, qualifier Q>
-
384  GLM_FUNC_DECL vec<L, bool, Q> isnan(vec<L, T, Q> const& x);
+
384  GLM_FUNC_DECL vec<L, bool, Q> isnan(vec<L, T, Q> const& x);
385 
398  template<length_t L, typename T, qualifier Q>
-
399  GLM_FUNC_DECL vec<L, bool, Q> isinf(vec<L, T, Q> const& x);
+
399  GLM_FUNC_DECL vec<L, bool, Q> isinf(vec<L, T, Q> const& x);
400 
-
407  GLM_FUNC_DECL int floatBitsToInt(float v);
+
407  GLM_FUNC_DECL int floatBitsToInt(float v);
408 
418  template<length_t L, qualifier Q>
-
419  GLM_FUNC_DECL vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v);
+
419  GLM_FUNC_DECL vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v);
420 
-
427  GLM_FUNC_DECL uint floatBitsToUint(float v);
+
427  GLM_FUNC_DECL uint floatBitsToUint(float v);
428 
438  template<length_t L, qualifier Q>
-
439  GLM_FUNC_DECL vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v);
+
439  GLM_FUNC_DECL vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v);
440 
-
449  GLM_FUNC_DECL float intBitsToFloat(int v);
+
449  GLM_FUNC_DECL float intBitsToFloat(int v);
450 
462  template<length_t L, qualifier Q>
-
463  GLM_FUNC_DECL vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v);
+
463  GLM_FUNC_DECL vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v);
464 
-
473  GLM_FUNC_DECL float uintBitsToFloat(uint v);
+
473  GLM_FUNC_DECL float uintBitsToFloat(uint v);
474 
486  template<length_t L, qualifier Q>
-
487  GLM_FUNC_DECL vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v);
+
487  GLM_FUNC_DECL vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v);
488 
495  template<typename genType>
-
496  GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c);
+
496  GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c);
497 
512  template<typename genType>
-
513  GLM_FUNC_DECL genType frexp(genType x, int& exp);
+
513  GLM_FUNC_DECL genType frexp(genType x, int& exp);
514 
515  template<length_t L, typename T, qualifier Q>
-
516  GLM_FUNC_DECL vec<L, T, Q> frexp(vec<L, T, Q> const& v, vec<L, int, Q>& exp);
+
516  GLM_FUNC_DECL vec<L, T, Q> frexp(vec<L, T, Q> const& v, vec<L, int, Q>& exp);
517 
529  template<typename genType>
-
530  GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp);
+
530  GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp);
531 
532  template<length_t L, typename T, qualifier Q>
-
533  GLM_FUNC_DECL vec<L, T, Q> ldexp(vec<L, T, Q> const& v, vec<L, int, Q> const& exp);
+
533  GLM_FUNC_DECL vec<L, T, Q> ldexp(vec<L, T, Q> const& v, vec<L, int, Q> const& exp);
534 
536 }//namespace glm
537 
538 #include "detail/func_common.inl"
539 
-
GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a)
If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of ...
-
GLM_FUNC_DECL vec< L, bool, Q > isnan(vec< L, T, Q > const &x)
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of...
-
GLM_FUNC_DECL vec< L, int, Q > floatBitsToInt(vec< L, float, Q > const &v)
Returns a signed integer value representing the encoding of a floating-point value.
-
GLM_FUNC_DECL genType frexp(genType x, int &exp)
Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two,...
-
GLM_FUNC_DECL vec< L, T, Q > ceil(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer that is greater than or equal to x.
-
GLM_FUNC_DECL vec< L, T, Q > mod(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Modulus.
-
GLM_FUNC_DECL genType modf(genType x, genType &i)
Returns the fractional part of x and sets i to the integer part (as a whole number floating point val...
-
GLM_FUNC_DECL vec< L, T, Q > step(vec< L, T, Q > const &edge, vec< L, T, Q > const &x)
Returns 0.0 if x < edge, otherwise it returns 1.0.
-
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > abs(vec< L, T, Q > const &x)
Returns x if x >= 0; otherwise, it returns -x.
-
GLM_FUNC_DECL genType ldexp(genType const &x, int const &exp)
Builds a floating-point number from x and the corresponding integral exponent of two in exp,...
-
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp(vec< L, T, Q > const &x, vec< L, T, Q > const &minVal, vec< L, T, Q > const &maxVal)
Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal an...
-
GLM_FUNC_DECL vec< L, float, Q > uintBitsToFloat(vec< L, uint, Q > const &v)
Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value...
-
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Returns y if x < y; otherwise, it returns x.
-
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Returns y if y < x; otherwise, it returns x.
-
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > sign(vec< L, T, Q > const &x)
Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
-
GLM_FUNC_DECL vec< L, bool, Q > isinf(vec< L, T, Q > const &x)
Returns true if x holds a positive infinity or negative infinity representation in the underlying imp...
-
GLM_FUNC_DECL vec< L, uint, Q > floatBitsToUint(vec< L, float, Q > const &v)
Returns a unsigned integer value representing the encoding of a floating-point value.
-
GLM_FUNC_DECL vec< L, T, Q > fract(vec< L, T, Q > const &x)
Return x - floor(x).
-
GLM_FUNC_DECL vec< L, float, Q > intBitsToFloat(vec< L, int, Q > const &v)
Returns a floating-point value corresponding to a signed integer encoding of a floating-point value.
-
GLM_FUNC_DECL vec< L, T, Q > roundEven(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x.
-
GLM_FUNC_DECL vec< L, T, Q > floor(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer that is less then or equal to x.
-
GLM_FUNC_DECL genType fma(genType const &a, genType const &b, genType const &c)
Computes and returns a * b + c.
-
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x)
Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 a...
-
GLM_FUNC_DECL vec< L, T, Q > round(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x.
-
GLM_FUNC_DECL vec< L, T, Q > exp(vec< L, T, Q > const &v)
Returns the natural exponentiation of v, i.e., e^v.
-
GLM_FUNC_DECL vec< L, T, Q > trunc(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolut...
+
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x)
Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 a...
+
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > abs(vec< L, T, Q > const &x)
Returns x if x >= 0; otherwise, it returns -x.
+
GLM_FUNC_DECL genType ldexp(genType const &x, int const &exp)
Builds a floating-point number from x and the corresponding integral exponent of two in exp,...
+
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > clamp(vec< L, T, Q > const &x, vec< L, T, Q > const &minVal, vec< L, T, Q > const &maxVal)
Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal an...
+
GLM_FUNC_DECL vec< L, T, Q > step(vec< L, T, Q > const &edge, vec< L, T, Q > const &x)
Returns 0.0 if x < edge, otherwise it returns 1.0.
+
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Returns y if y < x; otherwise, it returns x.
+
GLM_FUNC_DECL genType frexp(genType x, int &exp)
Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two,...
+
GLM_FUNC_DECL vec< L, T, Q > ceil(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer that is greater than or equal to x.
+
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > sign(vec< L, T, Q > const &x)
Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
+
GLM_FUNC_DECL vec< L, T, Q > round(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x.
+
GLM_FUNC_DECL vec< L, uint, Q > floatBitsToUint(vec< L, float, Q > const &v)
Returns a unsigned integer value representing the encoding of a floating-point value.
+
GLM_FUNC_DECL vec< L, T, Q > roundEven(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x.
+
GLM_FUNC_DECL vec< L, bool, Q > isinf(vec< L, T, Q > const &x)
Returns true if x holds a positive infinity or negative infinity representation in the underlying imp...
+
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Returns y if x < y; otherwise, it returns x.
+
GLM_FUNC_DECL vec< L, T, Q > exp(vec< L, T, Q > const &v)
Returns the natural exponentiation of v, i.e., e^v.
+
GLM_FUNC_DECL genType modf(genType x, genType &i)
Returns the fractional part of x and sets i to the integer part (as a whole number floating point val...
+
GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a)
If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of ...
+
GLM_FUNC_DECL vec< L, T, Q > floor(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer that is less then or equal to x.
+
GLM_FUNC_DECL vec< L, bool, Q > isnan(vec< L, T, Q > const &x)
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of...
+
GLM_FUNC_DECL vec< L, T, Q > fract(vec< L, T, Q > const &x)
Return x - floor(x).
+
GLM_FUNC_DECL vec< L, int, Q > floatBitsToInt(vec< L, float, Q > const &v)
Returns a signed integer value representing the encoding of a floating-point value.
+
GLM_FUNC_DECL genType fma(genType const &a, genType const &b, genType const &c)
Computes and returns a * b + c.
+
GLM_FUNC_DECL vec< L, float, Q > uintBitsToFloat(vec< L, uint, Q > const &v)
Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value...
+
GLM_FUNC_DECL vec< L, float, Q > intBitsToFloat(vec< L, int, Q > const &v)
Returns a floating-point value corresponding to a signed integer encoding of a floating-point value.
+
GLM_FUNC_DECL vec< L, T, Q > mod(vec< L, T, Q > const &x, vec< L, T, Q > const &y)
Modulus.
+
GLM_FUNC_DECL vec< L, T, Q > trunc(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolut...
-
1 #ifndef GLM_SETUP_INCLUDED
+
1 #pragma once
2 
-
3 #include <cassert>
-
4 #include <cstddef>
-
5 
-
6 #define GLM_VERSION_MAJOR 1
-
7 #define GLM_VERSION_MINOR 0
-
8 #define GLM_VERSION_PATCH 0
-
9 #define GLM_VERSION_REVISION 0 // Deprecated
-
10 #define GLM_VERSION 1000 // Deprecated
-
11 #define GLM_VERSION_MESSAGE "GLM: version 1.0.0"
-
12 
-
13 #define GLM_MAKE_API_VERSION(variant, major, minor, patch) \
-
14  ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
-
15 
-
16 #define GLM_VERSION_COMPLETE GLM_MAKE_API_VERSION(0, GLM_VERSION_MAJOR, GLM_VERSION_MINOR, GLM_VERSION_PATCH)
-
17 
-
18 #define GLM_SETUP_INCLUDED GLM_VERSION
-
19 
-
20 #define GLM_GET_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U)
-
21 #define GLM_GET_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU)
-
22 #define GLM_GET_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU)
-
23 #define GLM_GET_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
-
24 
-
26 // Active states
-
27 
-
28 #define GLM_DISABLE 0
-
29 #define GLM_ENABLE 1
-
30 
-
32 // Messages
-
33 
-
34 #if defined(GLM_FORCE_MESSAGES)
-
35 # define GLM_MESSAGES GLM_ENABLE
-
36 #else
-
37 # define GLM_MESSAGES GLM_DISABLE
-
38 #endif
-
39 
-
41 // Detect the platform
-
42 
-
43 #include "../simd/platform.h"
-
44 
-
46 // Build model
-
47 
-
48 #if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__)
-
49 # define GLM_MODEL GLM_MODEL_64
-
50 #elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM)
-
51 # define GLM_MODEL GLM_MODEL_32
-
52 #else
-
53 # define GLM_MODEL GLM_MODEL_32
-
54 #endif//
+
3 #include "setup.hpp"
+
4 
+
5 namespace glm
+
6 {
+
8  enum qualifier
+
9  {
+
10  packed_highp,
+
11  packed_mediump,
+
12  packed_lowp,
+
13 
+
14 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+
15  aligned_highp,
+
16  aligned_mediump,
+
17  aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance
+
18  aligned = aligned_highp,
+
19 # endif
+
20 
+
21  highp = packed_highp,
+
22  mediump = packed_mediump,
+
23  lowp = packed_lowp,
+
24  packed = packed_highp,
+
25 
+
26 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
+
27  defaultp = aligned_highp
+
28 # else
+
29  defaultp = highp
+
30 # endif
+
31  };
+
32 
+
33  typedef qualifier precision;
+
34 
+
35  template<length_t L, typename T, qualifier Q = defaultp> struct vec;
+
36  template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat;
+
37  template<typename T, qualifier Q = defaultp> struct qua;
+
38 
+
39 # if GLM_HAS_TEMPLATE_ALIASES
+
40  template <typename T, qualifier Q = defaultp> using tvec1 = vec<1, T, Q>;
+
41  template <typename T, qualifier Q = defaultp> using tvec2 = vec<2, T, Q>;
+
42  template <typename T, qualifier Q = defaultp> using tvec3 = vec<3, T, Q>;
+
43  template <typename T, qualifier Q = defaultp> using tvec4 = vec<4, T, Q>;
+
44  template <typename T, qualifier Q = defaultp> using tmat2x2 = mat<2, 2, T, Q>;
+
45  template <typename T, qualifier Q = defaultp> using tmat2x3 = mat<2, 3, T, Q>;
+
46  template <typename T, qualifier Q = defaultp> using tmat2x4 = mat<2, 4, T, Q>;
+
47  template <typename T, qualifier Q = defaultp> using tmat3x2 = mat<3, 2, T, Q>;
+
48  template <typename T, qualifier Q = defaultp> using tmat3x3 = mat<3, 3, T, Q>;
+
49  template <typename T, qualifier Q = defaultp> using tmat3x4 = mat<3, 4, T, Q>;
+
50  template <typename T, qualifier Q = defaultp> using tmat4x2 = mat<4, 2, T, Q>;
+
51  template <typename T, qualifier Q = defaultp> using tmat4x3 = mat<4, 3, T, Q>;
+
52  template <typename T, qualifier Q = defaultp> using tmat4x4 = mat<4, 4, T, Q>;
+
53  template <typename T, qualifier Q = defaultp> using tquat = qua<T, Q>;
+
54 # endif
55 
-
56 #if !defined(GLM_MODEL) && GLM_COMPILER != 0
-
57 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
-
58 #endif//GLM_MODEL
-
59 
-
61 // C++ Version
-
62 
-
63 // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A
-
64 
-
65 #define GLM_LANG_CXX98_FLAG (1 << 1)
-
66 #define GLM_LANG_CXX03_FLAG (1 << 2)
-
67 #define GLM_LANG_CXX0X_FLAG (1 << 3)
-
68 #define GLM_LANG_CXX11_FLAG (1 << 4)
-
69 #define GLM_LANG_CXX14_FLAG (1 << 5)
-
70 #define GLM_LANG_CXX17_FLAG (1 << 6)
-
71 #define GLM_LANG_CXX20_FLAG (1 << 7)
-
72 #define GLM_LANG_CXXMS_FLAG (1 << 8)
-
73 #define GLM_LANG_CXXGNU_FLAG (1 << 9)
-
74 
-
75 #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG
-
76 #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG)
-
77 #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG)
-
78 #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG)
-
79 #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG)
-
80 #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG)
-
81 #define GLM_LANG_CXX20 (GLM_LANG_CXX17 | GLM_LANG_CXX20_FLAG)
-
82 #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
-
83 #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
-
84 
-
85 #if (defined(_MSC_EXTENSIONS))
-
86 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
-
87 #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT))
-
88 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
-
89 #else
-
90 # define GLM_LANG_EXT 0
-
91 #endif
-
92 
-
93 #if (defined(GLM_FORCE_CXX_UNKNOWN))
-
94 # define GLM_LANG 0
-
95 #elif defined(GLM_FORCE_CXX20)
-
96 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
-
97 # define GLM_LANG_STL11_FORCED
-
98 #elif defined(GLM_FORCE_CXX17)
-
99 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
-
100 # define GLM_LANG_STL11_FORCED
-
101 #elif defined(GLM_FORCE_CXX14)
-
102 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
-
103 # define GLM_LANG_STL11_FORCED
-
104 #elif defined(GLM_FORCE_CXX11)
-
105 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
-
106 # define GLM_LANG_STL11_FORCED
-
107 #elif defined(GLM_FORCE_CXX03)
-
108 # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT)
-
109 #elif defined(GLM_FORCE_CXX98)
-
110 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
-
111 #else
-
112 # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG)
-
113 # if GLM_COMPILER >= GLM_COMPILER_VC15_7
-
114 # define GLM_LANG_PLATFORM _MSVC_LANG
-
115 # elif GLM_COMPILER >= GLM_COMPILER_VC15
-
116 # if _MSVC_LANG > 201402L
-
117 # define GLM_LANG_PLATFORM 201402L
-
118 # else
-
119 # define GLM_LANG_PLATFORM _MSVC_LANG
-
120 # endif
-
121 # else
-
122 # define GLM_LANG_PLATFORM 0
-
123 # endif
-
124 # else
-
125 # define GLM_LANG_PLATFORM 0
-
126 # endif
-
127 
-
128 # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L
-
129 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
-
130 # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L
-
131 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
-
132 # elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L
-
133 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
-
134 # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L
-
135 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
-
136 # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-
137 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT)
-
138 # elif __cplusplus == 199711L
-
139 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
-
140 # else
-
141 # define GLM_LANG (0 | GLM_LANG_EXT)
-
142 # endif
-
143 #endif
-
144 
-
146 // Has of C++ features
-
147 
-
148 // http://clang.llvm.org/cxx_status.html
-
149 // http://gcc.gnu.org/projects/cxx0x.html
-
150 // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
-
151 
-
152 // Android has multiple STLs but C++11 STL detection doesn't always work #284 #564
-
153 #if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED)
-
154 # define GLM_HAS_CXX11_STL 0
-
155 #elif (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC
-
156 # define GLM_HAS_CXX11_STL 0
-
157 #elif (GLM_COMPILER & GLM_COMPILER_HIP)
-
158 # define GLM_HAS_CXX11_STL 0
-
159 #elif GLM_COMPILER & GLM_COMPILER_CLANG
-
160 # if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED))
-
161 # define GLM_HAS_CXX11_STL 1
-
162 # else
-
163 # define GLM_HAS_CXX11_STL 0
-
164 # endif
-
165 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
166 # define GLM_HAS_CXX11_STL 1
-
167 #else
-
168 # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
169  ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
-
170  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
-
171  ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))))
-
172 #endif
-
173 
-
174 // N1720
-
175 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
176 # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
-
177 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
178 # define GLM_HAS_STATIC_ASSERT 1
-
179 #else
-
180 # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
181  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
182  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
-
183  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
184 #endif
-
185 
-
186 // N1988
-
187 #if GLM_LANG & GLM_LANG_CXX11_FLAG
-
188 # define GLM_HAS_EXTENDED_INTEGER_TYPE 1
-
189 #else
-
190 # define GLM_HAS_EXTENDED_INTEGER_TYPE (\
-
191  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \
-
192  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
193  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \
-
194  ((GLM_COMPILER & GLM_COMPILER_HIP)))
-
195 #endif
-
196 
-
197 // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
-
198 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
199 # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
-
200 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
201 # define GLM_HAS_INITIALIZER_LISTS 1
-
202 #else
-
203 # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
204  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
-
205  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
-
206  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
207  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
208 #endif
-
209 
-
210 // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
-
211 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
212 # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
-
213 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
214 # define GLM_HAS_UNRESTRICTED_UNIONS 1
-
215 #else
-
216 # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
217  (GLM_COMPILER & GLM_COMPILER_VC) || \
-
218  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
219  ((GLM_COMPILER & GLM_COMPILER_HIP)))
-
220 #endif
-
221 
-
222 // N2346
-
223 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
224 # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
-
225 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
226 # define GLM_HAS_DEFAULTED_FUNCTIONS 1
-
227 #else
-
228 # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
229  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
-
230  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
-
231  (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
232  ((GLM_COMPILER & GLM_COMPILER_HIP)))
-
233 #endif
-
234 
-
235 // N2118
-
236 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
237 # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
-
238 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
239 # define GLM_HAS_RVALUE_REFERENCES 1
-
240 #else
-
241 # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
242  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
-
243  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
244  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
245 #endif
-
246 
-
247 // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
-
248 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
249 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
-
250 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
251 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
-
252 #else
-
253 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
254  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
-
255  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
-
256  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
257  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
258 #endif
-
259 
-
260 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
-
261 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
262 # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
-
263 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
264 # define GLM_HAS_TEMPLATE_ALIASES 1
-
265 #else
-
266 # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
267  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
-
268  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
-
269  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
270  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
271 #endif
-
272 
-
273 // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
-
274 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
275 # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
-
276 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
277 # define GLM_HAS_RANGE_FOR 1
-
278 #else
-
279 # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
280  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
-
281  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
-
282  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
283  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
284 #endif
+
56 namespace detail
+
57 {
+
58  template<glm::qualifier P>
+
59  struct is_aligned
+
60  {
+
61  static const bool value = false;
+
62  };
+
63 
+
64 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+
65  template<>
+
66  struct is_aligned<glm::aligned_lowp>
+
67  {
+
68  static const bool value = true;
+
69  };
+
70 
+
71  template<>
+
72  struct is_aligned<glm::aligned_mediump>
+
73  {
+
74  static const bool value = true;
+
75  };
+
76 
+
77  template<>
+
78  struct is_aligned<glm::aligned_highp>
+
79  {
+
80  static const bool value = true;
+
81  };
+
82 # endif
+
83 
+
84  template<length_t L, typename T, bool is_aligned>
+
85  struct storage
+
86  {
+
87  typedef struct type {
+
88  T data[L];
+
89  } type;
+
90  };
+
91 
+
92 # if GLM_HAS_ALIGNOF
+
93  template<length_t L, typename T>
+
94  struct storage<L, T, true>
+
95  {
+
96  typedef struct alignas(L * sizeof(T)) type {
+
97  T data[L];
+
98  } type;
+
99  };
+
100 
+
101  template<typename T>
+
102  struct storage<3, T, true>
+
103  {
+
104  typedef struct alignas(4 * sizeof(T)) type {
+
105  T data[4];
+
106  } type;
+
107  };
+
108 # endif
+
109 
+
110 # if GLM_ARCH & GLM_ARCH_SSE2_BIT
+
111  template<>
+
112  struct storage<4, float, true>
+
113  {
+
114  typedef glm_f32vec4 type;
+
115  };
+
116 
+
117  template<>
+
118  struct storage<4, int, true>
+
119  {
+
120  typedef glm_i32vec4 type;
+
121  };
+
122 
+
123  template<>
+
124  struct storage<4, unsigned int, true>
+
125  {
+
126  typedef glm_u32vec4 type;
+
127  };
+
128 
+
129  template<>
+
130  struct storage<3, float, true>
+
131  {
+
132  typedef glm_f32vec4 type;
+
133  };
+
134 
+
135  template<>
+
136  struct storage<3, int, true>
+
137  {
+
138  typedef glm_i32vec4 type;
+
139  };
+
140 
+
141  template<>
+
142  struct storage<3, unsigned int, true>
+
143  {
+
144  typedef glm_u32vec4 type;
+
145  };
+
146 
+
147  template<>
+
148  struct storage<2, double, true>
+
149  {
+
150  typedef glm_f64vec2 type;
+
151  };
+
152 
+
153  template<>
+
154  struct storage<2, detail::int64, true>
+
155  {
+
156  typedef glm_i64vec2 type;
+
157  };
+
158 
+
159  template<>
+
160  struct storage<2, detail::uint64, true>
+
161  {
+
162  typedef glm_u64vec2 type;
+
163  };
+
164 
+
165 
+
166  template<>
+
167  struct storage<3, detail::uint64, true>
+
168  {
+
169  typedef glm_u64vec2 type;
+
170  };
+
171 
+
172  template<>
+
173  struct storage<4, double, true>
+
174  {
+
175 # if (GLM_ARCH & GLM_ARCH_AVX_BIT)
+
176  typedef glm_f64vec4 type;
+
177 # else
+
178  struct type
+
179  {
+
180  glm_f64vec2 data[2];
+
181  GLM_CONSTEXPR glm_f64vec2 getv(int i) const {
+
182  return data[i];
+
183  }
+
184  GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) {
+
185  data[i] = v;
+
186  }
+
187  };
+
188 # endif
+
189  };
+
190 
+
191 
+
192  template<>
+
193  struct storage<3, double, true> : public storage<4, double, true>
+
194  {};
+
195 
+
196 # endif
+
197 
+
198 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
+
199  template<>
+
200  struct storage<4, detail::int64, true>
+
201  {
+
202  typedef glm_i64vec4 type;
+
203  };
+
204 
+
205  template<>
+
206  struct storage<4, detail::uint64, true>
+
207  {
+
208  typedef glm_u64vec4 type;
+
209  };
+
210 # endif
+
211 
+
212 # if GLM_ARCH & GLM_ARCH_NEON_BIT
+
213  template<>
+
214  struct storage<4, float, true>
+
215  {
+
216  typedef glm_f32vec4 type;
+
217  };
+
218 
+
219  template<>
+
220  struct storage<3, float, true> : public storage<4, float, true>
+
221  {};
+
222 
+
223  template<>
+
224  struct storage<4, int, true>
+
225  {
+
226  typedef glm_i32vec4 type;
+
227  };
+
228 
+
229  template<>
+
230  struct storage<3, int, true> : public storage<4, int, true>
+
231  {};
+
232 
+
233  template<>
+
234  struct storage<4, unsigned int, true>
+
235  {
+
236  typedef glm_u32vec4 type;
+
237  };
+
238 
+
239  template<>
+
240  struct storage<3, unsigned int, true> : public storage<4, unsigned int, true>
+
241  {};
+
242 
+
243 # if GLM_HAS_ALIGNOF
+
244  template<>
+
245  struct storage<3, double, true>
+
246  {
+
247  typedef struct alignas(4 * sizeof(double)) type {
+
248  double data[4];
+
249  } type;
+
250  };
+
251 # endif//GLM_HAS_ALIGNOF
+
252 
+
253 # endif
+
254 
+
255  enum genTypeEnum
+
256  {
+
257  GENTYPE_VEC,
+
258  GENTYPE_MAT,
+
259  GENTYPE_QUAT
+
260  };
+
261 
+
262  template <typename genType>
+
263  struct genTypeTrait
+
264  {};
+
265 
+
266  template <length_t C, length_t R, typename T>
+
267  struct genTypeTrait<mat<C, R, T> >
+
268  {
+
269  static const genTypeEnum GENTYPE = GENTYPE_MAT;
+
270  };
+
271 
+
272  template<typename genType, genTypeEnum type>
+
273  struct init_gentype
+
274  {
+
275  };
+
276 
+
277  template<typename genType>
+
278  struct init_gentype<genType, GENTYPE_QUAT>
+
279  {
+
280  GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity()
+
281  {
+
282  return genType(1, 0, 0, 0);
+
283  }
+
284  };
285 
-
286 // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
-
287 #if GLM_COMPILER & GLM_COMPILER_CLANG
-
288 # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas)
-
289 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
-
290 # define GLM_HAS_ALIGNOF 1
-
291 #else
-
292 # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
293  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \
-
294  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \
-
295  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
296  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
297 #endif
-
298 
-
299 // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
-
300 // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
-
301 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
-
302 # define GLM_HAS_CONSTEXPR 0
-
303 #elif (GLM_COMPILER & GLM_COMPILER_CLANG)
-
304 # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr)
-
305 #elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
-
306 # define GLM_HAS_CONSTEXPR 1
-
307 #else
-
308 # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\
-
309  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \
-
310  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15))))
-
311 #endif
-
312 
-
313 #if GLM_HAS_CONSTEXPR
-
314 # define GLM_CONSTEXPR constexpr
-
315 #else
-
316 # define GLM_CONSTEXPR
-
317 #endif
-
318 
-
319 //
-
320 #if GLM_HAS_CONSTEXPR
-
321 # if (GLM_COMPILER & GLM_COMPILER_CLANG)
-
322 # if __has_feature(cxx_if_constexpr)
-
323 # define GLM_HAS_IF_CONSTEXPR 1
-
324 # else
-
325 # define GLM_HAS_IF_CONSTEXPR 0
-
326 # endif
-
327 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
-
328 # define GLM_HAS_IF_CONSTEXPR 1
-
329 # else
-
330 # define GLM_HAS_IF_CONSTEXPR 0
-
331 # endif
-
332 #else
-
333 # define GLM_HAS_IF_CONSTEXPR 0
-
334 #endif
-
335 
-
336 #if GLM_HAS_IF_CONSTEXPR
-
337 # define GLM_IF_CONSTEXPR if constexpr
-
338 #else
-
339 # define GLM_IF_CONSTEXPR if
-
340 #endif
-
341 
-
342 //
-
343 #if GLM_LANG & GLM_LANG_CXX11_FLAG
-
344 # define GLM_HAS_ASSIGNABLE 1
-
345 #else
-
346 # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
347  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
-
348  ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))))
-
349 #endif
-
350 
-
351 //
-
352 #define GLM_HAS_TRIVIAL_QUERIES 0
-
353 
-
354 //
-
355 #if GLM_LANG & GLM_LANG_CXX11_FLAG
-
356 # define GLM_HAS_MAKE_SIGNED 1
-
357 #else
-
358 # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-
359  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
-
360  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-
361  ((GLM_COMPILER & GLM_COMPILER_HIP))))
-
362 #endif
-
363 
-
364 //
-
365 #if defined(GLM_FORCE_INTRINSICS)
-
366 # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
-
367  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
-
368  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT))))
-
369 #else
-
370 # define GLM_HAS_BITSCAN_WINDOWS 0
-
371 #endif
-
372 
-
373 #if GLM_LANG & GLM_LANG_CXX11_FLAG
-
374 # define GLM_HAS_NOEXCEPT 1
-
375 #else
-
376 # define GLM_HAS_NOEXCEPT 0
-
377 #endif
-
378 
-
379 #if GLM_HAS_NOEXCEPT
-
380 # define GLM_NOEXCEPT noexcept
-
381 #else
-
382 # define GLM_NOEXCEPT
-
383 #endif
-
384 
-
386 // OpenMP
-
387 #ifdef _OPENMP
-
388 # if GLM_COMPILER & GLM_COMPILER_GCC
-
389 # if GLM_COMPILER >= GLM_COMPILER_GCC61
-
390 # define GLM_HAS_OPENMP 45
-
391 # elif GLM_COMPILER >= GLM_COMPILER_GCC49
-
392 # define GLM_HAS_OPENMP 40
-
393 # elif GLM_COMPILER >= GLM_COMPILER_GCC47
-
394 # define GLM_HAS_OPENMP 31
-
395 # else
-
396 # define GLM_HAS_OPENMP 0
-
397 # endif
-
398 # elif GLM_COMPILER & GLM_COMPILER_CLANG
-
399 # if GLM_COMPILER >= GLM_COMPILER_CLANG38
-
400 # define GLM_HAS_OPENMP 31
-
401 # else
-
402 # define GLM_HAS_OPENMP 0
-
403 # endif
-
404 # elif GLM_COMPILER & GLM_COMPILER_VC
-
405 # define GLM_HAS_OPENMP 20
-
406 # elif GLM_COMPILER & GLM_COMPILER_INTEL
-
407 # if GLM_COMPILER >= GLM_COMPILER_INTEL16
-
408 # define GLM_HAS_OPENMP 40
-
409 # else
-
410 # define GLM_HAS_OPENMP 0
-
411 # endif
-
412 # else
-
413 # define GLM_HAS_OPENMP 0
-
414 # endif
-
415 #else
-
416 # define GLM_HAS_OPENMP 0
-
417 #endif
-
418 
-
420 // nullptr
-
421 
-
422 #if GLM_LANG & GLM_LANG_CXX0X_FLAG
-
423 # define GLM_CONFIG_NULLPTR GLM_ENABLE
-
424 #else
-
425 # define GLM_CONFIG_NULLPTR GLM_DISABLE
-
426 #endif
-
427 
-
428 #if GLM_CONFIG_NULLPTR == GLM_ENABLE
-
429 # define GLM_NULLPTR nullptr
-
430 #else
-
431 # define GLM_NULLPTR 0
-
432 #endif
-
433 
-
435 // Static assert
-
436 
-
437 #if GLM_HAS_STATIC_ASSERT
-
438 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
-
439 #elif GLM_COMPILER & GLM_COMPILER_VC
-
440 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
-
441 #else
-
442 # define GLM_STATIC_ASSERT(x, message) assert(x)
-
443 #endif//GLM_LANG
-
444 
-
446 // Qualifiers
-
447 
-
448 // User defines: GLM_CUDA_FORCE_DEVICE_FUNC, GLM_CUDA_FORCE_HOST_FUNC
-
449 
-
450 #if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
-
451 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
-
452 # error "GLM error: GLM_CUDA_FORCE_DEVICE_FUNC and GLM_CUDA_FORCE_HOST_FUNC should not be defined at the same time, GLM by default generates both device and host code for CUDA compiler."
-
453 # endif//defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
-
454 
-
455 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC)
-
456 # define GLM_CUDA_FUNC_DEF __device__
-
457 # define GLM_CUDA_FUNC_DECL __device__
-
458 # elif defined(GLM_CUDA_FORCE_HOST_FUNC)
-
459 # define GLM_CUDA_FUNC_DEF __host__
-
460 # define GLM_CUDA_FUNC_DECL __host__
-
461 # else
-
462 # define GLM_CUDA_FUNC_DEF __device__ __host__
-
463 # define GLM_CUDA_FUNC_DECL __device__ __host__
-
464 # endif//defined(GLM_CUDA_FORCE_XXXX_FUNC)
-
465 #else
-
466 # define GLM_CUDA_FUNC_DEF
-
467 # define GLM_CUDA_FUNC_DECL
-
468 #endif
-
469 
-
470 #if defined(GLM_FORCE_INLINE)
-
471 # if GLM_COMPILER & GLM_COMPILER_VC
-
472 # define GLM_INLINE __forceinline
-
473 # define GLM_NEVER_INLINE __declspec(noinline)
-
474 # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
-
475 # define GLM_INLINE inline __attribute__((__always_inline__))
-
476 # define GLM_NEVER_INLINE __attribute__((__noinline__))
-
477 # elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
-
478 # define GLM_INLINE __forceinline__
-
479 # define GLM_NEVER_INLINE __noinline__
-
480 # else
-
481 # define GLM_INLINE inline
-
482 # define GLM_NEVER_INLINE
-
483 # endif//GLM_COMPILER
-
484 #else
-
485 # define GLM_INLINE inline
-
486 # define GLM_NEVER_INLINE
-
487 #endif//defined(GLM_FORCE_INLINE)
-
488 
-
489 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
-
490 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
-
491 
-
492 // Do not use CUDA function qualifiers on CUDA compiler when functions are made default
-
493 #if GLM_HAS_DEFAULTED_FUNCTIONS
-
494 # define GLM_DEFAULTED_FUNC_DECL
-
495 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE
-
496 #else
-
497 # define GLM_DEFAULTED_FUNC_DECL GLM_FUNC_DECL
-
498 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_FUNC_QUALIFIER
-
499 #endif//GLM_HAS_DEFAULTED_FUNCTIONS
-
500 #if !defined(GLM_FORCE_CTOR_INIT)
-
501 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_DEFAULTED_FUNC_DECL
-
502 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_DEFAULTED_FUNC_QUALIFIER
-
503 #else
-
504 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_FUNC_DECL
-
505 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_FUNC_QUALIFIER
-
506 #endif//GLM_FORCE_CTOR_INIT
-
507 
-
509 // Swizzle operators
-
510 
-
511 // User defines: GLM_FORCE_SWIZZLE
-
512 
-
513 #define GLM_SWIZZLE_DISABLED 0
-
514 #define GLM_SWIZZLE_OPERATOR 1
-
515 #define GLM_SWIZZLE_FUNCTION 2
-
516 
-
517 #if defined(GLM_SWIZZLE)
-
518 # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.")
-
519 # define GLM_FORCE_SWIZZLE
-
520 #endif
-
521 
-
522 #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY)
-
523 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR
-
524 #elif defined(GLM_FORCE_SWIZZLE)
-
525 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
-
526 #else
-
527 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED
-
528 #endif
-
529 
-
531 // Allows using not basic types as genType
-
532 
-
533 // #define GLM_FORCE_UNRESTRICTED_GENTYPE
-
534 
-
535 #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE
-
536 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE
-
537 #else
-
538 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE
-
539 #endif
-
540 
-
542 // Allows using any scaler as float
-
543 
-
544 // #define GLM_FORCE_UNRESTRICTED_FLOAT
-
545 
-
546 #ifdef GLM_FORCE_UNRESTRICTED_FLOAT
-
547 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_ENABLE
-
548 #else
-
549 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_DISABLE
-
550 #endif
-
551 
-
553 // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM
-
554 // to use a clip space between 0 to 1.
-
555 // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM
-
556 // to use left handed coordinate system by default.
-
557 
-
558 #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE
-
559 #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE
-
560 #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan
-
561 #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM
-
562 
-
563 #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
-
564 #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT)
-
565 #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
-
566 #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT)
-
567 
-
568 #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE
-
569 # ifdef GLM_FORCE_LEFT_HANDED
-
570 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO
-
571 # else
-
572 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO
-
573 # endif
-
574 #else
-
575 # ifdef GLM_FORCE_LEFT_HANDED
-
576 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO
-
577 # else
-
578 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO
-
579 # endif
-
580 #endif
-
581 
-
583 // Qualifiers
-
584 
-
585 #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
-
586 # define GLM_DEPRECATED __declspec(deprecated)
-
587 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
-
588 #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
-
589 # define GLM_DEPRECATED __attribute__((__deprecated__))
-
590 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
-
591 #elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
-
592 # define GLM_DEPRECATED
-
593 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
-
594 #else
-
595 # define GLM_DEPRECATED
-
596 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
-
597 #endif
-
598 
-
600 
-
601 #ifdef GLM_FORCE_EXPLICIT_CTOR
-
602 # define GLM_EXPLICIT explicit
-
603 #else
-
604 # define GLM_EXPLICIT
-
605 #endif
-
606 
-
608 // Length type: all length functions returns a length_t type.
-
609 // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
-
610 // length_t is a typedef of int like GLSL defines it.
-
611 
-
612 #define GLM_LENGTH_INT 1
-
613 #define GLM_LENGTH_SIZE_T 2
-
614 
-
615 #ifdef GLM_FORCE_SIZE_T_LENGTH
-
616 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T
-
617 #else
-
618 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT
-
619 #endif
-
620 
-
621 namespace glm
-
622 {
-
623  using std::size_t;
-
624 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
-
625  typedef size_t length_t;
-
626 # else
-
627  typedef int length_t;
-
628 # endif
-
629 }//namespace glm
-
630 
-
632 // constexpr
-
633 
-
634 #if GLM_HAS_CONSTEXPR
-
635 # define GLM_CONFIG_CONSTEXP GLM_ENABLE
-
636 
-
637  namespace glm
-
638  {
-
639  template<typename T, std::size_t N>
-
640  constexpr std::size_t countof(T const (&)[N])
-
641  {
-
642  return N;
-
643  }
-
644  }//namespace glm
-
645 # define GLM_COUNTOF(arr) glm::countof(arr)
-
646 #elif defined(_MSC_VER)
-
647 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
-
648 
-
649 # define GLM_COUNTOF(arr) _countof(arr)
-
650 #else
-
651 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
-
652 
-
653 # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
-
654 #endif
-
655 
-
657 // uint
-
658 
-
659 namespace glm{
-
660 namespace detail
-
661 {
-
662  template<typename T>
-
663  struct is_int
-
664  {
-
665  enum test {value = 0};
-
666  };
-
667 
-
668  template<>
-
669  struct is_int<unsigned int>
-
670  {
-
671  enum test {value = ~0};
-
672  };
-
673 
-
674  template<>
-
675  struct is_int<signed int>
-
676  {
-
677  enum test {value = ~0};
-
678  };
-
679 }//namespace detail
-
680 
-
681  typedef unsigned int uint;
-
682 }//namespace glm
-
683 
-
685 // 64-bit int
-
686 
-
687 #if GLM_HAS_EXTENDED_INTEGER_TYPE
-
688 # include <cstdint>
-
689 #endif
-
690 
-
691 namespace glm{
-
692 namespace detail
-
693 {
-
694 # if GLM_HAS_EXTENDED_INTEGER_TYPE
-
695  typedef std::uint64_t uint64;
-
696  typedef std::int64_t int64;
-
697 # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
-
698  typedef uint64_t uint64;
-
699  typedef int64_t int64;
-
700 # elif GLM_COMPILER & GLM_COMPILER_VC
-
701  typedef unsigned __int64 uint64;
-
702  typedef signed __int64 int64;
-
703 # elif GLM_COMPILER & GLM_COMPILER_GCC
-
704 # pragma GCC diagnostic ignored "-Wlong-long"
-
705  __extension__ typedef unsigned long long uint64;
-
706  __extension__ typedef signed long long int64;
-
707 # elif (GLM_COMPILER & GLM_COMPILER_CLANG)
-
708 # pragma clang diagnostic ignored "-Wc++11-long-long"
-
709  typedef unsigned long long uint64;
-
710  typedef signed long long int64;
-
711 # else//unknown compiler
-
712  typedef unsigned long long uint64;
-
713  typedef signed long long int64;
-
714 # endif
-
715 }//namespace detail
-
716 }//namespace glm
-
717 
-
719 // make_unsigned
-
720 
-
721 #if GLM_HAS_MAKE_SIGNED
-
722 # include <type_traits>
-
723 
-
724 namespace glm{
-
725 namespace detail
-
726 {
-
727  using std::make_unsigned;
-
728 }//namespace detail
-
729 }//namespace glm
-
730 
-
731 #else
-
732 
-
733 namespace glm{
-
734 namespace detail
-
735 {
-
736  template<typename genType>
-
737  struct make_unsigned
-
738  {};
-
739 
-
740  template<>
-
741  struct make_unsigned<char>
-
742  {
-
743  typedef unsigned char type;
-
744  };
-
745 
-
746  template<>
-
747  struct make_unsigned<signed char>
-
748  {
-
749  typedef unsigned char type;
-
750  };
-
751 
-
752  template<>
-
753  struct make_unsigned<short>
-
754  {
-
755  typedef unsigned short type;
-
756  };
-
757 
-
758  template<>
-
759  struct make_unsigned<int>
-
760  {
-
761  typedef unsigned int type;
-
762  };
-
763 
-
764  template<>
-
765  struct make_unsigned<long>
-
766  {
-
767  typedef unsigned long type;
-
768  };
-
769 
-
770  template<>
-
771  struct make_unsigned<int64>
-
772  {
-
773  typedef uint64 type;
-
774  };
-
775 
-
776  template<>
-
777  struct make_unsigned<unsigned char>
-
778  {
-
779  typedef unsigned char type;
-
780  };
-
781 
-
782  template<>
-
783  struct make_unsigned<unsigned short>
-
784  {
-
785  typedef unsigned short type;
-
786  };
-
787 
-
788  template<>
-
789  struct make_unsigned<unsigned int>
-
790  {
-
791  typedef unsigned int type;
-
792  };
-
793 
-
794  template<>
-
795  struct make_unsigned<unsigned long>
-
796  {
-
797  typedef unsigned long type;
-
798  };
-
799 
-
800  template<>
-
801  struct make_unsigned<uint64>
-
802  {
-
803  typedef uint64 type;
-
804  };
-
805 }//namespace detail
-
806 }//namespace glm
-
807 #endif
-
808 
-
810 // Only use x, y, z, w as vector type components
-
811 
-
812 #ifdef GLM_FORCE_XYZW_ONLY
-
813 # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE
-
814 #else
-
815 # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE
-
816 #endif
-
817 
-
819 // Configure the use of defaulted initialized types
-
820 
-
821 #define GLM_CTOR_INIT_DISABLE 0
-
822 #define GLM_CTOR_INITIALIZER_LIST 1
-
823 #define GLM_CTOR_INITIALISATION 2
-
824 
-
825 #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
-
826 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
-
827 #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
-
828 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION
-
829 #else
-
830 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
-
831 #endif
-
832 
-
834 // Use SIMD instruction sets
-
835 
-
836 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
-
837 # define GLM_CONFIG_SIMD GLM_ENABLE
-
838 #else
-
839 # define GLM_CONFIG_SIMD GLM_DISABLE
-
840 #endif
-
841 
-
843 // Configure the use of defaulted function
-
844 
-
845 #if GLM_HAS_DEFAULTED_FUNCTIONS
-
846 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE
-
847 # define GLM_DEFAULT = default
-
848 #else
-
849 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE
-
850 # define GLM_DEFAULT
-
851 #endif
-
852 
-
853 #if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
-
854 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE
-
855 # define GLM_DEFAULT_CTOR GLM_DEFAULT
-
856 #else
-
857 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE
-
858 # define GLM_DEFAULT_CTOR
-
859 #endif
-
860 
-
862 // Configure the use of aligned gentypes
-
863 
-
864 #ifdef GLM_FORCE_ALIGNED // Legacy define
-
865 # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
-
866 #endif
-
867 
-
868 #ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
-
869 # define GLM_FORCE_ALIGNED_GENTYPES
-
870 #endif
-
871 
-
872 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE))
-
873 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE
-
874 #else
-
875 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE
-
876 #endif
-
877 
-
879 // Configure the use of anonymous structure as implementation detail
-
880 
-
881 #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE))
-
882 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE
-
883 #else
-
884 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE
-
885 #endif
-
886 
-
888 // Silent warnings
-
889 
-
890 #ifdef GLM_FORCE_WARNINGS
-
891 # define GLM_SILENT_WARNINGS GLM_DISABLE
-
892 #else
-
893 # define GLM_SILENT_WARNINGS GLM_ENABLE
-
894 #endif
-
895 
-
897 // Precision
-
898 
-
899 #define GLM_HIGHP 1
-
900 #define GLM_MEDIUMP 2
-
901 #define GLM_LOWP 3
-
902 
-
903 #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL)
-
904 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
-
905 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL)
-
906 # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP
-
907 #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL)
-
908 # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP
-
909 #else
-
910 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
-
911 #endif
-
912 
-
913 #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT)
-
914 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
-
915 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT)
-
916 # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP
-
917 #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT)
-
918 # define GLM_CONFIG_PRECISION_INT GLM_LOWP
-
919 #else
-
920 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
-
921 #endif
-
922 
-
923 #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT)
-
924 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
-
925 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT)
-
926 # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP
-
927 #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT)
-
928 # define GLM_CONFIG_PRECISION_UINT GLM_LOWP
-
929 #else
-
930 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
-
931 #endif
-
932 
-
933 #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT)
-
934 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
-
935 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT)
-
936 # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP
-
937 #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT)
-
938 # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP
-
939 #else
-
940 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
-
941 #endif
-
942 
-
943 #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE)
-
944 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
-
945 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE)
-
946 # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP
-
947 #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE)
-
948 # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP
-
949 #else
-
950 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
-
951 #endif
-
952 
-
954 // Check inclusions of different versions of GLM
-
955 
-
956 #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
-
957 # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
-
958 #elif GLM_SETUP_INCLUDED == GLM_VERSION
-
959 
-
961 // Messages
-
962 
-
963 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED)
-
964 # define GLM_MESSAGE_DISPLAYED
-
965 # define GLM_STR_HELPER(x) #x
-
966 # define GLM_STR(x) GLM_STR_HELPER(x)
-
967 
-
968  // Report GLM version
-
969 # pragma message (GLM_STR(GLM_VERSION_MESSAGE))
-
970 
-
971  // Report C++ language
-
972 # if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
973 # pragma message("GLM: C++ 20 with extensions")
-
974 # elif (GLM_LANG & GLM_LANG_CXX20_FLAG)
-
975 # pragma message("GLM: C++ 2A")
-
976 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
977 # pragma message("GLM: C++ 17 with extensions")
-
978 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
-
979 # pragma message("GLM: C++ 17")
-
980 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
981 # pragma message("GLM: C++ 14 with extensions")
-
982 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
-
983 # pragma message("GLM: C++ 14")
-
984 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
985 # pragma message("GLM: C++ 11 with extensions")
-
986 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG)
-
987 # pragma message("GLM: C++ 11")
-
988 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
989 # pragma message("GLM: C++ 0x with extensions")
-
990 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG)
-
991 # pragma message("GLM: C++ 0x")
-
992 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
993 # pragma message("GLM: C++ 03 with extensions")
-
994 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG)
-
995 # pragma message("GLM: C++ 03")
-
996 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT)
-
997 # pragma message("GLM: C++ 98 with extensions")
-
998 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG)
-
999 # pragma message("GLM: C++ 98")
-
1000 # else
-
1001 # pragma message("GLM: C++ language undetected")
-
1002 # endif//GLM_LANG
-
1003 
-
1004  // Report compiler detection
-
1005 # if GLM_COMPILER & GLM_COMPILER_CUDA
-
1006 # pragma message("GLM: CUDA compiler detected")
-
1007 # elif GLM_COMPILER & GLM_COMPILER_HIP
-
1008 # pragma message("GLM: HIP compiler detected")
-
1009 # elif GLM_COMPILER & GLM_COMPILER_VC
-
1010 # pragma message("GLM: Visual C++ compiler detected")
-
1011 # elif GLM_COMPILER & GLM_COMPILER_CLANG
-
1012 # pragma message("GLM: Clang compiler detected")
-
1013 # elif GLM_COMPILER & GLM_COMPILER_INTEL
-
1014 # pragma message("GLM: Intel Compiler detected")
-
1015 # elif GLM_COMPILER & GLM_COMPILER_GCC
-
1016 # pragma message("GLM: GCC compiler detected")
-
1017 # else
-
1018 # pragma message("GLM: Compiler not detected")
-
1019 # endif
-
1020 
-
1021  // Report build target
-
1022 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1023 # pragma message("GLM: x86 64 bits with AVX2 instruction set build target")
-
1024 # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1025 # pragma message("GLM: x86 32 bits with AVX2 instruction set build target")
-
1026 
-
1027 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1028 # pragma message("GLM: x86 64 bits with AVX instruction set build target")
-
1029 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1030 # pragma message("GLM: x86 32 bits with AVX instruction set build target")
-
1031 
-
1032 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1033 # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target")
-
1034 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1035 # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target")
-
1036 
-
1037 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1038 # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target")
-
1039 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1040 # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target")
-
1041 
-
1042 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1043 # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target")
-
1044 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1045 # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target")
-
1046 
-
1047 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1048 # pragma message("GLM: x86 64 bits with SSE3 instruction set build target")
-
1049 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1050 # pragma message("GLM: x86 32 bits with SSE3 instruction set build target")
-
1051 
-
1052 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1053 # pragma message("GLM: x86 64 bits with SSE2 instruction set build target")
-
1054 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1055 # pragma message("GLM: x86 32 bits with SSE2 instruction set build target")
-
1056 
-
1057 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1058 # pragma message("GLM: x86 64 bits build target")
-
1059 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1060 # pragma message("GLM: x86 32 bits build target")
-
1061 
-
1062 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1063 # pragma message("GLM: ARM 64 bits with Neon instruction set build target")
-
1064 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1065 # pragma message("GLM: ARM 32 bits with Neon instruction set build target")
-
1066 
-
1067 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1068 # pragma message("GLM: ARM 64 bits build target")
-
1069 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1070 # pragma message("GLM: ARM 32 bits build target")
-
1071 
-
1072 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1073 # pragma message("GLM: MIPS 64 bits build target")
-
1074 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1075 # pragma message("GLM: MIPS 32 bits build target")
-
1076 
-
1077 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64)
-
1078 # pragma message("GLM: PowerPC 64 bits build target")
-
1079 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32)
-
1080 # pragma message("GLM: PowerPC 32 bits build target")
-
1081 # else
-
1082 # pragma message("GLM: Unknown build target")
-
1083 # endif//GLM_ARCH
-
1084 
-
1085  // Report platform name
-
1086 # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
-
1087 # pragma message("GLM: QNX platform detected")
-
1088 //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
-
1089 //# pragma message("GLM: iOS platform detected")
-
1090 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
-
1091 # pragma message("GLM: Apple platform detected")
-
1092 # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
-
1093 # pragma message("GLM: WinCE platform detected")
-
1094 # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
-
1095 # pragma message("GLM: Windows platform detected")
-
1096 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
-
1097 # pragma message("GLM: Native Client detected")
-
1098 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
-
1099 # pragma message("GLM: Android platform detected")
-
1100 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
-
1101 # pragma message("GLM: Linux platform detected")
-
1102 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
-
1103 # pragma message("GLM: UNIX platform detected")
-
1104 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
-
1105 # pragma message("GLM: platform unknown")
-
1106 # else
-
1107 # pragma message("GLM: platform not detected")
-
1108 # endif
-
1109 
-
1110  // Report whether only xyzw component are used
-
1111 # if defined GLM_FORCE_XYZW_ONLY
-
1112 # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.")
-
1113 # endif
-
1114 
-
1115  // Report swizzle operator support
-
1116 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
-
1117 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.")
-
1118 # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
-
1119 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.")
-
1120 # else
-
1121 # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.")
-
1122 # endif
-
1123 
-
1124  // Report .length() type
-
1125 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
-
1126 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.")
-
1127 # else
-
1128 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.")
-
1129 # endif
-
1130 
-
1131 # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE
-
1132 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.")
-
1133 # else
-
1134 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.")
-
1135 # endif
-
1136 
-
1137 # if GLM_SILENT_WARNINGS == GLM_ENABLE
-
1138 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.")
-
1139 # else
-
1140 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.")
-
1141 # endif
-
1142 
-
1143 # ifdef GLM_FORCE_SINGLE_ONLY
-
1144 # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.")
-
1145 # endif
-
1146 
-
1147 # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)
-
1148 # undef GLM_FORCE_ALIGNED_GENTYPES
-
1149 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.")
-
1150 # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE)
-
1151 # undef GLM_FORCE_ALIGNED_GENTYPES
-
1152 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
-
1153 # endif
-
1154 
-
1155 # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
-
1156 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE
-
1157 # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
-
1158 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
-
1159 # elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
-
1160 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.")
-
1161 # endif
-
1162 # endif
-
1163 
-
1164 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
-
1165 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.")
-
1166 # else
-
1167 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.")
-
1168 # endif
-
1169 
-
1170 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
-
1171 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.")
-
1172 # else
-
1173 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.")
-
1174 # endif
-
1175 #endif//GLM_MESSAGES
-
1176 
-
1177 #endif//GLM_SETUP_INCLUDED
+
286  template<typename genType>
+
287  struct init_gentype<genType, GENTYPE_MAT>
+
288  {
+
289  GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity()
+
290  {
+
291  return genType(1);
+
292  }
+
293  };
+
294 }//namespace detail
+
295 }//namespace glm
-
detail::uint64 uint64
64 bit unsigned integer type.
-
uint64 uint64_t
Default qualifier 64 bit unsigned integer type.
Definition: fwd.hpp:145
-
int64 int64_t
64 bit signed integer type.
Definition: fwd.hpp:85
-
detail::int64 int64
64 bit signed integer type.
+
detail::uint64 uint64
64 bit unsigned integer type.
+
GLM_FUNC_DECL GLM_CONSTEXPR genType identity()
Builds an identity matrix.
+
detail::int64 int64
64 bit signed integer type.
-
1 #pragma once
+
1 #ifndef GLM_SETUP_INCLUDED
2 
-
3 #include "setup.hpp"
-
4 
-
5 #if GLM_COMPILER == GLM_COMPILER_VC12
-
6 # pragma warning(push)
-
7 # pragma warning(disable: 4512) // assignment operator could not be generated
-
8 #endif
-
9 
-
10 namespace glm{
-
11 namespace detail
-
12 {
-
13  template <typename T>
-
14  union float_t
-
15  {};
+
3 #include <cassert>
+
4 #include <cstddef>
+
5 
+
6 #define GLM_VERSION_MAJOR 1
+
7 #define GLM_VERSION_MINOR 0
+
8 #define GLM_VERSION_PATCH 2
+
9 #define GLM_VERSION_REVISION 0 // Deprecated
+
10 #define GLM_VERSION 1000 // Deprecated
+
11 
+
12 #define GLM_MAKE_API_VERSION(variant, major, minor, patch) \
+
13  ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
+
14 
+
15 #define GLM_VERSION_COMPLETE GLM_MAKE_API_VERSION(0, GLM_VERSION_MAJOR, GLM_VERSION_MINOR, GLM_VERSION_PATCH)
16 
-
17  // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
-
18  template <>
-
19  union float_t<float>
-
20  {
-
21  typedef int int_type;
-
22  typedef float float_type;
+
17 #define GLM_SETUP_INCLUDED GLM_VERSION
+
18 
+
19 #define GLM_GET_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U)
+
20 #define GLM_GET_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU)
+
21 #define GLM_GET_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU)
+
22 #define GLM_GET_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
23 
-
24  GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {}
-
25 
-
26  GLM_CONSTEXPR float_t& operator=(float_t const& x)
-
27  {
-
28  f = x.f;
-
29  return *this;
-
30  }
-
31 
-
32  // Portable extraction of components.
-
33  GLM_CONSTEXPR bool negative() const { return i < 0; }
-
34  GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); }
-
35  GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); }
-
36 
-
37  int_type i;
-
38  float_type f;
-
39  };
-
40 
-
41  template <>
-
42  union float_t<double>
-
43  {
-
44  typedef detail::int64 int_type;
-
45  typedef double float_type;
+
25 // Active states
+
26 
+
27 #define GLM_DISABLE 0
+
28 #define GLM_ENABLE 1
+
29 
+
31 // Messages
+
32 
+
33 #if defined(GLM_FORCE_MESSAGES)
+
34 # define GLM_MESSAGES GLM_ENABLE
+
35 #else
+
36 # define GLM_MESSAGES GLM_DISABLE
+
37 #endif
+
38 
+
40 // Detect the platform
+
41 
+
42 #include "../simd/platform.h"
+
43 
+
45 // Build model
46 
-
47  GLM_CONSTEXPR float_t(float_type Num = static_cast<float_type>(0)) : f(Num) {}
-
48 
-
49  GLM_CONSTEXPR float_t& operator=(float_t const& x)
-
50  {
-
51  f = x.f;
-
52  return *this;
-
53  }
+
47 #if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__)
+
48 # define GLM_MODEL GLM_MODEL_64
+
49 #elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM)
+
50 # define GLM_MODEL GLM_MODEL_32
+
51 #else
+
52 # define GLM_MODEL GLM_MODEL_32
+
53 #endif//
54 
-
55  // Portable extraction of components.
-
56  GLM_CONSTEXPR bool negative() const { return i < 0; }
-
57  GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); }
-
58  GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); }
-
59 
-
60  int_type i;
-
61  float_type f;
-
62  };
-
63 }//namespace detail
-
64 }//namespace glm
-
65 
-
66 #if GLM_COMPILER == GLM_COMPILER_VC12
-
67 # pragma warning(pop)
-
68 #endif
+
55 #if !defined(GLM_MODEL) && GLM_COMPILER != 0
+
56 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
+
57 #endif//GLM_MODEL
+
58 
+
60 // C++ Version
+
61 
+
62 // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A
+
63 
+
64 #define GLM_LANG_CXX98_FLAG (1 << 1)
+
65 #define GLM_LANG_CXX03_FLAG (1 << 2)
+
66 #define GLM_LANG_CXX0X_FLAG (1 << 3)
+
67 #define GLM_LANG_CXX11_FLAG (1 << 4)
+
68 #define GLM_LANG_CXX14_FLAG (1 << 5)
+
69 #define GLM_LANG_CXX17_FLAG (1 << 6)
+
70 #define GLM_LANG_CXX20_FLAG (1 << 7)
+
71 #define GLM_LANG_CXXMS_FLAG (1 << 8)
+
72 #define GLM_LANG_CXXGNU_FLAG (1 << 9)
+
73 
+
74 #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG
+
75 #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG)
+
76 #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG)
+
77 #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG)
+
78 #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG)
+
79 #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG)
+
80 #define GLM_LANG_CXX20 (GLM_LANG_CXX17 | GLM_LANG_CXX20_FLAG)
+
81 #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
+
82 #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
+
83 
+
84 #if (defined(_MSC_EXTENSIONS))
+
85 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
+
86 #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT))
+
87 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
+
88 #else
+
89 # define GLM_LANG_EXT 0
+
90 #endif
+
91 
+
92 #if (defined(GLM_FORCE_CXX_UNKNOWN))
+
93 # define GLM_LANG 0
+
94 #elif defined(GLM_FORCE_CXX20)
+
95 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
+
96 # define GLM_LANG_STL11_FORCED
+
97 #elif defined(GLM_FORCE_CXX17)
+
98 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
+
99 # define GLM_LANG_STL11_FORCED
+
100 #elif defined(GLM_FORCE_CXX14)
+
101 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
+
102 # define GLM_LANG_STL11_FORCED
+
103 #elif defined(GLM_FORCE_CXX11)
+
104 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
+
105 # define GLM_LANG_STL11_FORCED
+
106 #elif defined(GLM_FORCE_CXX03)
+
107 # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT)
+
108 #elif defined(GLM_FORCE_CXX98)
+
109 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
+
110 #else
+
111 # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG)
+
112 # if GLM_COMPILER >= GLM_COMPILER_VC15_7
+
113 # define GLM_LANG_PLATFORM _MSVC_LANG
+
114 # elif GLM_COMPILER >= GLM_COMPILER_VC15
+
115 # if _MSVC_LANG > 201402L
+
116 # define GLM_LANG_PLATFORM 201402L
+
117 # else
+
118 # define GLM_LANG_PLATFORM _MSVC_LANG
+
119 # endif
+
120 # else
+
121 # define GLM_LANG_PLATFORM 0
+
122 # endif
+
123 # else
+
124 # define GLM_LANG_PLATFORM 0
+
125 # endif
+
126 
+
127 # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L
+
128 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
+
129 # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L
+
130 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
+
131 # elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L
+
132 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
+
133 # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L
+
134 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
+
135 # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+
136 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT)
+
137 # elif __cplusplus == 199711L
+
138 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
+
139 # else
+
140 # define GLM_LANG (0 | GLM_LANG_EXT)
+
141 # endif
+
142 #endif
+
143 
+
145 // Has of C++ features
+
146 
+
147 // http://clang.llvm.org/cxx_status.html
+
148 // http://gcc.gnu.org/projects/cxx0x.html
+
149 // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
+
150 
+
151 #if (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC
+
152 # define GLM_HAS_CXX11_STL 0
+
153 #elif (GLM_COMPILER & GLM_COMPILER_HIP)
+
154 # define GLM_HAS_CXX11_STL 0
+
155 #elif GLM_COMPILER & GLM_COMPILER_CLANG
+
156 # if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED))
+
157 # define GLM_HAS_CXX11_STL 1
+
158 # else
+
159 # define GLM_HAS_CXX11_STL 0
+
160 # endif
+
161 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
162 # define GLM_HAS_CXX11_STL 1
+
163 #else
+
164 # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
165  ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
+
166  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
+
167  ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))))
+
168 #endif
+
169 
+
170 // N1720
+
171 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
172 # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
+
173 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
174 # define GLM_HAS_STATIC_ASSERT 1
+
175 #else
+
176 # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
177  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
178  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
+
179  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
180 #endif
+
181 
+
182 // N1988
+
183 #if GLM_LANG & GLM_LANG_CXX11_FLAG
+
184 # define GLM_HAS_EXTENDED_INTEGER_TYPE 1
+
185 #else
+
186 # define GLM_HAS_EXTENDED_INTEGER_TYPE (\
+
187  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \
+
188  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
189  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \
+
190  ((GLM_COMPILER & GLM_COMPILER_HIP)))
+
191 #endif
+
192 
+
193 // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
+
194 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
195 # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
+
196 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
197 # define GLM_HAS_INITIALIZER_LISTS 1
+
198 #else
+
199 # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
200  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
+
201  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
+
202  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
203  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
204 #endif
+
205 
+
206 // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
+
207 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
208 # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
+
209 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
210 # define GLM_HAS_UNRESTRICTED_UNIONS 1
+
211 #else
+
212 # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
213  (GLM_COMPILER & GLM_COMPILER_VC) || \
+
214  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
215  ((GLM_COMPILER & GLM_COMPILER_HIP)))
+
216 #endif
+
217 
+
218 // N2346
+
219 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
220 # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
+
221 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
222 # define GLM_HAS_DEFAULTED_FUNCTIONS 1
+
223 #else
+
224 # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
225  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
+
226  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
+
227  (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
228  ((GLM_COMPILER & GLM_COMPILER_HIP)))
+
229 #endif
+
230 
+
231 // N2118
+
232 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
233 # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
+
234 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
235 # define GLM_HAS_RVALUE_REFERENCES 1
+
236 #else
+
237 # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
238  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
+
239  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
240  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
241 #endif
+
242 
+
243 // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
+
244 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
245 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
+
246 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
247 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
+
248 #else
+
249 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
250  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
+
251  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
+
252  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
253  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
254 #endif
+
255 
+
256 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
+
257 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
258 # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
+
259 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
260 # define GLM_HAS_TEMPLATE_ALIASES 1
+
261 #else
+
262 # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
263  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
+
264  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
+
265  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
266  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
267 #endif
+
268 
+
269 // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
+
270 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
271 # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
+
272 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
273 # define GLM_HAS_RANGE_FOR 1
+
274 #else
+
275 # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
276  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
+
277  ((GLM_COMPILER & GLM_COMPILER_VC)) || \
+
278  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
279  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
280 #endif
+
281 
+
282 // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
+
283 #if GLM_COMPILER & GLM_COMPILER_CLANG
+
284 # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas)
+
285 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
+
286 # define GLM_HAS_ALIGNOF 1
+
287 #else
+
288 # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
289  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \
+
290  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \
+
291  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
292  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
293 #endif
+
294 
+
295 // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
+
296 // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
+
297 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
+
298 # define GLM_HAS_CONSTEXPR 0
+
299 #elif (GLM_COMPILER & GLM_COMPILER_CLANG)
+
300 # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr)
+
301 #elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
+
302 # define GLM_HAS_CONSTEXPR 1
+
303 #else
+
304 # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\
+
305  ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \
+
306  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15))))
+
307 #endif
+
308 
+
309 #if GLM_HAS_CONSTEXPR
+
310 # define GLM_CONSTEXPR constexpr
+
311 #else
+
312 # define GLM_CONSTEXPR
+
313 #endif
+
314 
+
315 //
+
316 #if GLM_HAS_CONSTEXPR
+
317 # if (GLM_COMPILER & GLM_COMPILER_CLANG)
+
318 # if __has_feature(cxx_if_constexpr)
+
319 # define GLM_HAS_IF_CONSTEXPR 1
+
320 # else
+
321 # define GLM_HAS_IF_CONSTEXPR 0
+
322 # endif
+
323 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
+
324 # define GLM_HAS_IF_CONSTEXPR 1
+
325 # else
+
326 # define GLM_HAS_IF_CONSTEXPR 0
+
327 # endif
+
328 #else
+
329 # define GLM_HAS_IF_CONSTEXPR 0
+
330 #endif
+
331 
+
332 #if GLM_HAS_IF_CONSTEXPR
+
333 # define GLM_IF_CONSTEXPR if constexpr
+
334 #else
+
335 # define GLM_IF_CONSTEXPR if
+
336 #endif
+
337 
+
338 // [nodiscard]
+
339 #if GLM_LANG & GLM_LANG_CXX17_FLAG
+
340 # define GLM_NODISCARD [[nodiscard]]
+
341 #else
+
342 # define GLM_NODISCARD
+
343 #endif
+
344 
+
345 //
+
346 #if GLM_LANG & GLM_LANG_CXX11_FLAG
+
347 # define GLM_HAS_ASSIGNABLE 1
+
348 #else
+
349 # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
350  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
+
351  ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))))
+
352 #endif
+
353 
+
354 //
+
355 #define GLM_HAS_TRIVIAL_QUERIES 0
+
356 
+
357 //
+
358 #if GLM_LANG & GLM_LANG_CXX11_FLAG
+
359 # define GLM_HAS_MAKE_SIGNED 1
+
360 #else
+
361 # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
+
362  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
+
363  ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
+
364  ((GLM_COMPILER & GLM_COMPILER_HIP))))
+
365 #endif
+
366 
+
367 //
+
368 #if defined(GLM_FORCE_INTRINSICS)
+
369 # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
+
370  ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
+
371  ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT))))
+
372 #else
+
373 # define GLM_HAS_BITSCAN_WINDOWS 0
+
374 #endif
+
375 
+
376 #if GLM_LANG & GLM_LANG_CXX11_FLAG
+
377 # define GLM_HAS_NOEXCEPT 1
+
378 #else
+
379 # define GLM_HAS_NOEXCEPT 0
+
380 #endif
+
381 
+
382 #if GLM_HAS_NOEXCEPT
+
383 # define GLM_NOEXCEPT noexcept
+
384 #else
+
385 # define GLM_NOEXCEPT
+
386 #endif
+
387 
+
389 // OpenMP
+
390 #ifdef _OPENMP
+
391 # if GLM_COMPILER & GLM_COMPILER_GCC
+
392 # if GLM_COMPILER >= GLM_COMPILER_GCC61
+
393 # define GLM_HAS_OPENMP 45
+
394 # elif GLM_COMPILER >= GLM_COMPILER_GCC49
+
395 # define GLM_HAS_OPENMP 40
+
396 # elif GLM_COMPILER >= GLM_COMPILER_GCC47
+
397 # define GLM_HAS_OPENMP 31
+
398 # else
+
399 # define GLM_HAS_OPENMP 0
+
400 # endif
+
401 # elif GLM_COMPILER & GLM_COMPILER_CLANG
+
402 # if GLM_COMPILER >= GLM_COMPILER_CLANG38
+
403 # define GLM_HAS_OPENMP 31
+
404 # else
+
405 # define GLM_HAS_OPENMP 0
+
406 # endif
+
407 # elif GLM_COMPILER & GLM_COMPILER_VC
+
408 # define GLM_HAS_OPENMP 20
+
409 # elif GLM_COMPILER & GLM_COMPILER_INTEL
+
410 # if GLM_COMPILER >= GLM_COMPILER_INTEL16
+
411 # define GLM_HAS_OPENMP 40
+
412 # else
+
413 # define GLM_HAS_OPENMP 0
+
414 # endif
+
415 # else
+
416 # define GLM_HAS_OPENMP 0
+
417 # endif
+
418 #else
+
419 # define GLM_HAS_OPENMP 0
+
420 #endif
+
421 
+
423 // nullptr
+
424 
+
425 #if GLM_LANG & GLM_LANG_CXX0X_FLAG
+
426 # define GLM_CONFIG_NULLPTR GLM_ENABLE
+
427 #else
+
428 # define GLM_CONFIG_NULLPTR GLM_DISABLE
+
429 #endif
+
430 
+
431 #if GLM_CONFIG_NULLPTR == GLM_ENABLE
+
432 # define GLM_NULLPTR nullptr
+
433 #else
+
434 # define GLM_NULLPTR 0
+
435 #endif
+
436 
+
438 // Static assert
+
439 
+
440 #if GLM_HAS_STATIC_ASSERT
+
441 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
+
442 #elif GLM_COMPILER & GLM_COMPILER_VC
+
443 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
+
444 #else
+
445 # define GLM_STATIC_ASSERT(x, message) assert(x)
+
446 #endif//GLM_LANG
+
447 
+
449 // Qualifiers
+
450 
+
451 // User defines: GLM_CUDA_FORCE_DEVICE_FUNC, GLM_CUDA_FORCE_HOST_FUNC
+
452 
+
453 #if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
+
454 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
+
455 # error "GLM error: GLM_CUDA_FORCE_DEVICE_FUNC and GLM_CUDA_FORCE_HOST_FUNC should not be defined at the same time, GLM by default generates both device and host code for CUDA compiler."
+
456 # endif//defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
+
457 
+
458 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC)
+
459 # define GLM_CUDA_FUNC_DEF __device__
+
460 # define GLM_CUDA_FUNC_DECL __device__
+
461 # elif defined(GLM_CUDA_FORCE_HOST_FUNC)
+
462 # define GLM_CUDA_FUNC_DEF __host__
+
463 # define GLM_CUDA_FUNC_DECL __host__
+
464 # else
+
465 # define GLM_CUDA_FUNC_DEF __device__ __host__
+
466 # define GLM_CUDA_FUNC_DECL __device__ __host__
+
467 # endif//defined(GLM_CUDA_FORCE_XXXX_FUNC)
+
468 #else
+
469 # define GLM_CUDA_FUNC_DEF
+
470 # define GLM_CUDA_FUNC_DECL
+
471 #endif
+
472 
+
473 #if defined(GLM_FORCE_INLINE)
+
474 # if GLM_COMPILER & GLM_COMPILER_VC
+
475 # define GLM_INLINE __forceinline
+
476 # define GLM_NEVER_INLINE __declspec(noinline)
+
477 # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
+
478 # define GLM_INLINE inline __attribute__((__always_inline__))
+
479 # define GLM_NEVER_INLINE __attribute__((__noinline__))
+
480 # elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
+
481 # define GLM_INLINE __forceinline__
+
482 # define GLM_NEVER_INLINE __noinline__
+
483 # else
+
484 # define GLM_INLINE inline
+
485 # define GLM_NEVER_INLINE
+
486 # endif//GLM_COMPILER
+
487 #else
+
488 # define GLM_INLINE inline
+
489 # define GLM_NEVER_INLINE
+
490 #endif//defined(GLM_FORCE_INLINE)
+
491 
+
492 #define GLM_CTOR_DECL GLM_CUDA_FUNC_DECL GLM_CONSTEXPR
+
493 #define GLM_FUNC_DISCARD_DECL GLM_CUDA_FUNC_DECL
+
494 #define GLM_FUNC_DECL GLM_NODISCARD GLM_CUDA_FUNC_DECL
+
495 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
+
496 
+
497 // Do not use CUDA function qualifiers on CUDA compiler when functions are made default
+
498 #if GLM_HAS_DEFAULTED_FUNCTIONS
+
499 # define GLM_DEFAULTED_FUNC_DECL
+
500 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE
+
501 #else
+
502 # define GLM_DEFAULTED_FUNC_DECL GLM_FUNC_DISCARD_DECL
+
503 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_FUNC_QUALIFIER
+
504 #endif//GLM_HAS_DEFAULTED_FUNCTIONS
+
505 #if !defined(GLM_FORCE_CTOR_INIT)
+
506 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL
+
507 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_DEFAULTED_FUNC_QUALIFIER
+
508 #else
+
509 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_FUNC_DISCARD_DECL
+
510 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_FUNC_QUALIFIER
+
511 #endif//GLM_FORCE_CTOR_INIT
+
512 
+
514 // Swizzle operators
+
515 
+
516 // User defines: GLM_FORCE_SWIZZLE
+
517 
+
518 #define GLM_SWIZZLE_DISABLED 0
+
519 #define GLM_SWIZZLE_OPERATOR 1
+
520 #define GLM_SWIZZLE_FUNCTION 2
+
521 
+
522 #if defined(GLM_SWIZZLE)
+
523 # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.")
+
524 # define GLM_FORCE_SWIZZLE
+
525 #endif
+
526 
+
527 #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY)
+
528 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR
+
529 #elif defined(GLM_FORCE_SWIZZLE)
+
530 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
+
531 #else
+
532 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED
+
533 #endif
+
534 
+
536 // Allows using not basic types as genType
+
537 
+
538 // #define GLM_FORCE_UNRESTRICTED_GENTYPE
+
539 
+
540 #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE
+
541 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE
+
542 #else
+
543 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE
+
544 #endif
+
545 
+
547 // Allows using any scaler as float
+
548 
+
549 // #define GLM_FORCE_UNRESTRICTED_FLOAT
+
550 
+
551 #ifdef GLM_FORCE_UNRESTRICTED_FLOAT
+
552 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_ENABLE
+
553 #else
+
554 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_DISABLE
+
555 #endif
+
556 
+
558 // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM
+
559 // to use a clip space between 0 to 1.
+
560 // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM
+
561 // to use left handed coordinate system by default.
+
562 
+
563 #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE
+
564 #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE
+
565 #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan
+
566 #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM
+
567 
+
568 #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
+
569 #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT)
+
570 #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
+
571 #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT)
+
572 
+
573 #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE
+
574 # ifdef GLM_FORCE_LEFT_HANDED
+
575 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO
+
576 # else
+
577 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO
+
578 # endif
+
579 #else
+
580 # ifdef GLM_FORCE_LEFT_HANDED
+
581 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO
+
582 # else
+
583 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO
+
584 # endif
+
585 #endif
+
586 
+
588 // Qualifiers
+
589 
+
590 #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
+
591 # define GLM_DEPRECATED __declspec(deprecated)
+
592 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
+
593 #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
+
594 # if GLM_LANG & GLM_LANG_CXX14_FLAG
+
595 # define GLM_DEPRECATED [[deprecated]]
+
596 # else
+
597 # define GLM_DEPRECATED __attribute__((__deprecated__))
+
598 # endif
+
599 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
+
600 #elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
+
601 # define GLM_DEPRECATED
+
602 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
+
603 #else
+
604 # define GLM_DEPRECATED
+
605 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
+
606 #endif
+
607 
+
609 
+
610 #ifdef GLM_FORCE_EXPLICIT_CTOR
+
611 # define GLM_EXPLICIT explicit
+
612 #else
+
613 # define GLM_EXPLICIT
+
614 #endif
+
615 
+
617 // Length type: all length functions returns a length_t type.
+
618 // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
+
619 // length_t is a typedef of int like GLSL defines it.
+
620 
+
621 #define GLM_LENGTH_INT 1
+
622 #define GLM_LENGTH_SIZE_T 2
+
623 
+
624 #ifdef GLM_FORCE_SIZE_T_LENGTH
+
625 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T
+
626 # define GLM_ASSERT_LENGTH(l, max) (assert ((l) < (max)))
+
627 #else
+
628 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT
+
629 # define GLM_ASSERT_LENGTH(l, max) (assert ((l) >= 0 && (l) < (max)))
+
630 #endif
+
631 
+
632 namespace glm
+
633 {
+
634  using std::size_t;
+
635 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
+
636  typedef size_t length_t;
+
637 # else
+
638  typedef int length_t;
+
639 # endif
+
640 }//namespace glm
+
641 
+
643 // constexpr
+
644 
+
645 #if GLM_HAS_CONSTEXPR
+
646 # define GLM_CONFIG_CONSTEXP GLM_ENABLE
+
647 
+
648  namespace glm
+
649  {
+
650  template<typename T, std::size_t N>
+
651  constexpr std::size_t countof(T const (&)[N])
+
652  {
+
653  return N;
+
654  }
+
655  }//namespace glm
+
656 # define GLM_COUNTOF(arr) glm::countof(arr)
+
657 #elif defined(_MSC_VER)
+
658 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
+
659 
+
660 # define GLM_COUNTOF(arr) _countof(arr)
+
661 #else
+
662 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
+
663 
+
664 # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
+
665 #endif
+
666 
+
668 // uint
+
669 
+
670 namespace glm{
+
671 namespace detail
+
672 {
+
673  template<typename T>
+
674  struct is_int
+
675  {
+
676  enum test {value = 0};
+
677  };
+
678 
+
679  template<>
+
680  struct is_int<unsigned int>
+
681  {
+
682  enum test {value = ~0};
+
683  };
+
684 
+
685  template<>
+
686  struct is_int<signed int>
+
687  {
+
688  enum test {value = ~0};
+
689  };
+
690 }//namespace detail
+
691 
+
692  typedef unsigned int uint;
+
693 }//namespace glm
+
694 
+
696 // 64-bit int
+
697 
+
698 #if GLM_HAS_EXTENDED_INTEGER_TYPE
+
699 # include <cstdint>
+
700 #endif
+
701 
+
702 namespace glm{
+
703 namespace detail
+
704 {
+
705 # if GLM_HAS_EXTENDED_INTEGER_TYPE
+
706  typedef std::uint64_t uint64;
+
707  typedef std::int64_t int64;
+
708 # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
+
709  typedef uint64_t uint64;
+
710  typedef int64_t int64;
+
711 # elif GLM_COMPILER & GLM_COMPILER_VC
+
712  typedef unsigned __int64 uint64;
+
713  typedef signed __int64 int64;
+
714 # elif GLM_COMPILER & GLM_COMPILER_GCC
+
715 # pragma GCC diagnostic ignored "-Wlong-long"
+
716  __extension__ typedef unsigned long long uint64;
+
717  __extension__ typedef signed long long int64;
+
718 # elif (GLM_COMPILER & GLM_COMPILER_CLANG)
+
719 # pragma clang diagnostic ignored "-Wc++11-long-long"
+
720  typedef unsigned long long uint64;
+
721  typedef signed long long int64;
+
722 # else//unknown compiler
+
723  typedef unsigned long long uint64;
+
724  typedef signed long long int64;
+
725 # endif
+
726 }//namespace detail
+
727 }//namespace glm
+
728 
+
730 // make_unsigned
+
731 
+
732 #if GLM_HAS_MAKE_SIGNED
+
733 # include <type_traits>
+
734 
+
735 namespace glm{
+
736 namespace detail
+
737 {
+
738  using std::make_unsigned;
+
739 }//namespace detail
+
740 }//namespace glm
+
741 
+
742 #else
+
743 
+
744 namespace glm{
+
745 namespace detail
+
746 {
+
747  template<typename genType>
+
748  struct make_unsigned
+
749  {};
+
750 
+
751  template<>
+
752  struct make_unsigned<char>
+
753  {
+
754  typedef unsigned char type;
+
755  };
+
756 
+
757  template<>
+
758  struct make_unsigned<signed char>
+
759  {
+
760  typedef unsigned char type;
+
761  };
+
762 
+
763  template<>
+
764  struct make_unsigned<short>
+
765  {
+
766  typedef unsigned short type;
+
767  };
+
768 
+
769  template<>
+
770  struct make_unsigned<int>
+
771  {
+
772  typedef unsigned int type;
+
773  };
+
774 
+
775  template<>
+
776  struct make_unsigned<long>
+
777  {
+
778  typedef unsigned long type;
+
779  };
+
780 
+
781  template<>
+
782  struct make_unsigned<int64>
+
783  {
+
784  typedef uint64 type;
+
785  };
+
786 
+
787  template<>
+
788  struct make_unsigned<unsigned char>
+
789  {
+
790  typedef unsigned char type;
+
791  };
+
792 
+
793  template<>
+
794  struct make_unsigned<unsigned short>
+
795  {
+
796  typedef unsigned short type;
+
797  };
+
798 
+
799  template<>
+
800  struct make_unsigned<unsigned int>
+
801  {
+
802  typedef unsigned int type;
+
803  };
+
804 
+
805  template<>
+
806  struct make_unsigned<unsigned long>
+
807  {
+
808  typedef unsigned long type;
+
809  };
+
810 
+
811  template<>
+
812  struct make_unsigned<uint64>
+
813  {
+
814  typedef uint64 type;
+
815  };
+
816 }//namespace detail
+
817 }//namespace glm
+
818 #endif
+
819 
+
821 // Only use x, y, z, w as vector type components
+
822 
+
823 #ifdef GLM_FORCE_XYZW_ONLY
+
824 # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE
+
825 #else
+
826 # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE
+
827 #endif
+
828 
+
830 // Configure the use of defaulted initialized types
+
831 
+
832 #define GLM_CTOR_INIT_DISABLE 0
+
833 #define GLM_CTOR_INITIALIZER_LIST 1
+
834 #define GLM_CTOR_INITIALISATION 2
+
835 
+
836 #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+
837 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
+
838 #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+
839 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION
+
840 #else
+
841 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
+
842 #endif
+
843 
+
845 // Use SIMD instruction sets
+
846 
+
847 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
+
848 # define GLM_CONFIG_SIMD GLM_ENABLE
+
849 #else
+
850 # define GLM_CONFIG_SIMD GLM_DISABLE
+
851 #endif
+
852 
+
854 // Configure the use of defaulted function
+
855 
+
856 #if GLM_HAS_DEFAULTED_FUNCTIONS
+
857 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE
+
858 # define GLM_DEFAULT = default
+
859 #else
+
860 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE
+
861 # define GLM_DEFAULT
+
862 #endif
+
863 
+
864 #if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
+
865 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE
+
866 # define GLM_DEFAULT_CTOR GLM_DEFAULT
+
867 #else
+
868 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE
+
869 # define GLM_DEFAULT_CTOR
+
870 #endif
+
871 
+
873 // Configure the use of aligned gentypes
+
874 
+
875 #ifdef GLM_FORCE_ALIGNED // Legacy define
+
876 # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+
877 #endif
+
878 
+
879 #ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+
880 # define GLM_FORCE_ALIGNED_GENTYPES
+
881 #endif
+
882 
+
883 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE))
+
884 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE
+
885 #else
+
886 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE
+
887 #endif
+
888 
+
890 // Configure the use of anonymous structure as implementation detail
+
891 
+
892 #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE))
+
893 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE
+
894 #else
+
895 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE
+
896 #endif
+
897 
+
899 // Silent warnings
+
900 
+
901 #ifdef GLM_FORCE_WARNINGS
+
902 # define GLM_SILENT_WARNINGS GLM_DISABLE
+
903 #else
+
904 # define GLM_SILENT_WARNINGS GLM_ENABLE
+
905 #endif
+
906 
+
908 // Precision
+
909 
+
910 #define GLM_HIGHP 1
+
911 #define GLM_MEDIUMP 2
+
912 #define GLM_LOWP 3
+
913 
+
914 #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL)
+
915 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
+
916 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL)
+
917 # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP
+
918 #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL)
+
919 # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP
+
920 #else
+
921 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
+
922 #endif
+
923 
+
924 #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT)
+
925 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
+
926 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT)
+
927 # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP
+
928 #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT)
+
929 # define GLM_CONFIG_PRECISION_INT GLM_LOWP
+
930 #else
+
931 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
+
932 #endif
+
933 
+
934 #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT)
+
935 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
+
936 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT)
+
937 # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP
+
938 #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT)
+
939 # define GLM_CONFIG_PRECISION_UINT GLM_LOWP
+
940 #else
+
941 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
+
942 #endif
+
943 
+
944 #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT)
+
945 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
+
946 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT)
+
947 # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP
+
948 #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT)
+
949 # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP
+
950 #else
+
951 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
+
952 #endif
+
953 
+
954 #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE)
+
955 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
+
956 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE)
+
957 # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP
+
958 #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE)
+
959 # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP
+
960 #else
+
961 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
+
962 #endif
+
963 
+
965 // Check inclusions of different versions of GLM
+
966 
+
967 #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
+
968 # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
+
969 #elif GLM_SETUP_INCLUDED == GLM_VERSION
+
970 
+
972 // Messages
+
973 
+
974 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED)
+
975 # define GLM_MESSAGE_DISPLAYED
+
976 # define GLM_STR_HELPER(x) #x
+
977 # define GLM_STR(x) GLM_STR_HELPER(x)
+
978 
+
979  // Report GLM version
+
980 # pragma message ("GLM: version " GLM_STR(GLM_VERSION_MAJOR) "." GLM_STR(GLM_VERSION_MINOR) "." GLM_STR(GLM_VERSION_PATCH))
+
981 
+
982  // Report C++ language
+
983 # if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
984 # pragma message("GLM: C++ 20 with extensions")
+
985 # elif (GLM_LANG & GLM_LANG_CXX20_FLAG)
+
986 # pragma message("GLM: C++ 2A")
+
987 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
988 # pragma message("GLM: C++ 17 with extensions")
+
989 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
+
990 # pragma message("GLM: C++ 17")
+
991 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
992 # pragma message("GLM: C++ 14 with extensions")
+
993 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
+
994 # pragma message("GLM: C++ 14")
+
995 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
996 # pragma message("GLM: C++ 11 with extensions")
+
997 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG)
+
998 # pragma message("GLM: C++ 11")
+
999 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
1000 # pragma message("GLM: C++ 0x with extensions")
+
1001 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG)
+
1002 # pragma message("GLM: C++ 0x")
+
1003 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
1004 # pragma message("GLM: C++ 03 with extensions")
+
1005 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG)
+
1006 # pragma message("GLM: C++ 03")
+
1007 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT)
+
1008 # pragma message("GLM: C++ 98 with extensions")
+
1009 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG)
+
1010 # pragma message("GLM: C++ 98")
+
1011 # else
+
1012 # pragma message("GLM: C++ language undetected")
+
1013 # endif//GLM_LANG
+
1014 
+
1015  // Report compiler detection
+
1016 # if GLM_COMPILER & GLM_COMPILER_CUDA
+
1017 # pragma message("GLM: CUDA compiler detected")
+
1018 # elif GLM_COMPILER & GLM_COMPILER_HIP
+
1019 # pragma message("GLM: HIP compiler detected")
+
1020 # elif GLM_COMPILER & GLM_COMPILER_VC
+
1021 # pragma message("GLM: Visual C++ compiler detected")
+
1022 # elif GLM_COMPILER & GLM_COMPILER_CLANG
+
1023 # pragma message("GLM: Clang compiler detected")
+
1024 # elif GLM_COMPILER & GLM_COMPILER_INTEL
+
1025 # pragma message("GLM: Intel Compiler detected")
+
1026 # elif GLM_COMPILER & GLM_COMPILER_GCC
+
1027 # pragma message("GLM: GCC compiler detected")
+
1028 # else
+
1029 # pragma message("GLM: Compiler not detected")
+
1030 # endif
+
1031 
+
1032  // Report build target
+
1033 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1034 # pragma message("GLM: x86 64 bits with AVX2 instruction set build target")
+
1035 # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1036 # pragma message("GLM: x86 32 bits with AVX2 instruction set build target")
+
1037 
+
1038 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1039 # pragma message("GLM: x86 64 bits with AVX instruction set build target")
+
1040 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1041 # pragma message("GLM: x86 32 bits with AVX instruction set build target")
+
1042 
+
1043 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1044 # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target")
+
1045 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1046 # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target")
+
1047 
+
1048 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1049 # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target")
+
1050 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1051 # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target")
+
1052 
+
1053 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1054 # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target")
+
1055 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1056 # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target")
+
1057 
+
1058 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1059 # pragma message("GLM: x86 64 bits with SSE3 instruction set build target")
+
1060 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1061 # pragma message("GLM: x86 32 bits with SSE3 instruction set build target")
+
1062 
+
1063 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1064 # pragma message("GLM: x86 64 bits with SSE2 instruction set build target")
+
1065 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1066 # pragma message("GLM: x86 32 bits with SSE2 instruction set build target")
+
1067 
+
1068 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1069 # pragma message("GLM: x86 64 bits build target")
+
1070 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1071 # pragma message("GLM: x86 32 bits build target")
+
1072 
+
1073 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1074 # pragma message("GLM: ARM 64 bits with Neon instruction set build target")
+
1075 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1076 # pragma message("GLM: ARM 32 bits with Neon instruction set build target")
+
1077 
+
1078 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1079 # pragma message("GLM: ARM 64 bits build target")
+
1080 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1081 # pragma message("GLM: ARM 32 bits build target")
+
1082 
+
1083 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1084 # pragma message("GLM: MIPS 64 bits build target")
+
1085 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1086 # pragma message("GLM: MIPS 32 bits build target")
+
1087 
+
1088 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64)
+
1089 # pragma message("GLM: PowerPC 64 bits build target")
+
1090 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32)
+
1091 # pragma message("GLM: PowerPC 32 bits build target")
+
1092 # else
+
1093 # pragma message("GLM: Unknown build target")
+
1094 # endif//GLM_ARCH
+
1095 
+
1096  // Report platform name
+
1097 # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
+
1098 # pragma message("GLM: QNX platform detected")
+
1099 //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
+
1100 //# pragma message("GLM: iOS platform detected")
+
1101 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
+
1102 # pragma message("GLM: Apple platform detected")
+
1103 # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
+
1104 # pragma message("GLM: WinCE platform detected")
+
1105 # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
+
1106 # pragma message("GLM: Windows platform detected")
+
1107 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
+
1108 # pragma message("GLM: Native Client detected")
+
1109 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
+
1110 # pragma message("GLM: Android platform detected")
+
1111 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
+
1112 # pragma message("GLM: Linux platform detected")
+
1113 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
+
1114 # pragma message("GLM: UNIX platform detected")
+
1115 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
+
1116 # pragma message("GLM: platform unknown")
+
1117 # else
+
1118 # pragma message("GLM: platform not detected")
+
1119 # endif
+
1120 
+
1121  // Report whether only xyzw component are used
+
1122 # if defined GLM_FORCE_XYZW_ONLY
+
1123 # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.")
+
1124 # endif
+
1125 
+
1126  // Report swizzle operator support
+
1127 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
+
1128 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.")
+
1129 # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
+
1130 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.")
+
1131 # else
+
1132 # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.")
+
1133 # endif
+
1134 
+
1135  // Report .length() type
+
1136 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
+
1137 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.")
+
1138 # else
+
1139 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.")
+
1140 # endif
+
1141 
+
1142 # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE
+
1143 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.")
+
1144 # else
+
1145 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.")
+
1146 # endif
+
1147 
+
1148 # if GLM_SILENT_WARNINGS == GLM_ENABLE
+
1149 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.")
+
1150 # else
+
1151 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.")
+
1152 # endif
+
1153 
+
1154 # ifdef GLM_FORCE_SINGLE_ONLY
+
1155 # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.")
+
1156 # endif
+
1157 
+
1158 # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)
+
1159 # undef GLM_FORCE_ALIGNED_GENTYPES
+
1160 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.")
+
1161 # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE)
+
1162 # undef GLM_FORCE_ALIGNED_GENTYPES
+
1163 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
+
1164 # endif
+
1165 
+
1166 # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
+
1167 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE
+
1168 # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
+
1169 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
+
1170 # elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+
1171 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.")
+
1172 # endif
+
1173 # endif
+
1174 
+
1175 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
+
1176 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.")
+
1177 # else
+
1178 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.")
+
1179 # endif
+
1180 
+
1181 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
+
1182 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.")
+
1183 # else
+
1184 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.")
+
1185 # endif
+
1186 #endif//GLM_MESSAGES
+
1187 
+
1188 #endif//GLM_SETUP_INCLUDED
-
detail::int64 int64
64 bit signed integer type.
+
uint64 uint64_t
Default qualifier 64 bit unsigned integer type.
Definition: fwd.hpp:145
+
detail::uint64 uint64
64 bit unsigned integer type.
+
int64 int64_t
64 bit signed integer type.
Definition: fwd.hpp:85
+
detail::int64 int64
64 bit signed integer type.
1 #pragma once
2 
3 #include "setup.hpp"
4 
-
5 namespace glm{
-
6 namespace detail
-
7 {
-
8  typedef short hdata;
+
5 #if GLM_COMPILER == GLM_COMPILER_VC12
+
6 # pragma warning(push)
+
7 # pragma warning(disable: 4512) // assignment operator could not be generated
+
8 #endif
9 
-
10  GLM_FUNC_DECL float toFloat32(hdata value);
-
11  GLM_FUNC_DECL hdata toFloat16(float const& value);
-
12 
-
13 }//namespace detail
-
14 }//namespace glm
-
15 
-
16 #include "type_half.inl"
+
10 namespace glm{
+
11 namespace detail
+
12 {
+
13  template <typename T>
+
14  union float_t
+
15  {};
+
16 
+
17  // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
+
18  template <>
+
19  union float_t<float>
+
20  {
+
21  typedef int int_type;
+
22  typedef float float_type;
+
23 
+
24  GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {}
+
25 
+
26  GLM_CONSTEXPR float_t& operator=(float_t const& x)
+
27  {
+
28  f = x.f;
+
29  return *this;
+
30  }
+
31 
+
32  // Portable extraction of components.
+
33  GLM_CONSTEXPR bool negative() const { return i < 0; }
+
34  GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); }
+
35  GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); }
+
36 
+
37  int_type i;
+
38  float_type f;
+
39  };
+
40 
+
41  template <>
+
42  union float_t<double>
+
43  {
+
44  typedef detail::int64 int_type;
+
45  typedef double float_type;
+
46 
+
47  GLM_CONSTEXPR float_t(float_type Num = static_cast<float_type>(0)) : f(Num) {}
+
48 
+
49  GLM_CONSTEXPR float_t& operator=(float_t const& x)
+
50  {
+
51  f = x.f;
+
52  return *this;
+
53  }
+
54 
+
55  // Portable extraction of components.
+
56  GLM_CONSTEXPR bool negative() const { return i < 0; }
+
57  GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); }
+
58  GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); }
+
59 
+
60  int_type i;
+
61  float_type f;
+
62  };
+
63 }//namespace detail
+
64 }//namespace glm
+
65 
+
66 #if GLM_COMPILER == GLM_COMPILER_VC12
+
67 # pragma warning(pop)
+
68 #endif
+
detail::int64 int64
64 bit signed integer type.
-Go to the documentation of this file.
1 
-
4 #pragma once
-
5 
-
6 #include "type_vec2.hpp"
-
7 #include <limits>
-
8 #include <cstddef>
+
1 #pragma once
+
2 
+
3 #include "setup.hpp"
+
4 
+
5 namespace glm{
+
6 namespace detail
+
7 {
+
8  typedef short hdata;
9 
-
10 namespace glm
-
11 {
-
12  template<typename T, qualifier Q>
-
13  struct mat<2, 2, T, Q>
-
14  {
-
15  typedef vec<2, T, Q> col_type;
-
16  typedef vec<2, T, Q> row_type;
-
17  typedef mat<2, 2, T, Q> type;
-
18  typedef mat<2, 2, T, Q> transpose_type;
-
19  typedef T value_type;
-
20 
-
21  private:
-
22  col_type value[2];
-
23 
-
24  public:
-
25  // -- Accesses --
-
26 
-
27  typedef length_t length_type;
-
28  GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
-
29 
-
30  GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT;
-
31  GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT;
-
32 
-
33  // -- Constructors --
-
34 
-
35  GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR;
-
36  template<qualifier P>
-
37  GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m);
-
38 
-
39  GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar);
-
40  GLM_FUNC_DECL GLM_CONSTEXPR mat(
-
41  T const& x1, T const& y1,
-
42  T const& x2, T const& y2);
-
43  GLM_FUNC_DECL GLM_CONSTEXPR mat(
-
44  col_type const& v1,
-
45  col_type const& v2);
-
46 
-
47  // -- Conversions --
-
48 
-
49  template<typename U, typename V, typename M, typename N>
-
50  GLM_FUNC_DECL GLM_CONSTEXPR mat(
-
51  U const& x1, V const& y1,
-
52  M const& x2, N const& y2);
-
53 
-
54  template<typename U, typename V>
-
55  GLM_FUNC_DECL GLM_CONSTEXPR mat(
-
56  vec<2, U, Q> const& v1,
-
57  vec<2, V, Q> const& v2);
-
58 
-
59  // -- Matrix conversions --
-
60 
-
61  template<typename U, qualifier P>
-
62  GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m);
-
63 
-
64  GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x);
-
65  GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x);
-
66  GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x);
-
67  GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, 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<4, 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, 3, T, Q> const& x);
-
72 
-
73  // -- Unary arithmetic operators --
-
74 
-
75  template<typename U>
-
76  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m);
-
77  template<typename U>
-
78  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s);
-
79  template<typename U>
-
80  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m);
-
81  template<typename U>
-
82  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s);
-
83  template<typename U>
-
84  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m);
-
85  template<typename U>
-
86  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s);
-
87  template<typename U>
-
88  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m);
-
89  template<typename U>
-
90  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s);
-
91  template<typename U>
-
92  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m);
-
93 
-
94  // -- Increment and decrement operators --
-
95 
-
96  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator++ ();
-
97  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-- ();
-
98  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator++(int);
-
99  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator--(int);
-
100  };
-
101 
-
102  // -- Unary operators --
-
103 
-
104  template<typename T, qualifier Q>
-
105  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m);
-
106 
-
107  template<typename T, qualifier Q>
-
108  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m);
-
109 
-
110  // -- Binary operators --
-
111 
-
112  template<typename T, qualifier Q>
-
113  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar);
-
114 
-
115  template<typename T, qualifier Q>
-
116  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m);
-
117 
-
118  template<typename T, qualifier Q>
-
119  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
120 
-
121  template<typename T, qualifier Q>
-
122  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar);
-
123 
-
124  template<typename T, qualifier Q>
-
125  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m);
-
126 
-
127  template<typename T, qualifier Q>
-
128  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
129 
-
130  template<typename T, qualifier Q>
-
131  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar);
-
132 
-
133  template<typename T, qualifier Q>
-
134  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m);
-
135 
-
136  template<typename T, qualifier Q>
-
137  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
-
138 
-
139  template<typename T, qualifier Q>
-
140  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
-
141 
-
142  template<typename T, qualifier Q>
-
143  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
144 
-
145  template<typename T, qualifier Q>
-
146  GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
-
147 
-
148  template<typename T, qualifier Q>
-
149  GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
-
150 
-
151  template<typename T, qualifier Q>
-
152  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar);
-
153 
-
154  template<typename T, qualifier Q>
-
155  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m);
-
156 
-
157  template<typename T, qualifier Q>
-
158  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
-
159 
-
160  template<typename T, qualifier Q>
-
161  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
-
162 
-
163  template<typename T, qualifier Q>
-
164  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
165 
-
166  // -- Boolean operators --
-
167 
-
168  template<typename T, qualifier Q>
-
169  GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
170 
-
171  template<typename T, qualifier Q>
-
172  GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
-
173 } //namespace glm
-
174 
-
175 #ifndef GLM_EXTERNAL_TEMPLATE
-
176 #include "type_mat2x2.inl"
-
177 #endif
+
10  GLM_FUNC_DECL float toFloat32(hdata value);
+
11  GLM_FUNC_DECL hdata toFloat16(float const& value);
+
12 
+
13 }//namespace detail
+
14 }//namespace glm
+
15 
+
16 #include "type_half.inl"
-
Core features
-
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.
-

Core features +

Core features More...

Go to the source code of this file.

Detailed Description

-

Core features

+

Core features

-

Definition in file type_mat2x3.hpp.

+

Definition in file type_mat2x2.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);
+
6 #include "type_vec2.hpp"
+
7 #include <limits>
+
8 #include <cstddef>
+
9 
+
10 namespace glm
+
11 {
+
12  template<typename T, qualifier Q>
+
13  struct mat<2, 2, T, Q>
+
14  {
+
15  typedef vec<2, T, Q> col_type;
+
16  typedef vec<2, T, Q> row_type;
+
17  typedef mat<2, 2, T, Q> type;
+
18  typedef mat<2, 2, T, Q> transpose_type;
+
19  typedef T value_type;
+
20 
+
21  private:
+
22  col_type value[2];
+
23 
+
24  public:
+
25  // -- Accesses --
+
26 
+
27  typedef length_t length_type;
+
28  GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
+
29 
+
30  GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT;
+
31  GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT;
+
32 
+
33  // -- Constructors --
+
34 
+
35  GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR;
+
36  template<qualifier P>
+
37  GLM_CTOR_DECL mat(mat<2, 2, T, P> const& m);
+
38 
+
39  GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar);
+
40  GLM_CTOR_DECL mat(
+
41  T const& x1, T const& y1,
+
42  T const& x2, T const& y2);
+
43  GLM_CTOR_DECL mat(
+
44  col_type const& v1,
+
45  col_type const& v2);
+
46 
+
47  // -- Conversions --
+
48 
+
49  template<typename U, typename V, typename M, typename N>
+
50  GLM_CTOR_DECL mat(
+
51  U const& x1, V const& y1,
+
52  M const& x2, N const& y2);
+
53 
+
54  template<typename U, typename V>
+
55  GLM_CTOR_DECL mat(
+
56  vec<2, U, Q> const& v1,
+
57  vec<2, V, Q> const& v2);
+
58 
+
59  // -- Matrix conversions --
+
60 
+
61  template<typename U, qualifier P>
+
62  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, U, P> const& m);
+
63 
+
64  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
+
65  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
+
66  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
+
67  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
+
68  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
+
69  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
+
70  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
+
71  GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
+
72 
+
73  // -- Unary arithmetic operators --
+
74 
+
75  template<typename U>
+
76  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m);
+
77  template<typename U>
+
78  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s);
+
79  template<typename U>
+
80  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m);
+
81  template<typename U>
+
82  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s);
+
83  template<typename U>
+
84  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m);
+
85  template<typename U>
+
86  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s);
+
87  template<typename U>
+
88  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m);
+
89  template<typename U>
+
90  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s);
+
91  template<typename U>
+
92  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m);
+
93 
+
94  // -- Increment and decrement operators --
+
95 
+
96  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator++ ();
+
97  GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-- ();
+
98  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator++(int);
+
99  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator--(int);
+
100  };
+
101 
+
102  // -- Unary operators --
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);
+
105  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, 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);
+
107  template<typename T, qualifier Q>
+
108  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m);
+
109 
+
110  // -- Binary operators --
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);
+
113  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar);
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);
+
116  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m);
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);
+
119  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, 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);
+
122  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, 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);
+
125  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, 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);
+
128  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
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);
+
131  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar);
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);
+
134  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m);
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);
+
137  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
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);
+
140  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
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);
+
143  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
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);
+
146  GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
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
+
148  template<typename T, qualifier Q>
+
149  GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
+
150 
+
151  template<typename T, qualifier Q>
+
152  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar);
+
153 
+
154  template<typename T, qualifier Q>
+
155  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m);
156 
-
157 #ifndef GLM_EXTERNAL_TEMPLATE
-
158 #include "type_mat2x3.inl"
-
159 #endif
+
157  template<typename T, qualifier Q>
+
158  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
+
159 
+
160  template<typename T, qualifier Q>
+
161  GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
+
162 
+
163  template<typename T, qualifier Q>
+
164  GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
+
165 
+
166  // -- Boolean operators --
+
167 
+
168  template<typename T, qualifier Q>
+
169  GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
+
170 
+
171  template<typename T, qualifier Q>
+
172  GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
+
173 } //namespace glm
+
174 
+
175 #ifndef GLM_EXTERNAL_TEMPLATE
+
176 #include "type_mat2x2.inl"
+
177 #endif
-
Core features
-
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.
-
Core features
+
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.
+
Core features