Added all precision types for GTC_type_precision

master
Christophe Riccio ago%!(EXTRA string=12 years)
parent 296e3d7007
commit d4043ea49a
  1. 22
      glm/core/func_packing.hpp
  2. 36
      glm/core/func_packing.inl
  3. 10
      glm/core/precision.hpp
  4. 14
      glm/core/type_mat2x2.hpp
  5. 90
      glm/core/type_mat2x2.inl
  6. 4
      glm/core/type_mat2x3.hpp
  7. 4
      glm/core/type_mat2x3.inl
  8. 28
      glm/core/type_mat2x4.hpp
  9. 4
      glm/core/type_mat2x4.inl
  10. 4
      glm/core/type_mat3x2.hpp
  11. 4
      glm/core/type_mat3x2.inl
  12. 4
      glm/core/type_mat3x3.hpp
  13. 4
      glm/core/type_mat3x3.inl
  14. 4
      glm/core/type_mat3x4.hpp
  15. 6
      glm/core/type_mat3x4.inl
  16. 4
      glm/core/type_mat4x2.hpp
  17. 4
      glm/core/type_mat4x2.inl
  18. 6
      glm/core/type_mat4x3.hpp
  19. 6
      glm/core/type_mat4x3.inl
  20. 4
      glm/core/type_mat4x4.hpp
  21. 4
      glm/core/type_mat4x4.inl
  22. 19
      glm/core/type_vec1.hpp
  23. 21
      glm/core/type_vec1.inl
  24. 16
      glm/core/type_vec2.hpp
  25. 12
      glm/core/type_vec2.inl
  26. 20
      glm/core/type_vec3.hpp
  27. 28
      glm/core/type_vec3.inl
  28. 44
      glm/core/type_vec4.hpp
  29. 30
      glm/core/type_vec4.inl
  30. 2859
      glm/fwd.hpp
  31. 578
      glm/gtc/type_precision.hpp
  32. 4
      glm/gtx/dual_quaternion.hpp
  33. 12
      test/core/core_func_packing.cpp
  34. 582
      test/gtc/gtc_type_precision.cpp
  35. 21
      test/gtx/gtx_dual_quaternion.cpp

@ -52,7 +52,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint32 packUnorm2x16(detail::tvec2<float32, defaultp> const & v); uint32 packUnorm2x16(vec2 const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer. //! Then, the results are packed into the returned 32-bit unsigned integer.
@ -65,7 +65,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint32 packSnorm2x16(detail::tvec2<float32, defaultp> const & v); uint32 packSnorm2x16(vec2 const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer. //! Then, the results are packed into the returned 32-bit unsigned integer.
@ -78,7 +78,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint32 packUnorm4x8(detail::tvec4<float32, defaultp> const & v); uint32 packUnorm4x8(vec4 const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer. //! Then, the results are packed into the returned 32-bit unsigned integer.
@ -91,7 +91,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint32 packSnorm4x8(detail::tvec4<float32, defaultp> const & v); uint32 packSnorm4x8(vec4 const & v);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -104,7 +104,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<float32, defaultp> unpackUnorm2x16(uint32 const & p); vec2 unpackUnorm2x16(uint32 const & p);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -117,7 +117,7 @@ namespace glm
//! //!
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<float32, defaultp> unpackSnorm2x16(uint32 const & p); vec2 unpackSnorm2x16(uint32 const & p);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -130,7 +130,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec4<float32, defaultp> unpackUnorm4x8(uint32 const & p); vec4 unpackUnorm4x8(uint32 const & p);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -143,7 +143,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec4<float32, defaultp> unpackSnorm4x8(uint32 const & p); vec4 unpackSnorm4x8(uint32 const & p);
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value. /// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
@ -153,7 +153,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
double packDouble2x32(detail::tvec2<uint32, defaultp> const & v); double packDouble2x32(uvec2 const & v);
/// Returns a two-component unsigned integer vector representation of v. /// Returns a two-component unsigned integer vector representation of v.
/// The bit-level representation of v is preserved. /// The bit-level representation of v is preserved.
@ -162,7 +162,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
detail::tvec2<uint32, defaultp> unpackDouble2x32(double const & v); uvec2 unpackDouble2x32(double const & v);
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification, /// to the 16-bit floating-point representation found in the OpenGL Specification,
@ -172,7 +172,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
uint packHalf2x16(detail::tvec2<float32, defaultp> const & v); uint packHalf2x16(vec2 const & v);
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,

@ -28,24 +28,24 @@
namespace glm namespace glm
{ {
GLM_FUNC_QUALIFIER uint32 packUnorm2x16(detail::tvec2<float32, defaultp> const & v) GLM_FUNC_QUALIFIER uint32 packUnorm2x16(vec2 const & v)
{ {
uint16 A(uint16(round(clamp(v.x, 0.0f, 1.0f) * 65535.0f))); uint16 A(uint16(round(clamp(v.x, 0.0f, 1.0f) * 65535.0f)));
uint16 B(uint16(round(clamp(v.y, 0.0f, 1.0f) * 65535.0f))); uint16 B(uint16(round(clamp(v.y, 0.0f, 1.0f) * 65535.0f)));
return uint32((B << 16) | A); return uint32((B << 16) | A);
} }
GLM_FUNC_QUALIFIER detail::tvec2<float32, defaultp> unpackUnorm2x16(uint32 const & p) GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint32 const & p)
{ {
uint32 Mask16((1 << 16) - 1); uint32 Mask16((1 << 16) - 1);
uint32 A((p >> 0) & Mask16); uint32 A((p >> 0) & Mask16);
uint32 B((p >> 16) & Mask16); uint32 B((p >> 16) & Mask16);
return detail::tvec2<float32, defaultp>( return vec2(
A * 1.0f / 65535.0f, A * 1.0f / 65535.0f,
B * 1.0f / 65535.0f); B * 1.0f / 65535.0f);
} }
GLM_FUNC_QUALIFIER uint32 packSnorm2x16(detail::tvec2<float32, defaultp> const & v) GLM_FUNC_QUALIFIER uint32 packSnorm2x16(vec2 const & v)
{ {
union iu union iu
{ {
@ -53,14 +53,14 @@ namespace glm
uint16 u; uint16 u;
} A, B; } A, B;
detail::tvec2<float32, defaultp> Unpack = clamp(v ,-1.0f, 1.0f) * 32767.0f; vec2 Unpack = clamp(v ,-1.0f, 1.0f) * 32767.0f;
A.i = detail::int16(round(Unpack.x)); A.i = detail::int16(round(Unpack.x));
B.i = detail::int16(round(Unpack.y)); B.i = detail::int16(round(Unpack.y));
uint32 Pack = (uint32(B.u) << 16) | (uint32(A.u) << 0); uint32 Pack = (uint32(B.u) << 16) | (uint32(A.u) << 0);
return Pack; return Pack;
} }
GLM_FUNC_QUALIFIER detail::tvec2<float32, defaultp> unpackSnorm2x16(uint32 const & p) GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint32 const & p)
{ {
union iu union iu
{ {
@ -71,12 +71,12 @@ namespace glm
uint32 Mask16((1 << 16) - 1); uint32 Mask16((1 << 16) - 1);
A.u = uint16((p >> 0) & Mask16); A.u = uint16((p >> 0) & Mask16);
B.u = uint16((p >> 16) & Mask16); B.u = uint16((p >> 16) & Mask16);
detail::tvec2<float32, defaultp> Pack(A.i, B.i); glm::vec2 Pack(A.i, B.i);
return clamp(Pack * 1.0f / 32767.0f, -1.0f, 1.0f); return clamp(Pack * 1.0f / 32767.0f, -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint32 packUnorm4x8(detail::tvec4<float32, defaultp> const & v) GLM_FUNC_QUALIFIER uint32 packUnorm4x8(vec4 const & v)
{ {
uint8 A((uint8)round(clamp(v.x, 0.0f, 1.0f) * 255.0f)); uint8 A((uint8)round(clamp(v.x, 0.0f, 1.0f) * 255.0f));
uint8 B((uint8)round(clamp(v.y, 0.0f, 1.0f) * 255.0f)); uint8 B((uint8)round(clamp(v.y, 0.0f, 1.0f) * 255.0f));
@ -85,21 +85,21 @@ namespace glm
return uint32((D << 24) | (C << 16) | (B << 8) | A); return uint32((D << 24) | (C << 16) | (B << 8) | A);
} }
GLM_FUNC_QUALIFIER detail::tvec4<float32, defaultp> unpackUnorm4x8(uint32 const & p) GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint32 const & p)
{ {
uint32 Mask8((1 << 8) - 1); uint32 Mask8((1 << 8) - 1);
uint32 A((p >> 0) & Mask8); uint32 A((p >> 0) & Mask8);
uint32 B((p >> 8) & Mask8); uint32 B((p >> 8) & Mask8);
uint32 C((p >> 16) & Mask8); uint32 C((p >> 16) & Mask8);
uint32 D((p >> 24) & Mask8); uint32 D((p >> 24) & Mask8);
return detail::tvec4<float32, defaultp>( return glm::vec4(
A * 1.0f / 255.0f, A * 1.0f / 255.0f,
B * 1.0f / 255.0f, B * 1.0f / 255.0f,
C * 1.0f / 255.0f, C * 1.0f / 255.0f,
D * 1.0f / 255.0f); D * 1.0f / 255.0f);
} }
GLM_FUNC_QUALIFIER uint32 packSnorm4x8(detail::tvec4<float32, defaultp> const & v) GLM_FUNC_QUALIFIER uint32 packSnorm4x8(vec4 const & v)
{ {
union iu union iu
{ {
@ -107,7 +107,7 @@ namespace glm
uint8 u; uint8 u;
} A, B, C, D; } A, B, C, D;
detail::tvec4<float32, defaultp> Unpack = clamp(v ,-1.0f, 1.0f) * 127.0f; glm::vec4 Unpack = clamp(v ,-1.0f, 1.0f) * 127.0f;
A.i = int8(round(Unpack.x)); A.i = int8(round(Unpack.x));
B.i = int8(round(Unpack.y)); B.i = int8(round(Unpack.y));
C.i = int8(round(Unpack.z)); C.i = int8(round(Unpack.z));
@ -116,7 +116,7 @@ namespace glm
return Pack; return Pack;
} }
GLM_FUNC_QUALIFIER detail::tvec4<float32, defaultp> unpackSnorm4x8(uint32 const & p) GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint32 const & p)
{ {
union iu union iu
{ {
@ -129,12 +129,12 @@ namespace glm
B.u = uint8((p >> 8) & Mask8); B.u = uint8((p >> 8) & Mask8);
C.u = uint8((p >> 16) & Mask8); C.u = uint8((p >> 16) & Mask8);
D.u = uint8((p >> 24) & Mask8); D.u = uint8((p >> 24) & Mask8);
detail::tvec4<float32, defaultp> Pack(A.i, B.i, C.i, D.i); glm::vec4 Pack(A.i, B.i, C.i, D.i);
return clamp(Pack * 1.0f / 127.0f, -1.0f, 1.0f); return clamp(Pack * 1.0f / 127.0f, -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2<uint32, defaultp> const & v) GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v)
{ {
struct uint32_pair struct uint32_pair
{ {
@ -155,7 +155,7 @@ namespace glm
//return *(double*)&v; //return *(double*)&v;
} }
GLM_FUNC_QUALIFIER detail::tvec2<uint, defaultp> unpackDouble2x32(double const & v) GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double const & v)
{ {
struct uint32_pair struct uint32_pair
{ {
@ -171,10 +171,10 @@ namespace glm
Helper.input = v; Helper.input = v;
return detail::tvec2<uint, defaultp>(Helper.output.x, Helper.output.y); return uvec2(Helper.output.x, Helper.output.y);
} }
GLM_FUNC_QUALIFIER uint packHalf2x16(detail::tvec2<float, defaultp> const & v) GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v)
{ {
union helper union helper
{ {

@ -39,16 +39,6 @@ namespace glm
}; };
}//namespace glm }//namespace glm
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
#define defaultp mediump
#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
#define defaultp highp #define defaultp highp
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
#define defaultp mediump
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
#define defaultp lowp
#else
# error "GLM error: multiple default precision requested for signed interger types"
#endif
#endif//GLM_CORE_PRECISION_INCLUDED #endif//GLM_CORE_PRECISION_INCLUDED

@ -73,10 +73,10 @@ namespace detail
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
value_type const & x); value_type const & x);
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
value_type const & x1, value_type const & y1, value_type const & x1, value_type const & y1,
value_type const & x2, value_type const & y2); value_type const & x2, value_type const & y2);
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
col_type const & v1, col_type const & v1,
col_type const & v2); col_type const & v2);
////////////////////////////////////// //////////////////////////////////////
@ -85,20 +85,20 @@ namespace detail
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
U const & x); U const & x);
template <typename U, typename V, typename M, typename N> template <typename U, typename V, typename M, typename N>
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
U const & x1, V const & y1, U const & x1, V const & y1,
M const & x2, N const & y2); M const & x2, N const & y2);
template <typename U, typename V> template <typename U, typename V>
GLM_FUNC_DECL explicit tmat2x2( GLM_FUNC_DECL explicit tmat2x2(
tvec2<U, P> const & v1, tvec2<U, P> const & v1,
tvec2<V, P> const & v2); tvec2<V, P> const & v2);
////////////////////////////////////// //////////////////////////////////////
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, P> const & m); GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x); GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);

@ -174,10 +174,10 @@ namespace detail
// mat2x2 matrix conversions // mat2x2 matrix conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2 GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
( (
tmat2x2<U, P> const & m tmat2x2<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@ -281,7 +281,7 @@ namespace detail
// mat2x2 operators // mat2x2 operators
// This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=
( (
tmat2x2<T, P> const & m tmat2x2<T, P> const & m
@ -292,8 +292,8 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=
( (
tmat2x2<U, P> const & m tmat2x2<U, P> const & m
@ -304,8 +304,8 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=
( (
U const & s U const & s
@ -316,8 +316,8 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=
( (
tmat2x2<U, P> const & m tmat2x2<U, P> const & m
@ -328,8 +328,8 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=
( (
U const & s U const & s
@ -340,8 +340,8 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=
( (
tmat2x2<U, P> const & m tmat2x2<U, P> const & m
@ -352,9 +352,9 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=
( (
U const & s U const & s
) )
@ -364,9 +364,9 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=
( (
tmat2x2<U, P> const & m tmat2x2<U, P> const & m
) )
@ -374,9 +374,9 @@ namespace detail
return (*this = *this * m); return (*this = *this * m);
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=
( (
U const & s U const & s
) )
@ -386,9 +386,9 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/= GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=
( (
tmat2x2<U, P> const & m tmat2x2<U, P> const & m
) )
@ -396,7 +396,7 @@ namespace detail
return (*this = *this / m); return (*this = *this / m);
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++ () GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++ ()
{ {
++this->value[0]; ++this->value[0];
@ -404,7 +404,7 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-- () GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-- ()
{ {
--this->value[0]; --this->value[0];
@ -416,9 +416,9 @@ namespace detail
// Binary operators // Binary operators
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+ GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
( (
tmat2x2<T, P> const & m, tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::value_type const & s typename tmat2x2<T, P>::value_type const & s
) )
{ {
@ -428,9 +428,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+ GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
( (
typename tmat2x2<T, P>::value_type const & s, typename tmat2x2<T, P>::value_type const & s,
tmat2x2<T, P> const & m tmat2x2<T, P> const & m
) )
{ {
@ -440,9 +440,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+ GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+
( (
tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2 tmat2x2<T, P> const & m2
) )
{ {
@ -452,9 +452,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator- GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
( (
tmat2x2<T, P> const & m, tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::value_type const & s typename tmat2x2<T, P>::value_type const & s
) )
{ {
@ -464,9 +464,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator- GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
( (
typename tmat2x2<T, P>::value_type const & s, typename tmat2x2<T, P>::value_type const & s,
tmat2x2<T, P> const & m tmat2x2<T, P> const & m
) )
{ {
@ -476,9 +476,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator- GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-
( (
tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m1,
tmat2x2<T, P> const & m2 tmat2x2<T, P> const & m2
) )
{ {
@ -488,9 +488,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator* GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
( (
tmat2x2<T, P> const & m, tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::value_type const & s typename tmat2x2<T, P>::value_type const & s
) )
{ {
@ -500,9 +500,9 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator* GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*
( (
typename tmat2x2<T, P>::value_type const & s, typename tmat2x2<T, P>::value_type const & s,
tmat2x2<T, P> const & m tmat2x2<T, P> const & m
) )
{ {
@ -514,7 +514,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator* GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator*
( (
tmat2x2<T, P> const & m, tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type const & v typename tmat2x2<T, P>::row_type const & v
) )
{ {
@ -526,7 +526,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator* GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator*
( (
typename tmat2x2<T, P>::col_type const & v, typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m tmat2x2<T, P> const & m
) )
{ {

@ -89,8 +89,8 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Matrix conversion // Matrix conversion
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, P> const & m); GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, Q> const & m);
GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x);

@ -175,10 +175,10 @@ namespace detail
// Matrix conversions // Matrix conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3 GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
( (
tmat2x3<U, P> const & m tmat2x3<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -91,8 +91,8 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, P> const & m); GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m);
GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
@ -156,19 +156,19 @@ namespace detail
tmat2x4<T, P> const & m, tmat2x4<T, P> const & m,
typename tmat2x4<T, P>::value_type const & s); typename tmat2x4<T, P>::value_type const & s);
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> operator* ( tmat2x4<T, P> operator* (
typename tmat2x4<T, P>::value_type const & s, typename tmat2x4<T, P>::value_type const & s,
tmat2x4<T, P> const & m); tmat2x4<T, P> const & m);
template <typename T, precision P> template <typename T, precision P>
typename tmat2x4<T, P>::col_type operator* ( typename tmat2x4<T, P>::col_type operator* (
tmat2x4<T, P> const & m, tmat2x4<T, P> const & m,
typename tmat2x4<T, P>::row_type const & v); typename tmat2x4<T, P>::row_type const & v);
template <typename T, precision P> template <typename T, precision P>
typename tmat2x4<T, P>::row_type operator* ( typename tmat2x4<T, P>::row_type operator* (
typename tmat2x4<T, P>::col_type const & v, typename tmat2x4<T, P>::col_type const & v,
tmat2x4<T, P> const & m); tmat2x4<T, P> const & m);
template <typename T, precision P> template <typename T, precision P>
@ -178,30 +178,30 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> operator* ( tmat2x4<T, P> operator* (
tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m1,
tmat2x2<T, P> const & m2); tmat2x2<T, P> const & m2);
template <typename T, precision P> template <typename T, precision P>
tmat3x4<T, P> operator* ( tmat3x4<T, P> operator* (
tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m1,
tmat3x2<T, P> const & m2); tmat3x2<T, P> const & m2);
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> operator/ ( tmat2x4<T, P> operator/ (
tmat2x4<T, P> const & m, tmat2x4<T, P> const & m,
typename tmat2x4<T, P>::value_type const & s); typename tmat2x4<T, P>::value_type const & s);
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> operator/ ( tmat2x4<T, P> operator/ (
typename tmat2x4<T, P>::value_type const & s, typename tmat2x4<T, P>::value_type const & s,
tmat2x4<T, P> const & m); tmat2x4<T, P> const & m);
// Unary constant operators // Unary constant operators
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> const operator- ( tmat2x4<T, P> const operator- (
tmat2x4<T, P> const & m); tmat2x4<T, P> const & m);
template <typename T, precision P> template <typename T, precision P>
tmat2x4<T, P> const operator-- ( tmat2x4<T, P> const operator-- (
tmat2x4<T, P> const & m, tmat2x4<T, P> const & m,
int); int);

@ -178,10 +178,10 @@ namespace detail
// Matrix conversions // Matrix conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4 GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
( (
tmat2x4<U, P> const & m tmat2x4<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -97,8 +97,8 @@ namespace detail
tvec2<V3, P> const & v3); tvec2<V3, P> const & v3);
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, P> const & m); GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m);
GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);

@ -188,10 +188,10 @@ namespace detail
// mat3x2 matrix conversions // mat3x2 matrix conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2 GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
( (
tmat3x2<U, P> const & m tmat3x2<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -103,8 +103,8 @@ namespace detail
tvec3<V3, P> const & v3); tvec3<V3, P> const & v3);
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, P> const & m); GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x); GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);

@ -191,10 +191,10 @@ namespace detail
// Conversions // Conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3 GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
( (
tmat3x3<U, P> const & m tmat3x3<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -97,8 +97,8 @@ namespace detail
tvec4<V3, P> const & v3); tvec4<V3, P> const & v3);
// Matrix conversion // Matrix conversion
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, P> const & m); GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, Q> const & m);
GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x);

@ -126,7 +126,7 @@ namespace detail
this->value[2] = col_type(x2, y2, z2, w2); this->value[2] = col_type(x2, y2, z2, w2);
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
( (
col_type const & v0, col_type const & v0,
@ -187,10 +187,10 @@ namespace detail
// Conversion // Conversion
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4 GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
( (
tmat3x4<U, P> const & m tmat3x4<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -102,8 +102,8 @@ namespace detail
tvec2<V4, P> const & v4); tvec2<V4, P> const & v4);
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, P> const & m); GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m);
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);

@ -202,10 +202,10 @@ namespace detail
// Conversion // Conversion
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2 GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
( (
tmat4x2<U, P> const & m tmat4x2<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -77,7 +77,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Conversions // Conversions
template <typename U> template <typename U>
GLM_FUNC_DECL explicit tmat4x3( GLM_FUNC_DECL explicit tmat4x3(
U const & x); U const & x);
@ -100,8 +100,8 @@ namespace detail
tvec3<V4, P> const & v4); tvec3<V4, P> const & v4);
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, P> const & m); GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, Q> const & m);
GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x);

@ -204,10 +204,10 @@ namespace detail
// Matrix conversions // Matrix conversions
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
( (
tmat4x3<U, P> const & m tmat4x3<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@ -240,7 +240,7 @@ namespace detail
this->value[3] = col_type(value_type(0)); this->value[3] = col_type(value_type(0));
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3 GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
( (
tmat4x4<T, P> const & m tmat4x4<T, P> const & m

@ -106,8 +106,8 @@ namespace detail
tvec4<V4, P> const & v4); tvec4<V4, P> const & v4);
// Matrix conversions // Matrix conversions
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, P> const & m); GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, Q> const & m);
GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x); GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x); GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x);

@ -149,10 +149,10 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4 GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
( (
tmat4x4<U, P> const & m tmat4x4<U, Q> const & m
) )
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);

@ -86,21 +86,24 @@ namespace detail
// Convertion scalar constructors // Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U>
GLM_FUNC_DECL explicit tvec1(U const & s); GLM_FUNC_DECL explicit tvec1(U const & s);
////////////////////////////////////// //////////////////////////////////////
// Convertion vector constructors // Convertion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec1(tvec2<U, P> const & v); GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec1(tvec3<U, P> const & v); GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec1(tvec4<U, P> const & v); GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators

@ -119,28 +119,37 @@ namespace detail
// Convertion vector constructors // Convertion vector constructors
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1 GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
( (
tvec2<U, P> const & v tvec1<U, Q> const & v
) : ) :
x(value_type(v.x)) x(value_type(v.x))
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1 GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
( (
tvec3<U, P> const & v tvec2<U, Q> const & v
) : ) :
x(value_type(v.x)) x(value_type(v.x))
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
(
tvec3<U, Q> const & v
) :
x(value_type(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1 GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1
( (
tvec4<U, P> const & v tvec4<U, Q> const & v
) : ) :
x(value_type(v.x)) x(value_type(v.x))
{} {}

@ -131,23 +131,23 @@ namespace detail
GLM_FUNC_DECL explicit tvec2( GLM_FUNC_DECL explicit tvec2(
U const & x); U const & x);
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, typename V> template <typename U, typename V>
GLM_FUNC_DECL explicit tvec2( GLM_FUNC_DECL explicit tvec2(
U const & x, U const & x,
V const & y); V const & y);
////////////////////////////////////// //////////////////////////////////////
// Convertion vector constructors // Convertion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec2(tvec2<U, P> const & v); GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec2(tvec3<U, P> const & v); GLM_FUNC_DECL explicit tvec2(tvec3<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec2(tvec4<U, P> const & v); GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators

@ -139,30 +139,30 @@ namespace detail
// Convertion vector constructors // Convertion vector constructors
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2 GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
( (
tvec2<U, P> const & v tvec2<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)) y(value_type(v.y))
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2 GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
( (
tvec3<U, P> const & v tvec3<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)) y(value_type(v.y))
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2 GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2
( (
tvec4<U, P> const & v tvec4<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)) y(value_type(v.y))

@ -110,8 +110,8 @@ namespace detail
GLM_FUNC_DECL explicit tvec3( GLM_FUNC_DECL explicit tvec3(
value_type const & s); value_type const & s);
GLM_FUNC_DECL explicit tvec3( GLM_FUNC_DECL explicit tvec3(
value_type const & s1, value_type const & s1,
value_type const & s2, value_type const & s2,
value_type const & s3); value_type const & s3);
////////////////////////////////////// //////////////////////////////////////
@ -132,17 +132,17 @@ namespace detail
// Convertion vector constructors // Convertion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec2<A, P> const & v, B const & s); GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & v, B const & s);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(A const & s, tvec2<B, P> const & v); GLM_FUNC_DECL explicit tvec3(A const & s, tvec2<B, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec3<U, P> const & v); GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec4<U, P> const & v); GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
////////////////////////////////////// //////////////////////////////////////
// Swizzle constructors // Swizzle constructors

@ -95,8 +95,8 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
value_type const & s0, value_type const & s0,
value_type const & s1, value_type const & s1,
value_type const & s2 value_type const & s2
) : ) :
x(s0), x(s0),
@ -118,7 +118,7 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
tref2<A, P> const & v, tref2<A, P> const & v,
@ -130,7 +130,7 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
A const & s, A const & s,
@ -145,7 +145,7 @@ namespace detail
// Convertion scalar constructors // Convertion scalar constructors
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
U const & s U const & s
@ -156,7 +156,7 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B, typename C> template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
A const & x, A const & x,
@ -172,10 +172,10 @@ namespace detail
// Convertion vector constructors // Convertion vector constructors
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
tvec2<A, P> const & v, tvec2<A, Q> const & v,
B const & s B const & s
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
@ -184,11 +184,11 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
A const & s, A const & s,
tvec2<B, P> const & v tvec2<B, Q> const & v
) : ) :
x(value_type(s)), x(value_type(s)),
y(value_type(v.x)), y(value_type(v.x)),
@ -196,10 +196,10 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
tvec3<U, P> const & v tvec3<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)), y(value_type(v.y)),
@ -207,10 +207,10 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3 GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3
( (
tvec4<U, P> const & v tvec4<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)), y(value_type(v.y)),

@ -111,50 +111,50 @@ namespace detail
GLM_FUNC_DECL explicit tvec4( GLM_FUNC_DECL explicit tvec4(
value_type const & s); value_type const & s);
GLM_FUNC_DECL explicit tvec4( GLM_FUNC_DECL explicit tvec4(
value_type const & s0, value_type const & s0,
value_type const & s1, value_type const & s1,
value_type const & s2, value_type const & s2,
value_type const & s3); value_type const & s3);
////////////////////////////////////// //////////////////////////////////////
// Convertion scalar constructors // Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U>
GLM_FUNC_DECL explicit tvec4( GLM_FUNC_DECL explicit tvec4(
U const & x); U const & x);
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, typename D> template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL explicit tvec4( GLM_FUNC_DECL explicit tvec4(
A const & x, A const & x,
B const & y, B const & y,
C const & z, C const & z,
D const & w); D const & w);
////////////////////////////////////// //////////////////////////////////////
// Convertion vector constructors // Convertion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec2<A, P> const & v, B const & s1, C const & s2); GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & v, B const & s1, C const & s2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2<B, P> const & v, C const & s2); GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2<B, Q> const & v, C const & s2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2<C, P> const & v); GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2<C, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec3<A, P> const & v, B const & s); GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & v, B const & s);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(A const & s, tvec3<B, P> const & v); GLM_FUNC_DECL explicit tvec4(A const & s, tvec3<B, Q> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec2<A, P> const & v1, tvec2<B, P> const & v2); GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & v1, tvec2<B, Q> const & v2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U> template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec4<U, P> const & v); GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
template <int E0, int E1, int E2, int E3> template <int E0, int E1, int E2, int E3>
GLM_FUNC_DECL tvec4(glm::detail::swizzle<4, T, tvec4<T, P>, E0, E1, E2, E3> const & that) GLM_FUNC_DECL tvec4(glm::detail::swizzle<4, T, tvec4<T, P>, E0, E1, E2, E3> const & that)

@ -270,10 +270,10 @@ namespace detail
// Convertion vector constructors // Convertion vector constructors
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
tvec2<A, P> const & v, tvec2<A, Q> const & v,
B const & s1, B const & s1,
C const & s2 C const & s2
) : ) :
@ -284,11 +284,11 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
A const & s1, A const & s1,
tvec2<B, P> const & v, tvec2<B, Q> const & v,
C const & s2 C const & s2
) : ) :
x(value_type(s1)), x(value_type(s1)),
@ -298,12 +298,12 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B, typename C> template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
A const & s1, A const & s1,
B const & s2, B const & s2,
tvec2<C, P> const & v tvec2<C, Q> const & v
) : ) :
x(value_type(s1)), x(value_type(s1)),
y(value_type(s2)), y(value_type(s2)),
@ -312,10 +312,10 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
tvec3<A, P> const & v, tvec3<A, Q> const & v,
B const & s B const & s
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
@ -325,11 +325,11 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
A const & s, A const & s,
tvec3<B, P> const & v tvec3<B, Q> const & v
) : ) :
x(value_type(s)), x(value_type(s)),
y(value_type(v.x)), y(value_type(v.x)),
@ -338,11 +338,11 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename A, typename B> template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
tvec2<A, P> const & v1, tvec2<A, Q> const & v1,
tvec2<B, P> const & v2 tvec2<B, Q> const & v2
) : ) :
x(value_type(v1.x)), x(value_type(v1.x)),
y(value_type(v1.y)), y(value_type(v1.y)),
@ -351,10 +351,10 @@ namespace detail
{} {}
template <typename T, precision P> template <typename T, precision P>
template <typename U> template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4 GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4
( (
tvec4<U, P> const & v tvec4<U, Q> const & v
) : ) :
x(value_type(v.x)), x(value_type(v.x)),
y(value_type(v.y)), y(value_type(v.y)),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -295,7 +295,7 @@ namespace detail
/// Dual-quaternion of default half-precision floating-point numbers. /// Dual-quaternion of default half-precision floating-point numbers.
/// ///
/// @see gtc_dual_quaternion /// @see gtc_dual_quaternion
typedef mediump_hdualquat hdualquat; typedef highp_hdualquat hdualquat;
#elif(defined(GLM_PRECISION_HIGHP_HALF) && !defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF)) #elif(defined(GLM_PRECISION_HIGHP_HALF) && !defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF))
typedef highp_hdualquat hdualquat; typedef highp_hdualquat hdualquat;
#elif(!defined(GLM_PRECISION_HIGHP_HALF) && defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF)) #elif(!defined(GLM_PRECISION_HIGHP_HALF) && defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF))
@ -311,7 +311,7 @@ namespace detail
/// Dual-quaternion of default double-precision floating-point numbers. /// Dual-quaternion of default double-precision floating-point numbers.
/// ///
/// @see gtc_dual_quaternion /// @see gtc_dual_quaternion
typedef mediump_ddualquat ddualquat; typedef highp_ddualquat ddualquat;
#elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) #elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
typedef highp_ddualquat ddualquat; typedef highp_ddualquat ddualquat;
#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) #elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))

@ -136,16 +136,16 @@ int test_packDouble2x32()
{ {
int Error = 0; int Error = 0;
std::vector<glm::u32vec2> A; std::vector<glm::uvec2> A;
A.push_back(glm::u32vec2( 1, 2)); A.push_back(glm::uvec2( 1, 2));
A.push_back(glm::u32vec2(-1,-2)); A.push_back(glm::uvec2(-1,-2));
A.push_back(glm::u32vec2(-1000, 1100)); A.push_back(glm::uvec2(-1000, 1100));
for(std::size_t i = 0; i < A.size(); ++i) for(std::size_t i = 0; i < A.size(); ++i)
{ {
glm::u32vec2 B(A[i]); glm::uvec2 B(A[i]);
double C = glm::packDouble2x32(B); double C = glm::packDouble2x32(B);
glm::u32vec2 D = glm::unpackDouble2x32(C); glm::uvec2 D = glm::unpackDouble2x32(C);
Error += B == D ? 0 : 1; Error += B == D ? 0 : 1;
assert(!Error); assert(!Error);
} }

@ -2,7 +2,7 @@
// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-09-16 // Created : 2010-09-16
// Updated : 2011-05-08 // Updated : 2013-04-16
// Licence : This source is under MIT licence // Licence : This source is under MIT licence
// File : test/gtc/type_precision.cpp // File : test/gtc/type_precision.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
@ -12,154 +12,522 @@
static int test_scalar_size() static int test_scalar_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::int8) != 1; Error += sizeof(glm::int8) != 1;
Error += sizeof(glm::int16) != 2; Error += sizeof(glm::int16) != 2;
Error += sizeof(glm::int32) != 4; Error += sizeof(glm::int32) != 4;
Error += sizeof(glm::int64) != 8; Error += sizeof(glm::int64) != 8;
Error += sizeof(glm::uint8) != 1; Error += sizeof(glm::uint8) != 1;
Error += sizeof(glm::uint16) != 2; Error += sizeof(glm::uint16) != 2;
Error += sizeof(glm::uint32) != 4; Error += sizeof(glm::uint32) != 4;
Error += sizeof(glm::uint64) != 8; Error += sizeof(glm::uint64) != 8;
Error += sizeof(glm::float16) != 2; Error += sizeof(glm::float16) != 2;
Error += sizeof(glm::float32) != 4; Error += sizeof(glm::float32) != 4;
Error += sizeof(glm::float64) != 8; Error += sizeof(glm::float64) != 8;
Error += sizeof(glm::lowp_int8) != 1;
Error += sizeof(glm::lowp_int16) != 2;
Error += sizeof(glm::lowp_int32) != 4;
Error += sizeof(glm::lowp_int64) != 8;
Error += sizeof(glm::lowp_uint8) != 1;
Error += sizeof(glm::lowp_uint16) != 2;
Error += sizeof(glm::lowp_uint32) != 4;
Error += sizeof(glm::lowp_uint64) != 8;
Error += sizeof(glm::lowp_float16) != 2;
Error += sizeof(glm::lowp_float32) != 4;
Error += sizeof(glm::lowp_float64) != 8;
Error += sizeof(glm::mediump_int8) != 1;
Error += sizeof(glm::mediump_int16) != 2;
Error += sizeof(glm::mediump_int32) != 4;
Error += sizeof(glm::mediump_int64) != 8;
Error += sizeof(glm::mediump_uint8) != 1;
Error += sizeof(glm::mediump_uint16) != 2;
Error += sizeof(glm::mediump_uint32) != 4;
Error += sizeof(glm::mediump_uint64) != 8;
Error += sizeof(glm::mediump_float16) != 2;
Error += sizeof(glm::mediump_float32) != 4;
Error += sizeof(glm::mediump_float64) != 8;
Error += sizeof(glm::highp_int8) != 1;
Error += sizeof(glm::highp_int16) != 2;
Error += sizeof(glm::highp_int32) != 4;
Error += sizeof(glm::highp_int64) != 8;
Error += sizeof(glm::highp_uint8) != 1;
Error += sizeof(glm::highp_uint16) != 2;
Error += sizeof(glm::highp_uint32) != 4;
Error += sizeof(glm::highp_uint64) != 8;
Error += sizeof(glm::highp_float16) != 2;
Error += sizeof(glm::highp_float32) != 4;
Error += sizeof(glm::highp_float64) != 8;
return Error; return Error;
} }
static int test_fvec_size() static int test_fvec_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::f16vec2) != 4; Error += sizeof(glm::f16vec2) != 4;
Error += sizeof(glm::f16vec3) != 6; Error += sizeof(glm::f16vec3) != 6;
Error += sizeof(glm::f16vec4) != 8; Error += sizeof(glm::f16vec4) != 8;
Error += sizeof(glm::f32vec2) != 8; Error += sizeof(glm::f32vec2) != 8;
Error += sizeof(glm::f32vec3) != 12; Error += sizeof(glm::f32vec3) != 12;
Error += sizeof(glm::f32vec4) != 16; Error += sizeof(glm::f32vec4) != 16;
Error += sizeof(glm::f64vec2) != 16; Error += sizeof(glm::f64vec2) != 16;
Error += sizeof(glm::f64vec3) != 24; Error += sizeof(glm::f64vec3) != 24;
Error += sizeof(glm::f64vec4) != 32; Error += sizeof(glm::f64vec4) != 32;
Error += sizeof(glm::lowp_f16vec2) != 4;
Error += sizeof(glm::lowp_f16vec3) != 6;
Error += sizeof(glm::lowp_f16vec4) != 8;
Error += sizeof(glm::lowp_f32vec2) != 8;
Error += sizeof(glm::lowp_f32vec3) != 12;
Error += sizeof(glm::lowp_f32vec4) != 16;
Error += sizeof(glm::lowp_f64vec2) != 16;
Error += sizeof(glm::lowp_f64vec3) != 24;
Error += sizeof(glm::lowp_f64vec4) != 32;
Error += sizeof(glm::mediump_f16vec2) != 4;
Error += sizeof(glm::mediump_f16vec3) != 6;
Error += sizeof(glm::mediump_f16vec4) != 8;
Error += sizeof(glm::mediump_f32vec2) != 8;
Error += sizeof(glm::mediump_f32vec3) != 12;
Error += sizeof(glm::mediump_f32vec4) != 16;
Error += sizeof(glm::mediump_f64vec2) != 16;
Error += sizeof(glm::mediump_f64vec3) != 24;
Error += sizeof(glm::mediump_f64vec4) != 32;
Error += sizeof(glm::highp_f16vec2) != 4;
Error += sizeof(glm::highp_f16vec3) != 6;
Error += sizeof(glm::highp_f16vec4) != 8;
Error += sizeof(glm::highp_f32vec2) != 8;
Error += sizeof(glm::highp_f32vec3) != 12;
Error += sizeof(glm::highp_f32vec4) != 16;
Error += sizeof(glm::highp_f64vec2) != 16;
Error += sizeof(glm::highp_f64vec3) != 24;
Error += sizeof(glm::highp_f64vec4) != 32;
return Error; return Error;
} }
static int test_ivec_size() static int test_ivec_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::i8vec2) != 2; Error += sizeof(glm::i8vec2) != 2;
Error += sizeof(glm::i8vec3) != 3; Error += sizeof(glm::i8vec3) != 3;
Error += sizeof(glm::i8vec4) != 4; Error += sizeof(glm::i8vec4) != 4;
Error += sizeof(glm::i16vec2) != 4; Error += sizeof(glm::i16vec2) != 4;
Error += sizeof(glm::i16vec3) != 6; Error += sizeof(glm::i16vec3) != 6;
Error += sizeof(glm::i16vec4) != 8; Error += sizeof(glm::i16vec4) != 8;
Error += sizeof(glm::i32vec2) != 8; Error += sizeof(glm::i32vec2) != 8;
Error += sizeof(glm::i32vec3) != 12; Error += sizeof(glm::i32vec3) != 12;
Error += sizeof(glm::i32vec4) != 16; Error += sizeof(glm::i32vec4) != 16;
Error += sizeof(glm::i64vec2) != 16; Error += sizeof(glm::i64vec2) != 16;
Error += sizeof(glm::i64vec3) != 24; Error += sizeof(glm::i64vec3) != 24;
Error += sizeof(glm::i64vec4) != 32; Error += sizeof(glm::i64vec4) != 32;
Error += sizeof(glm::lowp_i8vec2) != 2;
Error += sizeof(glm::lowp_i8vec3) != 3;
Error += sizeof(glm::lowp_i8vec4) != 4;
Error += sizeof(glm::lowp_i16vec2) != 4;
Error += sizeof(glm::lowp_i16vec3) != 6;
Error += sizeof(glm::lowp_i16vec4) != 8;
Error += sizeof(glm::lowp_i32vec2) != 8;
Error += sizeof(glm::lowp_i32vec3) != 12;
Error += sizeof(glm::lowp_i32vec4) != 16;
Error += sizeof(glm::lowp_i64vec2) != 16;
Error += sizeof(glm::lowp_i64vec3) != 24;
Error += sizeof(glm::lowp_i64vec4) != 32;
Error += sizeof(glm::mediump_i8vec2) != 2;
Error += sizeof(glm::mediump_i8vec3) != 3;
Error += sizeof(glm::mediump_i8vec4) != 4;
Error += sizeof(glm::mediump_i16vec2) != 4;
Error += sizeof(glm::mediump_i16vec3) != 6;
Error += sizeof(glm::mediump_i16vec4) != 8;
Error += sizeof(glm::mediump_i32vec2) != 8;
Error += sizeof(glm::mediump_i32vec3) != 12;
Error += sizeof(glm::mediump_i32vec4) != 16;
Error += sizeof(glm::mediump_i64vec2) != 16;
Error += sizeof(glm::mediump_i64vec3) != 24;
Error += sizeof(glm::mediump_i64vec4) != 32;
Error += sizeof(glm::highp_i8vec2) != 2;
Error += sizeof(glm::highp_i8vec3) != 3;
Error += sizeof(glm::highp_i8vec4) != 4;
Error += sizeof(glm::highp_i16vec2) != 4;
Error += sizeof(glm::highp_i16vec3) != 6;
Error += sizeof(glm::highp_i16vec4) != 8;
Error += sizeof(glm::highp_i32vec2) != 8;
Error += sizeof(glm::highp_i32vec3) != 12;
Error += sizeof(glm::highp_i32vec4) != 16;
Error += sizeof(glm::highp_i64vec2) != 16;
Error += sizeof(glm::highp_i64vec3) != 24;
Error += sizeof(glm::highp_i64vec4) != 32;
return Error; return Error;
} }
static int test_uvec_size() static int test_uvec_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::u8vec2) != 2; Error += sizeof(glm::u8vec2) != 2;
Error += sizeof(glm::u8vec3) != 3; Error += sizeof(glm::u8vec3) != 3;
Error += sizeof(glm::u8vec4) != 4; Error += sizeof(glm::u8vec4) != 4;
Error += sizeof(glm::u16vec2) != 4; Error += sizeof(glm::u16vec2) != 4;
Error += sizeof(glm::u16vec3) != 6; Error += sizeof(glm::u16vec3) != 6;
Error += sizeof(glm::u16vec4) != 8; Error += sizeof(glm::u16vec4) != 8;
Error += sizeof(glm::u32vec2) != 8; Error += sizeof(glm::u32vec2) != 8;
Error += sizeof(glm::u32vec3) != 12; Error += sizeof(glm::u32vec3) != 12;
Error += sizeof(glm::u32vec4) != 16; Error += sizeof(glm::u32vec4) != 16;
Error += sizeof(glm::u64vec2) != 16; Error += sizeof(glm::u64vec2) != 16;
Error += sizeof(glm::u64vec3) != 24; Error += sizeof(glm::u64vec3) != 24;
Error += sizeof(glm::u64vec4) != 32; Error += sizeof(glm::u64vec4) != 32;
Error += sizeof(glm::lowp_u8vec2) != 2;
Error += sizeof(glm::lowp_u8vec3) != 3;
Error += sizeof(glm::lowp_u8vec4) != 4;
Error += sizeof(glm::lowp_u16vec2) != 4;
Error += sizeof(glm::lowp_u16vec3) != 6;
Error += sizeof(glm::lowp_u16vec4) != 8;
Error += sizeof(glm::lowp_u32vec2) != 8;
Error += sizeof(glm::lowp_u32vec3) != 12;
Error += sizeof(glm::lowp_u32vec4) != 16;
Error += sizeof(glm::lowp_u64vec2) != 16;
Error += sizeof(glm::lowp_u64vec3) != 24;
Error += sizeof(glm::lowp_u64vec4) != 32;
Error += sizeof(glm::mediump_u8vec2) != 2;
Error += sizeof(glm::mediump_u8vec3) != 3;
Error += sizeof(glm::mediump_u8vec4) != 4;
Error += sizeof(glm::mediump_u16vec2) != 4;
Error += sizeof(glm::mediump_u16vec3) != 6;
Error += sizeof(glm::mediump_u16vec4) != 8;
Error += sizeof(glm::mediump_u32vec2) != 8;
Error += sizeof(glm::mediump_u32vec3) != 12;
Error += sizeof(glm::mediump_u32vec4) != 16;
Error += sizeof(glm::mediump_u64vec2) != 16;
Error += sizeof(glm::mediump_u64vec3) != 24;
Error += sizeof(glm::mediump_u64vec4) != 32;
Error += sizeof(glm::highp_u8vec2) != 2;
Error += sizeof(glm::highp_u8vec3) != 3;
Error += sizeof(glm::highp_u8vec4) != 4;
Error += sizeof(glm::highp_u16vec2) != 4;
Error += sizeof(glm::highp_u16vec3) != 6;
Error += sizeof(glm::highp_u16vec4) != 8;
Error += sizeof(glm::highp_u32vec2) != 8;
Error += sizeof(glm::highp_u32vec3) != 12;
Error += sizeof(glm::highp_u32vec4) != 16;
Error += sizeof(glm::highp_u64vec2) != 16;
Error += sizeof(glm::highp_u64vec3) != 24;
Error += sizeof(glm::highp_u64vec4) != 32;
return Error; return Error;
} }
static int test_hmat_size() static int test_hmat_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::f16mat2) != 8; Error += sizeof(glm::f16mat2) != 8;
Error += sizeof(glm::f16mat3) != 18; Error += sizeof(glm::f16mat3) != 18;
Error += sizeof(glm::f16mat4) != 32; Error += sizeof(glm::f16mat4) != 32;
Error += sizeof(glm::f16mat2x2) != 8; Error += sizeof(glm::f16mat2x2) != 8;
Error += sizeof(glm::f16mat2x3) != 12; Error += sizeof(glm::f16mat2x3) != 12;
Error += sizeof(glm::f16mat2x4) != 16; Error += sizeof(glm::f16mat2x4) != 16;
Error += sizeof(glm::f16mat3x2) != 12; Error += sizeof(glm::f16mat3x2) != 12;
Error += sizeof(glm::f16mat3x3) != 18; Error += sizeof(glm::f16mat3x3) != 18;
Error += sizeof(glm::f16mat3x4) != 24; Error += sizeof(glm::f16mat3x4) != 24;
Error += sizeof(glm::f16mat4x2) != 16; Error += sizeof(glm::f16mat4x2) != 16;
Error += sizeof(glm::f16mat4x3) != 24; Error += sizeof(glm::f16mat4x3) != 24;
Error += sizeof(glm::f16mat4x4) != 32; Error += sizeof(glm::f16mat4x4) != 32;
Error += sizeof(glm::lowp_f16mat2) != 8;
Error += sizeof(glm::lowp_f16mat3) != 18;
Error += sizeof(glm::lowp_f16mat4) != 32;
Error += sizeof(glm::lowp_f16mat2x2) != 8;
Error += sizeof(glm::lowp_f16mat2x3) != 12;
Error += sizeof(glm::lowp_f16mat2x4) != 16;
Error += sizeof(glm::lowp_f16mat3x2) != 12;
Error += sizeof(glm::lowp_f16mat3x3) != 18;
Error += sizeof(glm::lowp_f16mat3x4) != 24;
Error += sizeof(glm::lowp_f16mat4x2) != 16;
Error += sizeof(glm::lowp_f16mat4x3) != 24;
Error += sizeof(glm::lowp_f16mat4x4) != 32;
Error += sizeof(glm::mediump_f16mat2) != 8;
Error += sizeof(glm::mediump_f16mat3) != 18;
Error += sizeof(glm::mediump_f16mat4) != 32;
Error += sizeof(glm::mediump_f16mat2x2) != 8;
Error += sizeof(glm::mediump_f16mat2x3) != 12;
Error += sizeof(glm::mediump_f16mat2x4) != 16;
Error += sizeof(glm::mediump_f16mat3x2) != 12;
Error += sizeof(glm::mediump_f16mat3x3) != 18;
Error += sizeof(glm::mediump_f16mat3x4) != 24;
Error += sizeof(glm::mediump_f16mat4x2) != 16;
Error += sizeof(glm::mediump_f16mat4x3) != 24;
Error += sizeof(glm::mediump_f16mat4x4) != 32;
Error += sizeof(glm::highp_f16mat2) != 8;
Error += sizeof(glm::highp_f16mat3) != 18;
Error += sizeof(glm::highp_f16mat4) != 32;
Error += sizeof(glm::highp_f16mat2x2) != 8;
Error += sizeof(glm::highp_f16mat2x3) != 12;
Error += sizeof(glm::highp_f16mat2x4) != 16;
Error += sizeof(glm::highp_f16mat3x2) != 12;
Error += sizeof(glm::highp_f16mat3x3) != 18;
Error += sizeof(glm::highp_f16mat3x4) != 24;
Error += sizeof(glm::highp_f16mat4x2) != 16;
Error += sizeof(glm::highp_f16mat4x3) != 24;
Error += sizeof(glm::highp_f16mat4x4) != 32;
return Error; return Error;
} }
static int test_fmat_size() static int test_fmat_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::fmat2) != 16; Error += sizeof(glm::mat2) != 16;
Error += sizeof(glm::fmat3) != 36; Error += sizeof(glm::mat3) != 36;
Error += sizeof(glm::fmat4) != 64; Error += sizeof(glm::mat4) != 64;
Error += sizeof(glm::fmat2x2) != 16; Error += sizeof(glm::mat2x2) != 16;
Error += sizeof(glm::fmat2x3) != 24; Error += sizeof(glm::mat2x3) != 24;
Error += sizeof(glm::fmat2x4) != 32; Error += sizeof(glm::mat2x4) != 32;
Error += sizeof(glm::fmat3x2) != 24; Error += sizeof(glm::mat3x2) != 24;
Error += sizeof(glm::fmat3x3) != 36; Error += sizeof(glm::mat3x3) != 36;
Error += sizeof(glm::fmat3x4) != 48; Error += sizeof(glm::mat3x4) != 48;
Error += sizeof(glm::fmat4x2) != 32; Error += sizeof(glm::mat4x2) != 32;
Error += sizeof(glm::fmat4x3) != 48; Error += sizeof(glm::mat4x3) != 48;
Error += sizeof(glm::fmat4x4) != 64; Error += sizeof(glm::mat4x4) != 64;
Error += sizeof(glm::f32mat2) != 16; Error += sizeof(glm::fmat2) != 16;
Error += sizeof(glm::f32mat3) != 36; Error += sizeof(glm::fmat3) != 36;
Error += sizeof(glm::f32mat4) != 64; Error += sizeof(glm::fmat4) != 64;
Error += sizeof(glm::f32mat2x2) != 16; Error += sizeof(glm::fmat2x2) != 16;
Error += sizeof(glm::f32mat2x3) != 24; Error += sizeof(glm::fmat2x3) != 24;
Error += sizeof(glm::f32mat2x4) != 32; Error += sizeof(glm::fmat2x4) != 32;
Error += sizeof(glm::f32mat3x2) != 24; Error += sizeof(glm::fmat3x2) != 24;
Error += sizeof(glm::f32mat3x3) != 36; Error += sizeof(glm::fmat3x3) != 36;
Error += sizeof(glm::f32mat3x4) != 48; Error += sizeof(glm::fmat3x4) != 48;
Error += sizeof(glm::f32mat4x2) != 32; Error += sizeof(glm::fmat4x2) != 32;
Error += sizeof(glm::f32mat4x3) != 48; Error += sizeof(glm::fmat4x3) != 48;
Error += sizeof(glm::f32mat4x4) != 64; Error += sizeof(glm::fmat4x4) != 64;
Error += sizeof(glm::f32mat2) != 16;
Error += sizeof(glm::f32mat3) != 36;
Error += sizeof(glm::f32mat4) != 64;
Error += sizeof(glm::f32mat2x2) != 16;
Error += sizeof(glm::f32mat2x3) != 24;
Error += sizeof(glm::f32mat2x4) != 32;
Error += sizeof(glm::f32mat3x2) != 24;
Error += sizeof(glm::f32mat3x3) != 36;
Error += sizeof(glm::f32mat3x4) != 48;
Error += sizeof(glm::f32mat4x2) != 32;
Error += sizeof(glm::f32mat4x3) != 48;
Error += sizeof(glm::f32mat4x4) != 64;
Error += sizeof(glm::lowp_mat2) != 16;
Error += sizeof(glm::lowp_mat3) != 36;
Error += sizeof(glm::lowp_mat4) != 64;
Error += sizeof(glm::lowp_mat2x2) != 16;
Error += sizeof(glm::lowp_mat2x3) != 24;
Error += sizeof(glm::lowp_mat2x4) != 32;
Error += sizeof(glm::lowp_mat3x2) != 24;
Error += sizeof(glm::lowp_mat3x3) != 36;
Error += sizeof(glm::lowp_mat3x4) != 48;
Error += sizeof(glm::lowp_mat4x2) != 32;
Error += sizeof(glm::lowp_mat4x3) != 48;
Error += sizeof(glm::lowp_mat4x4) != 64;
Error += sizeof(glm::lowp_fmat2) != 16;
Error += sizeof(glm::lowp_fmat3) != 36;
Error += sizeof(glm::lowp_fmat4) != 64;
Error += sizeof(glm::lowp_fmat2x2) != 16;
Error += sizeof(glm::lowp_fmat2x3) != 24;
Error += sizeof(glm::lowp_fmat2x4) != 32;
Error += sizeof(glm::lowp_fmat3x2) != 24;
Error += sizeof(glm::lowp_fmat3x3) != 36;
Error += sizeof(glm::lowp_fmat3x4) != 48;
Error += sizeof(glm::lowp_fmat4x2) != 32;
Error += sizeof(glm::lowp_fmat4x3) != 48;
Error += sizeof(glm::lowp_fmat4x4) != 64;
Error += sizeof(glm::lowp_f32mat2) != 16;
Error += sizeof(glm::lowp_f32mat3) != 36;
Error += sizeof(glm::lowp_f32mat4) != 64;
Error += sizeof(glm::lowp_f32mat2x2) != 16;
Error += sizeof(glm::lowp_f32mat2x3) != 24;
Error += sizeof(glm::lowp_f32mat2x4) != 32;
Error += sizeof(glm::lowp_f32mat3x2) != 24;
Error += sizeof(glm::lowp_f32mat3x3) != 36;
Error += sizeof(glm::lowp_f32mat3x4) != 48;
Error += sizeof(glm::lowp_f32mat4x2) != 32;
Error += sizeof(glm::lowp_f32mat4x3) != 48;
Error += sizeof(glm::lowp_f32mat4x4) != 64;
Error += sizeof(glm::mediump_mat2) != 16;
Error += sizeof(glm::mediump_mat3) != 36;
Error += sizeof(glm::mediump_mat4) != 64;
Error += sizeof(glm::mediump_mat2x2) != 16;
Error += sizeof(glm::mediump_mat2x3) != 24;
Error += sizeof(glm::mediump_mat2x4) != 32;
Error += sizeof(glm::mediump_mat3x2) != 24;
Error += sizeof(glm::mediump_mat3x3) != 36;
Error += sizeof(glm::mediump_mat3x4) != 48;
Error += sizeof(glm::mediump_mat4x2) != 32;
Error += sizeof(glm::mediump_mat4x3) != 48;
Error += sizeof(glm::mediump_mat4x4) != 64;
Error += sizeof(glm::mediump_fmat2) != 16;
Error += sizeof(glm::mediump_fmat3) != 36;
Error += sizeof(glm::mediump_fmat4) != 64;
Error += sizeof(glm::mediump_fmat2x2) != 16;
Error += sizeof(glm::mediump_fmat2x3) != 24;
Error += sizeof(glm::mediump_fmat2x4) != 32;
Error += sizeof(glm::mediump_fmat3x2) != 24;
Error += sizeof(glm::mediump_fmat3x3) != 36;
Error += sizeof(glm::mediump_fmat3x4) != 48;
Error += sizeof(glm::mediump_fmat4x2) != 32;
Error += sizeof(glm::mediump_fmat4x3) != 48;
Error += sizeof(glm::mediump_fmat4x4) != 64;
Error += sizeof(glm::mediump_f32mat2) != 16;
Error += sizeof(glm::mediump_f32mat3) != 36;
Error += sizeof(glm::mediump_f32mat4) != 64;
Error += sizeof(glm::mediump_f32mat2x2) != 16;
Error += sizeof(glm::mediump_f32mat2x3) != 24;
Error += sizeof(glm::mediump_f32mat2x4) != 32;
Error += sizeof(glm::mediump_f32mat3x2) != 24;
Error += sizeof(glm::mediump_f32mat3x3) != 36;
Error += sizeof(glm::mediump_f32mat3x4) != 48;
Error += sizeof(glm::mediump_f32mat4x2) != 32;
Error += sizeof(glm::mediump_f32mat4x3) != 48;
Error += sizeof(glm::mediump_f32mat4x4) != 64;
Error += sizeof(glm::highp_mat2) != 16;
Error += sizeof(glm::highp_mat3) != 36;
Error += sizeof(glm::highp_mat4) != 64;
Error += sizeof(glm::highp_mat2x2) != 16;
Error += sizeof(glm::highp_mat2x3) != 24;
Error += sizeof(glm::highp_mat2x4) != 32;
Error += sizeof(glm::highp_mat3x2) != 24;
Error += sizeof(glm::highp_mat3x3) != 36;
Error += sizeof(glm::highp_mat3x4) != 48;
Error += sizeof(glm::highp_mat4x2) != 32;
Error += sizeof(glm::highp_mat4x3) != 48;
Error += sizeof(glm::highp_mat4x4) != 64;
Error += sizeof(glm::highp_fmat2) != 16;
Error += sizeof(glm::highp_fmat3) != 36;
Error += sizeof(glm::highp_fmat4) != 64;
Error += sizeof(glm::highp_fmat2x2) != 16;
Error += sizeof(glm::highp_fmat2x3) != 24;
Error += sizeof(glm::highp_fmat2x4) != 32;
Error += sizeof(glm::highp_fmat3x2) != 24;
Error += sizeof(glm::highp_fmat3x3) != 36;
Error += sizeof(glm::highp_fmat3x4) != 48;
Error += sizeof(glm::highp_fmat4x2) != 32;
Error += sizeof(glm::highp_fmat4x3) != 48;
Error += sizeof(glm::highp_fmat4x4) != 64;
Error += sizeof(glm::highp_f32mat2) != 16;
Error += sizeof(glm::highp_f32mat3) != 36;
Error += sizeof(glm::highp_f32mat4) != 64;
Error += sizeof(glm::highp_f32mat2x2) != 16;
Error += sizeof(glm::highp_f32mat2x3) != 24;
Error += sizeof(glm::highp_f32mat2x4) != 32;
Error += sizeof(glm::highp_f32mat3x2) != 24;
Error += sizeof(glm::highp_f32mat3x3) != 36;
Error += sizeof(glm::highp_f32mat3x4) != 48;
Error += sizeof(glm::highp_f32mat4x2) != 32;
Error += sizeof(glm::highp_f32mat4x3) != 48;
Error += sizeof(glm::highp_f32mat4x4) != 64;
return Error; return Error;
} }
static int test_dmat_size() static int test_dmat_size()
{ {
int Error = 0; int Error(0);
Error += sizeof(glm::f64mat2) != 32; Error += sizeof(glm::f64mat2) != 32;
Error += sizeof(glm::f64mat3) != 72; Error += sizeof(glm::f64mat3) != 72;
Error += sizeof(glm::f64mat4) != 128; Error += sizeof(glm::f64mat4) != 128;
Error += sizeof(glm::f64mat2x2) != 32; Error += sizeof(glm::f64mat2x2) != 32;
Error += sizeof(glm::f64mat2x3) != 48; Error += sizeof(glm::f64mat2x3) != 48;
Error += sizeof(glm::f64mat2x4) != 64; Error += sizeof(glm::f64mat2x4) != 64;
Error += sizeof(glm::f64mat3x2) != 48; Error += sizeof(glm::f64mat3x2) != 48;
Error += sizeof(glm::f64mat3x3) != 72; Error += sizeof(glm::f64mat3x3) != 72;
Error += sizeof(glm::f64mat3x4) != 96; Error += sizeof(glm::f64mat3x4) != 96;
Error += sizeof(glm::f64mat4x2) != 64; Error += sizeof(glm::f64mat4x2) != 64;
Error += sizeof(glm::f64mat4x3) != 96; Error += sizeof(glm::f64mat4x3) != 96;
Error += sizeof(glm::f64mat4x4) != 128; Error += sizeof(glm::f64mat4x4) != 128;
Error += sizeof(glm::lowp_f64mat2) != 32;
Error += sizeof(glm::lowp_f64mat3) != 72;
Error += sizeof(glm::lowp_f64mat4) != 128;
Error += sizeof(glm::lowp_f64mat2x2) != 32;
Error += sizeof(glm::lowp_f64mat2x3) != 48;
Error += sizeof(glm::lowp_f64mat2x4) != 64;
Error += sizeof(glm::lowp_f64mat3x2) != 48;
Error += sizeof(glm::lowp_f64mat3x3) != 72;
Error += sizeof(glm::lowp_f64mat3x4) != 96;
Error += sizeof(glm::lowp_f64mat4x2) != 64;
Error += sizeof(glm::lowp_f64mat4x3) != 96;
Error += sizeof(glm::lowp_f64mat4x4) != 128;
Error += sizeof(glm::mediump_f64mat2) != 32;
Error += sizeof(glm::mediump_f64mat3) != 72;
Error += sizeof(glm::mediump_f64mat4) != 128;
Error += sizeof(glm::mediump_f64mat2x2) != 32;
Error += sizeof(glm::mediump_f64mat2x3) != 48;
Error += sizeof(glm::mediump_f64mat2x4) != 64;
Error += sizeof(glm::mediump_f64mat3x2) != 48;
Error += sizeof(glm::mediump_f64mat3x3) != 72;
Error += sizeof(glm::mediump_f64mat3x4) != 96;
Error += sizeof(glm::mediump_f64mat4x2) != 64;
Error += sizeof(glm::mediump_f64mat4x3) != 96;
Error += sizeof(glm::mediump_f64mat4x4) != 128;
Error += sizeof(glm::highp_f64mat2) != 32;
Error += sizeof(glm::highp_f64mat3) != 72;
Error += sizeof(glm::highp_f64mat4) != 128;
Error += sizeof(glm::highp_f64mat2x2) != 32;
Error += sizeof(glm::highp_f64mat2x3) != 48;
Error += sizeof(glm::highp_f64mat2x4) != 64;
Error += sizeof(glm::highp_f64mat3x2) != 48;
Error += sizeof(glm::highp_f64mat3x3) != 72;
Error += sizeof(glm::highp_f64mat3x4) != 96;
Error += sizeof(glm::highp_f64mat4x2) != 64;
Error += sizeof(glm::highp_f64mat4x3) != 96;
Error += sizeof(glm::highp_f64mat4x4) != 128;
return Error; return Error;
} }
static int test_quat_size() static int test_quat_size()
{ {
int Error = 0; int Error = 0;
Error += sizeof(glm::f16quat) != 8; Error += sizeof(glm::lowp_f16quat) != 8;
Error += sizeof(glm::f32quat) != 16; Error += sizeof(glm::f32quat) != 16;
Error += sizeof(glm::f64quat) != 32; Error += sizeof(glm::f64quat) != 32;
Error += sizeof(glm::lowp_f16quat) != 8;
Error += sizeof(glm::lowp_f32quat) != 16;
Error += sizeof(glm::lowp_f64quat) != 32;
Error += sizeof(glm::mediump_f16quat) != 8;
Error += sizeof(glm::mediump_f32quat) != 16;
Error += sizeof(glm::mediump_f64quat) != 32;
Error += sizeof(glm::highp_f16quat) != 8;
Error += sizeof(glm::highp_f32quat) != 16;
Error += sizeof(glm::highp_f64quat) != 32;
return Error; return Error;
} }
int main() int main()
{ {
int Error = 0; int Error = 0;
Error += test_scalar_size(); Error += test_scalar_size();
Error += test_fvec_size(); Error += test_fvec_size();
Error += test_ivec_size(); Error += test_ivec_size();
Error += test_uvec_size(); Error += test_uvec_size();
Error += test_hmat_size(); Error += test_hmat_size();
Error += test_fmat_size(); Error += test_fmat_size();

@ -17,23 +17,23 @@
int myrand() int myrand()
{ {
static int holdrand = 1; static int holdrand = 1;
return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
} }
float myfrand() // returns values from -1 to 1 inclusive float myfrand() // returns values from -1 to 1 inclusive
{ {
return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f; return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f;
} }
int test_dquat_type() int test_dquat_type()
{ {
glm::dvec3 vA; glm::dvec3 vA;
glm::dquat dqA,dqB; glm::dquat dqA,dqB;
glm::ddualquat C(dqA,dqB); glm::ddualquat C(dqA,dqB);
glm::ddualquat B(dqA); glm::ddualquat B(dqA);
glm::ddualquat D(dqA,vA); glm::ddualquat D(dqA,vA);
return 0; return 0;
} }
int test_scalars() { int test_scalars() {
@ -76,7 +76,8 @@ int test_inverse()
glm::dualquat dqid; glm::dualquat dqid;
glm::mat4x4 mid(1.0f); glm::mat4x4 mid(1.0f);
for (int j = 0; j < 100; ++j) { for (int j = 0; j < 100; ++j)
{
glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f);
glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f);

Loading…
Cancel
Save