Browse Source

Reduced dependencies for GTC extensions

Christophe Riccio 12 years ago
parent
commit
950eaa45cb
44 changed files with 409 additions and 284 deletions
  1. 139 0
      glm/detail/_noise.hpp
  2. 3 3
      glm/detail/func_common.hpp
  3. 2 1
      glm/detail/func_exponential.hpp
  4. 0 1
      glm/detail/func_exponential.inl
  5. 1 1
      glm/detail/func_geometric.hpp
  6. 1 1
      glm/detail/func_integer.hpp
  7. 1 1
      glm/detail/func_matrix.hpp
  8. 5 1
      glm/detail/func_matrix.inl
  9. 1 1
      glm/detail/func_noise.hpp
  10. 14 11
      glm/detail/func_noise.inl
  11. 1 1
      glm/detail/func_packing.hpp
  12. 1 1
      glm/detail/func_trigonometric.hpp
  13. 2 0
      glm/detail/func_trigonometric.inl
  14. 1 1
      glm/detail/func_vector_relational.hpp
  15. 2 2
      glm/gtc/constants.hpp
  16. 2 0
      glm/gtc/constants.inl
  17. 11 12
      glm/gtc/epsilon.hpp
  18. 7 0
      glm/gtc/epsilon.inl
  19. 12 12
      glm/gtc/matrix_access.hpp
  20. 9 1
      glm/gtc/matrix_integer.hpp
  21. 3 3
      glm/gtc/matrix_inverse.hpp
  22. 4 0
      glm/gtc/matrix_inverse.inl
  23. 4 1
      glm/gtc/matrix_transform.hpp
  24. 3 0
      glm/gtc/matrix_transform.inl
  25. 9 9
      glm/gtc/noise.hpp
  26. 54 150
      glm/gtc/noise.inl
  27. 1 1
      glm/gtc/packing.hpp
  28. 9 3
      glm/gtc/packing.inl
  29. 9 6
      glm/gtc/quaternion.hpp
  30. 28 25
      glm/gtc/quaternion.inl
  31. 2 1
      glm/gtc/random.hpp
  32. 3 1
      glm/gtc/random.inl
  33. 2 2
      glm/gtc/reciprocal.hpp
  34. 3 0
      glm/gtc/reciprocal.inl
  35. 12 1
      glm/gtc/type_precision.hpp
  36. 12 1
      glm/gtc/type_ptr.hpp
  37. 2 2
      glm/gtc/ulp.hpp
  38. 23 22
      glm/gtc/ulp.inl
  39. 1 0
      glm/gtx/dual_quaternion.inl
  40. 1 0
      glm/gtx/intersect.inl
  41. 3 3
      glm/gtx/mixed_product.inl
  42. 1 0
      test/core/core_type_mat2x2.cpp
  43. 3 1
      test/core/core_type_mat3x3.cpp
  44. 2 1
      test/core/core_type_mat4x4.cpp

+ 139 - 0
glm/detail/_noise.hpp

@@ -0,0 +1,139 @@
+///////////////////////////////////////////////////////////////////////////////////
+/// OpenGL Mathematics (glm.g-truc.net)
+///
+/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
+/// Permission is hereby granted, free of charge, to any person obtaining a copy
+/// of this software and associated documentation files (the "Software"), to deal
+/// in the Software without restriction, including without limitation the rights
+/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+/// copies of the Software, and to permit persons to whom the Software is
+/// furnished to do so, subject to the following conditions:
+/// 
+/// The above copyright notice and this permission notice shall be included in
+/// all copies or substantial portions of the Software.
+/// 
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+/// THE SOFTWARE.
+///
+/// @ref core
+/// @file glm/detail/_noise.hpp
+/// @date 2013-12-24 / 2013-12-24
+/// @author Christophe Riccio
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef GLM_DETAIL_NOISE_INCLUDED
+#define GLM_DETAIL_NOISE_INCLUDED
+
+namespace glm{
+namespace detail
+{
+	template <typename T>
+	GLM_FUNC_QUALIFIER T mod289(T const & x)
+	{
+		return x - floor(x * T(1.0 / 289.0)) * T(289.0);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER T permute(T const & x)
+	{
+		return mod289(((x * T(34)) + T(1)) * x);
+	}
+
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P> const & x)
+	{
+		return mod289(((x * T(34)) + T(1)) * x);
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P> const & x)
+	{
+		return mod289(((x * T(34)) + T(1)) * x);
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P> const & x)
+	{
+		return mod289(((x * T(34)) + T(1)) * x);
+	}
+/*
+	template <typename T, precision P, template<typename> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x)
+	{
+		return mod289(((x * T(34)) + T(1)) * x);
+	}
+*/
+	template <typename T>
+	GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
+	{
+		return T(1.79284291400159) - T(0.85373472095314) * r;
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P> const & r)
+	{
+		return T(1.79284291400159) - T(0.85373472095314) * r;
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P> const & r)
+	{
+		return T(1.79284291400159) - T(0.85373472095314) * r;
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P> const & r)
+	{
+		return T(1.79284291400159) - T(0.85373472095314) * r;
+	}
+/*
+	template <typename T, precision P, template<typename> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r)
+	{
+		return T(1.79284291400159) - T(0.85373472095314) * r;
+	}
+*/
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec2<T, P> fade(detail::tvec2<T, P> const & t)
+	{
+		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec3<T, P> fade(detail::tvec3<T, P> const & t)
+	{
+		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
+	}
+	
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec4<T, P> fade(detail::tvec4<T, P> const & t)
+	{
+		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
+	}
+/*
+	template <typename T, precision P, template <typename> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t)
+	{
+		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
+	}
+*/
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER detail::tvec4<T, P> grad4(T const & j, detail::tvec4<T, P> const & ip)
+	{
+		detail::tvec3<T, P> pXYZ = floor(fract(detail::tvec3<T, P>(j) * detail::tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
+		T pW = static_cast<T>(1.5) - dot(abs(pXYZ), detail::tvec3<T, P>(1));
+		detail::tvec4<T, P> s = detail::tvec4<T, P>(lessThan(detail::tvec4<T, P>(pXYZ, pW), detail::tvec4<T, P>(0.0)));
+		pXYZ = pXYZ + (detail::tvec3<T, P>(s) * T(2) - T(1)) * s.w; 
+		return detail::tvec4<T, P>(pXYZ, pW);
+	}
+}//namespace detail
+}//namespace glm
+
+#endif//GLM_DETAIL_NOISE_INCLUDED
+

+ 3 - 3
glm/detail/func_common.hpp

@@ -33,8 +33,8 @@
 /// These all operate component-wise. The description is per component.
 /// These all operate component-wise. The description is per component.
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
-#ifndef GLM_CORE_func_common
-#define GLM_CORE_func_common GLM_VERSION
+#ifndef GLM_FUNC_COMMON_INCLUDED
+#define GLM_FUNC_COMMON_INCLUDED
 
 
 #include "setup.hpp"
 #include "setup.hpp"
 #include "_fixes.hpp"
 #include "_fixes.hpp"
@@ -455,4 +455,4 @@ namespace glm
 
 
 #include "func_common.inl"
 #include "func_common.inl"
 
 
-#endif//GLM_CORE_func_common
+#endif//GLM_FUNC_COMMON_INCLUDED

+ 2 - 1
glm/detail/func_exponential.hpp

@@ -34,12 +34,13 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef glm_core_func_exponential
 #ifndef glm_core_func_exponential
-#define glm_core_func_exponential GLM_VERSION
+#define glm_core_func_exponential
 
 
 #include "type_vec1.hpp"
 #include "type_vec1.hpp"
 #include "type_vec2.hpp"
 #include "type_vec2.hpp"
 #include "type_vec3.hpp"
 #include "type_vec3.hpp"
 #include "type_vec4.hpp"
 #include "type_vec4.hpp"
+#include <cmath>
 
 
 namespace glm
 namespace glm
 {
 {

+ 0 - 1
glm/detail/func_exponential.inl

@@ -30,7 +30,6 @@
 #include "_vectorize.hpp"
 #include "_vectorize.hpp"
 #include <limits>
 #include <limits>
 #include <cassert>
 #include <cassert>
-#include <cmath>
 
 
 namespace glm
 namespace glm
 {
 {

+ 1 - 1
glm/detail/func_geometric.hpp

@@ -34,7 +34,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef glm_core_func_geometric
 #ifndef glm_core_func_geometric
-#define glm_core_func_geometric GLM_VERSION
+#define glm_core_func_geometric
 
 
 #include "type_vec3.hpp"
 #include "type_vec3.hpp"
 
 

+ 1 - 1
glm/detail/func_integer.hpp

@@ -36,7 +36,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef glm_core_func_integer
 #ifndef glm_core_func_integer
-#define glm_core_func_integer GLM_VERSION
+#define glm_core_func_integer
 
 
 #include "setup.hpp"
 #include "setup.hpp"
 
 

+ 1 - 1
glm/detail/func_matrix.hpp

@@ -38,7 +38,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef GLM_CORE_func_matrix
 #ifndef GLM_CORE_func_matrix
-#define GLM_CORE_func_matrix GLM_VERSION
+#define GLM_CORE_func_matrix
 
 
 #include "type_mat2x2.hpp"
 #include "type_mat2x2.hpp"
 #include "type_mat2x3.hpp"
 #include "type_mat2x3.hpp"

+ 5 - 1
glm/detail/func_matrix.inl

@@ -26,7 +26,11 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
-#include "func_geometric.hpp"
+#include "../geometric.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
+#include <limits>
 
 
 namespace glm
 namespace glm
 {
 {

+ 1 - 1
glm/detail/func_noise.hpp

@@ -36,7 +36,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef glm_core_func_noise
 #ifndef glm_core_func_noise
-#define glm_core_func_noise GLM_VERSION
+#define glm_core_func_noise
 
 
 #include "type_vec1.hpp"
 #include "type_vec1.hpp"
 #include "type_vec2.hpp"
 #include "type_vec2.hpp"

+ 14 - 11
glm/detail/func_noise.inl

@@ -26,6 +26,9 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../detail/_noise.hpp"
+#include "./func_common.hpp"
+
 namespace glm
 namespace glm
 {
 {
 	template <typename T>
 	template <typename T>
@@ -87,8 +90,8 @@ namespace glm
 		
 		
 		// Permutations
 		// Permutations
 		i = mod(i, T(289)); // Avoid truncation effects in permutation
 		i = mod(i, T(289)); // Avoid truncation effects in permutation
-		detail::tvec3<T, P> p = permute(
-			permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1))) + i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
+		detail::tvec3<T, P> p = detail::permute(
+			detail::permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1))) + i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
 		
 		
 		detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
 		detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
 			dot(x0, x0),
 			dot(x0, x0),
@@ -145,7 +148,7 @@ namespace glm
 		
 		
 		// Permutations
 		// Permutations
 		i = mod289(i); 
 		i = mod289(i); 
-		detail::tvec4<T, P> p(permute(permute(permute(
+		detail::tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
 			i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
 			i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
 			i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
 			i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
 			i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
 			i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
@@ -248,8 +251,8 @@ namespace glm
 		
 		
 		// Permutations
 		// Permutations
 		i = mod(i, T(289));
 		i = mod(i, T(289));
-		T j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);
-		detail::tvec4<T, P> j1 = permute(permute(permute(permute(
+		T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
+		detail::tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
 			i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
 			i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
 			i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
 			i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
 			i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
 			i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
@@ -259,14 +262,14 @@ namespace glm
 		// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
 		// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
 		detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
 		detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
 		
 		
-		detail::tvec4<T, P> p0 = grad4(j0,   ip);
-		detail::tvec4<T, P> p1 = grad4(j1.x, ip);
-		detail::tvec4<T, P> p2 = grad4(j1.y, ip);
-		detail::tvec4<T, P> p3 = grad4(j1.z, ip);
-		detail::tvec4<T, P> p4 = grad4(j1.w, ip);
+		detail::tvec4<T, P> p0 = detail::grad4(j0,   ip);
+		detail::tvec4<T, P> p1 = detail::grad4(j1.x, ip);
+		detail::tvec4<T, P> p2 = detail::grad4(j1.y, ip);
+		detail::tvec4<T, P> p3 = detail::grad4(j1.z, ip);
+		detail::tvec4<T, P> p4 = detail::grad4(j1.w, ip);
 		
 		
 		// Normalise gradients
 		// Normalise gradients
-		detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
+		detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
 		p0 *= norm.x;
 		p0 *= norm.x;
 		p1 *= norm.y;
 		p1 *= norm.y;
 		p2 *= norm.z;
 		p2 *= norm.z;

+ 1 - 1
glm/detail/func_packing.hpp

@@ -34,7 +34,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef GLM_CORE_func_packing
 #ifndef GLM_CORE_func_packing
-#define GLM_CORE_func_packing GLM_VERSION
+#define GLM_CORE_func_packing
 
 
 #include "type_vec2.hpp"
 #include "type_vec2.hpp"
 #include "type_vec4.hpp"
 #include "type_vec4.hpp"

+ 1 - 1
glm/detail/func_trigonometric.hpp

@@ -38,7 +38,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef GLM_CORE_func_trigonometric
 #ifndef GLM_CORE_func_trigonometric
-#define GLM_CORE_func_trigonometric GLM_VERSION
+#define GLM_CORE_func_trigonometric
 
 
 namespace glm
 namespace glm
 {
 {

+ 2 - 0
glm/detail/func_trigonometric.inl

@@ -27,6 +27,8 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #include "_vectorize.hpp"
 #include "_vectorize.hpp"
+#include <cmath>
+#include <limits>
 
 
 namespace glm
 namespace glm
 {
 {

+ 1 - 1
glm/detail/func_vector_relational.hpp

@@ -39,7 +39,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 #ifndef GLM_CORE_func_vector_relational
 #ifndef GLM_CORE_func_vector_relational
-#define GLM_CORE_func_vector_relational GLM_VERSION
+#define GLM_CORE_func_vector_relational
 
 
 #include "precision.hpp"
 #include "precision.hpp"
 #include "setup.hpp"
 #include "setup.hpp"

+ 2 - 2
glm/gtc/constants.hpp

@@ -39,8 +39,8 @@
 #ifndef GLM_GTC_constants
 #ifndef GLM_GTC_constants
 #define GLM_GTC_constants
 #define GLM_GTC_constants
 
 
-// Dependency:
-#include "../glm.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_constants extension included")
 #	pragma message("GLM: GLM_GTC_constants extension included")

+ 2 - 0
glm/gtc/constants.inl

@@ -26,6 +26,8 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include <limits>
+
 namespace glm
 namespace glm
 {
 {
 	template <typename genType>
 	template <typename genType>

+ 11 - 12
glm/gtc/epsilon.hpp

@@ -40,9 +40,8 @@
 #ifndef GLM_GTC_epsilon
 #ifndef GLM_GTC_epsilon
 #define GLM_GTC_epsilon
 #define GLM_GTC_epsilon
 
 
-// Dependency:
-#include "../glm.hpp"
-#include "../gtc/quaternion.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_epsilon extension included")
 #	pragma message("GLM: GLM_GTC_epsilon extension included")
@@ -58,19 +57,19 @@ namespace glm
 	///
 	///
 	/// @see gtc_epsilon
 	/// @see gtc_epsilon
 	template <typename genType>
 	template <typename genType>
-	typename genType::boolType epsilonEqual(
+	typename genType::bool_type epsilonEqual(
 		genType const & x,
 		genType const & x,
 		genType const & y,
 		genType const & y,
-		typename genType::T const & epsilon);
+		typename genType::value_type const & epsilon);
 
 
 	/// Returns the component-wise comparison of |x - y| < epsilon.
 	/// Returns the component-wise comparison of |x - y| < epsilon.
 	/// True if this expression is satisfied.
 	/// True if this expression is satisfied.
 	///
 	///
 	/// @see gtc_epsilon
 	/// @see gtc_epsilon
-	template <typename genType> 
-	typename genType::boolType epsilonEqual(
-		genType const & x, 
-		genType const & y, 
+	template <typename genType>
+	typename genType::bool_type epsilonEqual(
+		genType const & x,
+		genType const & y,
 		genType const & epsilon);
 		genType const & epsilon);
 
 
 	/// Returns the component-wise comparison of |x - y| < epsilon.
 	/// Returns the component-wise comparison of |x - y| < epsilon.
@@ -81,7 +80,7 @@ namespace glm
 	typename genType::boolType epsilonNotEqual(
 	typename genType::boolType epsilonNotEqual(
 		genType const & x,
 		genType const & x,
 		genType const & y,
 		genType const & y,
-		typename genType::T const & epsilon);
+		typename genType::value_type const & epsilon);
 
 
 	/// Returns the component-wise comparison of |x - y| >= epsilon.
 	/// Returns the component-wise comparison of |x - y| >= epsilon.
 	/// True if this expression is not satisfied.
 	/// True if this expression is not satisfied.
@@ -89,8 +88,8 @@ namespace glm
 	/// @see gtc_epsilon
 	/// @see gtc_epsilon
 	template <typename genType>
 	template <typename genType>
 	typename genType::boolType epsilonNotEqual(
 	typename genType::boolType epsilonNotEqual(
-		genType const & x, 
-		genType const & y, 
+		genType const & x,
+		genType const & y,
 		genType const & epsilon);
 		genType const & epsilon);
 
 
 	/// @}
 	/// @}

+ 7 - 0
glm/gtc/epsilon.inl

@@ -26,6 +26,13 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+// Dependency:
+#include "quaternion.hpp"
+#include "../common.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
+
 namespace glm
 namespace glm
 {
 {
 	GLM_FUNC_QUALIFIER bool epsilonEqual
 	GLM_FUNC_QUALIFIER bool epsilonEqual

+ 12 - 12
glm/gtc/matrix_access.hpp

@@ -38,7 +38,7 @@
 #define GLM_GTC_matrix_access
 #define GLM_GTC_matrix_access
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_matrix_access extension included")
 #	pragma message("GLM: GLM_GTC_matrix_access extension included")
@@ -51,32 +51,32 @@ namespace glm
 
 
 	/// Get a specific row of a matrix.
 	/// Get a specific row of a matrix.
 	/// @see gtc_matrix_access
 	/// @see gtc_matrix_access
-	template <typename genType> 
+	template <typename genType>
 	typename genType::row_type row(
 	typename genType::row_type row(
 		genType const & m, 
 		genType const & m, 
-		typename genType::size_type const & index);
+		length_t const & index);
 
 
 	/// Set a specific row to a matrix.
 	/// Set a specific row to a matrix.
 	/// @see gtc_matrix_access
 	/// @see gtc_matrix_access
-	template <typename genType> 
+	template <typename genType>
 	genType row(
 	genType row(
-		genType const & m, 
-		typename genType::size_type const & index, 
+		genType const & m,
+		length_t const & index,
 		typename genType::row_type const & x);
 		typename genType::row_type const & x);
 
 
 	/// Get a specific column of a matrix.
 	/// Get a specific column of a matrix.
 	/// @see gtc_matrix_access
 	/// @see gtc_matrix_access
-	template <typename genType> 
+	template <typename genType>
 	typename genType::col_type column(
 	typename genType::col_type column(
-		genType const & m, 
-		typename genType::size_type const & index);
+		genType const & m,
+		length_t const & index);
 
 
 	/// Set a specific column to a matrix.
 	/// Set a specific column to a matrix.
 	/// @see gtc_matrix_access
 	/// @see gtc_matrix_access
-	template <typename genType> 
+	template <typename genType>
 	genType column(
 	genType column(
-		genType const & m, 
-		typename genType::size_type const & index, 
+		genType const & m,
+		length_t const & index,
 		typename genType::col_type const & x);
 		typename genType::col_type const & x);
 
 
 	/// @}
 	/// @}

+ 9 - 1
glm/gtc/matrix_integer.hpp

@@ -38,7 +38,15 @@
 #define GLM_GTC_matrix_integer
 #define GLM_GTC_matrix_integer
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "../mat2x2.hpp"
+#include "../mat2x3.hpp"
+#include "../mat2x4.hpp"
+#include "../mat3x2.hpp"
+#include "../mat3x3.hpp"
+#include "../mat3x4.hpp"
+#include "../mat4x2.hpp"
+#include "../mat4x3.hpp"
+#include "../mat4x4.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_matrix_integer extension included")
 #	pragma message("GLM: GLM_GTC_matrix_integer extension included")

+ 3 - 3
glm/gtc/matrix_inverse.hpp

@@ -37,8 +37,8 @@
 #ifndef GLM_GTC_matrix_inverse
 #ifndef GLM_GTC_matrix_inverse
 #define GLM_GTC_matrix_inverse
 #define GLM_GTC_matrix_inverse
 
 
-// Dependency:
-#include "../glm.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_matrix_inverse extension included")
 #	pragma message("GLM: GLM_GTC_matrix_inverse extension included")
@@ -55,7 +55,7 @@ namespace glm
 	/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
 	/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
 	/// @see gtc_matrix_inverse
 	/// @see gtc_matrix_inverse
 	template <typename genType> 
 	template <typename genType> 
-	genType affineInverse(genType const & m);
+	GLM_FUNC_QUALIFIER genType affineInverse(genType const & m);
 
 
 	/// Compute the inverse transpose of a matrix.
 	/// Compute the inverse transpose of a matrix.
 	/// 
 	/// 

+ 4 - 0
glm/gtc/matrix_inverse.inl

@@ -26,6 +26,10 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../mat2x2.hpp"
+#include "../mat3x3.hpp"
+#include "../mat4x4.hpp"
+
 namespace glm
 namespace glm
 {
 {
 	template <typename T, precision P>
 	template <typename T, precision P>

+ 4 - 1
glm/gtc/matrix_transform.hpp

@@ -47,7 +47,10 @@
 #define GLM_GTC_matrix_transform
 #define GLM_GTC_matrix_transform
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "../mat4x4.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_matrix_transform extension included")
 #	pragma message("GLM: GLM_GTC_matrix_transform extension included")

+ 3 - 0
glm/gtc/matrix_transform.inl

@@ -26,6 +26,9 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../geometric.hpp"
+#include "../trigonometric.hpp"
+
 namespace glm
 namespace glm
 {
 {
 	template <typename T, precision P>
 	template <typename T, precision P>

+ 9 - 9
glm/gtc/noise.hpp

@@ -41,8 +41,8 @@
 #ifndef GLM_GTC_noise
 #ifndef GLM_GTC_noise
 #define GLM_GTC_noise
 #define GLM_GTC_noise
 
 
-// Dependency:
-#include "../glm.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_noise extension included")
 #	pragma message("GLM: GLM_GTC_noise extension included")
@@ -55,22 +55,22 @@ namespace glm
 
 
 	/// Classic perlin noise.
 	/// Classic perlin noise.
 	/// @see gtc_noise
 	/// @see gtc_noise
-	template <typename T, template<typename> class vecType> 
+	template <typename T, precision P, template<typename, precision> class vecType>
 	T perlin(
 	T perlin(
-		vecType<T> const & p);
+		vecType<T, P> const & p);
 		
 		
 	/// Periodic perlin noise.
 	/// Periodic perlin noise.
 	/// @see gtc_noise
 	/// @see gtc_noise
-	template <typename T, template<typename> class vecType> 
+	template <typename T, precision P, template<typename, precision> class vecType>
 	T perlin(
 	T perlin(
-		vecType<T> const & p, 
-		vecType<T> const & rep);
+		vecType<T, P> const & p,
+		vecType<T, P> const & rep);
 
 
 	/// Simplex noise.
 	/// Simplex noise.
 	/// @see gtc_noise
 	/// @see gtc_noise
-	template <typename T, template<typename> class vecType> 
+	template <typename T, precision P, template<typename, precision> class vecType>
 	T simplex(
 	T simplex(
-		vecType<T> const & p);
+		vecType<T, P> const & p);
 
 
 	/// @}
 	/// @}
 }//namespace glm
 }//namespace glm

+ 54 - 150
glm/gtc/noise.inl

@@ -31,109 +31,13 @@
 // http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
 // http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../geometric.hpp"
+#include "../common.hpp"
+#include "../vector_relational.hpp"
+#include "../detail/_noise.hpp"
+
 namespace glm
 namespace glm
 {
 {
-	template <typename T>
-	GLM_FUNC_QUALIFIER T mod289(T const & x)
-	{
-		return x - floor(x * T(1.0 / 289.0)) * T(289.0);
-	}
-
-	template <typename T>
-	GLM_FUNC_QUALIFIER T permute(T const & x)
-	{
-		return mod289(((x * T(34)) + T(1)) * x);
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec2<T, P> permute(detail::tvec2<T, P> const & x)
-	{
-		return mod289(((x * T(34)) + T(1)) * x);
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec3<T, P> permute(detail::tvec3<T, P> const & x)
-	{
-		return mod289(((x * T(34)) + T(1)) * x);
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec4<T, P> permute(detail::tvec4<T, P> const & x)
-	{
-		return mod289(((x * T(34)) + T(1)) * x);
-	}
-/*
-	template <typename T, precision P, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x)
-	{
-		return mod289(((x * T(34)) + T(1)) * x);
-	}
-*/
-	template <typename T>
-	GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
-	{
-		return T(1.79284291400159) - T(0.85373472095314) * r;
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P> const & r)
-	{
-		return T(1.79284291400159) - T(0.85373472095314) * r;
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P> const & r)
-	{
-		return T(1.79284291400159) - T(0.85373472095314) * r;
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P> const & r)
-	{
-		return T(1.79284291400159) - T(0.85373472095314) * r;
-	}
-/*
-	template <typename T, precision P, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r)
-	{
-		return T(1.79284291400159) - T(0.85373472095314) * r;
-	}
-*/
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec2<T, P> fade(detail::tvec2<T, P> const & t)
-	{
-		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec3<T, P> fade(detail::tvec3<T, P> const & t)
-	{
-		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
-	}
-	
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec4<T, P> fade(detail::tvec4<T, P> const & t)
-	{
-		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
-	}
-/*
-	template <typename T, precision P, template <typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t)
-	{
-		return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
-	}
-*/
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER detail::tvec4<T, P> grad4(T const & j, detail::tvec4<T, P> const & ip)
-	{
-		detail::tvec3<T, P> pXYZ = floor(fract(detail::tvec3<T, P>(j) * detail::tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
-		T pW = static_cast<T>(1.5) - dot(abs(pXYZ), detail::tvec3<T, P>(1));
-		detail::tvec4<T, P> s = detail::tvec4<T, P>(lessThan(detail::tvec4<T, P>(pXYZ, pW), detail::tvec4<T, P>(0.0)));
-		pXYZ = pXYZ + (detail::tvec3<T, P>(s) * T(2) - T(1)) * s.w; 
-		return detail::tvec4<T, P>(pXYZ, pW);
-	}
-
 	// Classic Perlin noise
 	// Classic Perlin noise
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER T perlin(detail::tvec2<T, P> const & Position)
 	GLM_FUNC_QUALIFIER T perlin(detail::tvec2<T, P> const & Position)
@@ -146,7 +50,7 @@ namespace glm
 		detail::tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z);
 		detail::tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z);
 		detail::tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w);
 		detail::tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w);
 
 
-		detail::tvec4<T, P> i = glm::permute(glm::permute(ix) + iy);
+		detail::tvec4<T, P> i = detail::permute(detail::permute(ix) + iy);
 
 
 		detail::tvec4<T, P> gx = static_cast<T>(2) * glm::fract(i / T(41)) - T(1);
 		detail::tvec4<T, P> gx = static_cast<T>(2) * glm::fract(i / T(41)) - T(1);
 		detail::tvec4<T, P> gy = glm::abs(gx) - T(0.5);
 		detail::tvec4<T, P> gy = glm::abs(gx) - T(0.5);
@@ -190,9 +94,9 @@ namespace glm
 		detail::tvec4<T, P> iz0(Pi0.z);
 		detail::tvec4<T, P> iz0(Pi0.z);
 		detail::tvec4<T, P> iz1(Pi1.z);
 		detail::tvec4<T, P> iz1(Pi1.z);
 
 
-		detail::tvec4<T, P> ixy = permute(permute(ix) + iy);
-		detail::tvec4<T, P> ixy0 = permute(ixy + iz0);
-		detail::tvec4<T, P> ixy1 = permute(ixy + iz1);
+		detail::tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy);
+		detail::tvec4<T, P> ixy0 = detail::permute(ixy + iz0);
+		detail::tvec4<T, P> ixy1 = detail::permute(ixy + iz1);
 
 
 		detail::tvec4<T, P> gx0 = ixy0 * T(1.0 / 7.0);
 		detail::tvec4<T, P> gx0 = ixy0 * T(1.0 / 7.0);
 		detail::tvec4<T, P> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5);
 		detail::tvec4<T, P> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5);
@@ -219,12 +123,12 @@ namespace glm
 		detail::tvec3<T, P> g011(gx1.z, gy1.z, gz1.z);
 		detail::tvec3<T, P> g011(gx1.z, gy1.z, gz1.z);
 		detail::tvec3<T, P> g111(gx1.w, gy1.w, gz1.w);
 		detail::tvec3<T, P> g111(gx1.w, gy1.w, gz1.w);
 
 
-		detail::tvec4<T, P> norm0 = taylorInvSqrt(detail::tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
+		detail::tvec4<T, P> norm0 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
 		g000 *= norm0.x;
 		g000 *= norm0.x;
 		g010 *= norm0.y;
 		g010 *= norm0.y;
 		g100 *= norm0.z;
 		g100 *= norm0.z;
 		g110 *= norm0.w;
 		g110 *= norm0.w;
-		detail::tvec4<T, P> norm1 = taylorInvSqrt(detail::tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
+		detail::tvec4<T, P> norm1 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
 		g001 *= norm1.x;
 		g001 *= norm1.x;
 		g011 *= norm1.y;
 		g011 *= norm1.y;
 		g101 *= norm1.z;
 		g101 *= norm1.z;
@@ -336,13 +240,13 @@ namespace glm
 		detail::tvec4<T, P> iw0(Pi0.w);
 		detail::tvec4<T, P> iw0(Pi0.w);
 		detail::tvec4<T, P> iw1(Pi1.w);
 		detail::tvec4<T, P> iw1(Pi1.w);
 
 
-		detail::tvec4<T, P> ixy = permute(permute(ix) + iy);
-		detail::tvec4<T, P> ixy0 = permute(ixy + iz0);
-		detail::tvec4<T, P> ixy1 = permute(ixy + iz1);
-		detail::tvec4<T, P> ixy00 = permute(ixy0 + iw0);
-		detail::tvec4<T, P> ixy01 = permute(ixy0 + iw1);
-		detail::tvec4<T, P> ixy10 = permute(ixy1 + iw0);
-		detail::tvec4<T, P> ixy11 = permute(ixy1 + iw1);
+		detail::tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy);
+		detail::tvec4<T, P> ixy0 = detail::permute(ixy + iz0);
+		detail::tvec4<T, P> ixy1 = detail::permute(ixy + iz1);
+		detail::tvec4<T, P> ixy00 = detail::permute(ixy0 + iw0);
+		detail::tvec4<T, P> ixy01 = detail::permute(ixy0 + iw1);
+		detail::tvec4<T, P> ixy10 = detail::permute(ixy1 + iw0);
+		detail::tvec4<T, P> ixy11 = detail::permute(ixy1 + iw1);
 
 
 		detail::tvec4<T, P> gx00 = ixy00 / T(7);
 		detail::tvec4<T, P> gx00 = ixy00 / T(7);
 		detail::tvec4<T, P> gy00 = floor(gx00) / T(7);
 		detail::tvec4<T, P> gy00 = floor(gx00) / T(7);
@@ -405,25 +309,25 @@ namespace glm
 		detail::tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z);
 		detail::tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z);
 		detail::tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w);
 		detail::tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w);
 
 
-		detail::tvec4<T, P> norm00 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));
+		detail::tvec4<T, P> norm00 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));
 		g0000 *= norm00.x;
 		g0000 *= norm00.x;
 		g0100 *= norm00.y;
 		g0100 *= norm00.y;
 		g1000 *= norm00.z;
 		g1000 *= norm00.z;
 		g1100 *= norm00.w;
 		g1100 *= norm00.w;
 
 
-		detail::tvec4<T, P> norm01 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));
+		detail::tvec4<T, P> norm01 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));
 		g0001 *= norm01.x;
 		g0001 *= norm01.x;
 		g0101 *= norm01.y;
 		g0101 *= norm01.y;
 		g1001 *= norm01.z;
 		g1001 *= norm01.z;
 		g1101 *= norm01.w;
 		g1101 *= norm01.w;
 
 
-		detail::tvec4<T, P> norm10 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));
+		detail::tvec4<T, P> norm10 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));
 		g0010 *= norm10.x;
 		g0010 *= norm10.x;
 		g0110 *= norm10.y;
 		g0110 *= norm10.y;
 		g1010 *= norm10.z;
 		g1010 *= norm10.z;
 		g1110 *= norm10.w;
 		g1110 *= norm10.w;
 
 
-		detail::tvec4<T, P> norm11 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));
+		detail::tvec4<T, P> norm11 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));
 		g0011 *= norm11.x;
 		g0011 *= norm11.x;
 		g0111 *= norm11.y;
 		g0111 *= norm11.y;
 		g1011 *= norm11.z;
 		g1011 *= norm11.z;
@@ -468,7 +372,7 @@ namespace glm
 		detail::tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z);
 		detail::tvec4<T, P> fx(Pf.x, Pf.z, Pf.x, Pf.z);
 		detail::tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w);
 		detail::tvec4<T, P> fy(Pf.y, Pf.y, Pf.w, Pf.w);
 
 
-		detail::tvec4<T, P> i = permute(permute(ix) + iy);
+		detail::tvec4<T, P> i = detail::permute(detail::permute(ix) + iy);
 
 
 		detail::tvec4<T, P> gx = static_cast<T>(2) * fract(i / T(41)) - T(1);
 		detail::tvec4<T, P> gx = static_cast<T>(2) * fract(i / T(41)) - T(1);
 		detail::tvec4<T, P> gy = abs(gx) - T(0.5);
 		detail::tvec4<T, P> gy = abs(gx) - T(0.5);
@@ -480,7 +384,7 @@ namespace glm
 		detail::tvec2<T, P> g01(gx.z, gy.z);
 		detail::tvec2<T, P> g01(gx.z, gy.z);
 		detail::tvec2<T, P> g11(gx.w, gy.w);
 		detail::tvec2<T, P> g11(gx.w, gy.w);
 
 
-		detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));
+		detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));
 		g00 *= norm.x;
 		g00 *= norm.x;
 		g01 *= norm.y;
 		g01 *= norm.y;
 		g10 *= norm.z;
 		g10 *= norm.z;
@@ -512,9 +416,9 @@ namespace glm
 		detail::tvec4<T, P> iz0(Pi0.z);
 		detail::tvec4<T, P> iz0(Pi0.z);
 		detail::tvec4<T, P> iz1(Pi1.z);
 		detail::tvec4<T, P> iz1(Pi1.z);
 
 
-		detail::tvec4<T, P> ixy = permute(permute(ix) + iy);
-		detail::tvec4<T, P> ixy0 = permute(ixy + iz0);
-		detail::tvec4<T, P> ixy1 = permute(ixy + iz1);
+		detail::tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy);
+		detail::tvec4<T, P> ixy0 = detail::permute(ixy + iz0);
+		detail::tvec4<T, P> ixy1 = detail::permute(ixy + iz1);
 
 
 		detail::tvec4<T, P> gx0 = ixy0 / T(7);
 		detail::tvec4<T, P> gx0 = ixy0 / T(7);
 		detail::tvec4<T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5);
 		detail::tvec4<T, P> gy0 = fract(floor(gx0) / T(7)) - T(0.5);
@@ -541,12 +445,12 @@ namespace glm
 		detail::tvec3<T, P> g011 = detail::tvec3<T, P>(gx1.z, gy1.z, gz1.z);
 		detail::tvec3<T, P> g011 = detail::tvec3<T, P>(gx1.z, gy1.z, gz1.z);
 		detail::tvec3<T, P> g111 = detail::tvec3<T, P>(gx1.w, gy1.w, gz1.w);
 		detail::tvec3<T, P> g111 = detail::tvec3<T, P>(gx1.w, gy1.w, gz1.w);
 
 
-		detail::tvec4<T, P> norm0 = taylorInvSqrt(detail::tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
+		detail::tvec4<T, P> norm0 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));
 		g000 *= norm0.x;
 		g000 *= norm0.x;
 		g010 *= norm0.y;
 		g010 *= norm0.y;
 		g100 *= norm0.z;
 		g100 *= norm0.z;
 		g110 *= norm0.w;
 		g110 *= norm0.w;
-		detail::tvec4<T, P> norm1 = taylorInvSqrt(detail::tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
+		detail::tvec4<T, P> norm1 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));
 		g001 *= norm1.x;
 		g001 *= norm1.x;
 		g011 *= norm1.y;
 		g011 *= norm1.y;
 		g101 *= norm1.z;
 		g101 *= norm1.z;
@@ -564,7 +468,7 @@ namespace glm
 		detail::tvec3<T, P> fade_xyz = fade(Pf0);
 		detail::tvec3<T, P> fade_xyz = fade(Pf0);
 		detail::tvec4<T, P> n_z = mix(detail::tvec4<T, P>(n000, n100, n010, n110), detail::tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z);
 		detail::tvec4<T, P> n_z = mix(detail::tvec4<T, P>(n000, n100, n010, n110), detail::tvec4<T, P>(n001, n101, n011, n111), fade_xyz.z);
 		detail::tvec2<T, P> n_yz = mix(detail::tvec2<T, P>(n_z.x, n_z.y), detail::tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y);
 		detail::tvec2<T, P> n_yz = mix(detail::tvec2<T, P>(n_z.x, n_z.y), detail::tvec2<T, P>(n_z.z, n_z.w), fade_xyz.y);
-		T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 
+		T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
 		return T(2.2) * n_xyz;
 		return T(2.2) * n_xyz;
 	}
 	}
 
 
@@ -583,13 +487,13 @@ namespace glm
 		detail::tvec4<T, P> iw0(Pi0.w);
 		detail::tvec4<T, P> iw0(Pi0.w);
 		detail::tvec4<T, P> iw1(Pi1.w);
 		detail::tvec4<T, P> iw1(Pi1.w);
 
 
-		detail::tvec4<T, P> ixy = permute(permute(ix) + iy);
-		detail::tvec4<T, P> ixy0 = permute(ixy + iz0);
-		detail::tvec4<T, P> ixy1 = permute(ixy + iz1);
-		detail::tvec4<T, P> ixy00 = permute(ixy0 + iw0);
-		detail::tvec4<T, P> ixy01 = permute(ixy0 + iw1);
-		detail::tvec4<T, P> ixy10 = permute(ixy1 + iw0);
-		detail::tvec4<T, P> ixy11 = permute(ixy1 + iw1);
+		detail::tvec4<T, P> ixy = detail::permute(detail::permute(ix) + iy);
+		detail::tvec4<T, P> ixy0 = detail::permute(ixy + iz0);
+		detail::tvec4<T, P> ixy1 = detail::permute(ixy + iz1);
+		detail::tvec4<T, P> ixy00 = detail::permute(ixy0 + iw0);
+		detail::tvec4<T, P> ixy01 = detail::permute(ixy0 + iw1);
+		detail::tvec4<T, P> ixy10 = detail::permute(ixy1 + iw0);
+		detail::tvec4<T, P> ixy11 = detail::permute(ixy1 + iw1);
 
 
 		detail::tvec4<T, P> gx00 = ixy00 / T(7);
 		detail::tvec4<T, P> gx00 = ixy00 / T(7);
 		detail::tvec4<T, P> gy00 = floor(gx00) / T(7);
 		detail::tvec4<T, P> gy00 = floor(gx00) / T(7);
@@ -652,13 +556,13 @@ namespace glm
 		detail::tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z);
 		detail::tvec4<T, P> g0111(gx11.z, gy11.z, gz11.z, gw11.z);
 		detail::tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w);
 		detail::tvec4<T, P> g1111(gx11.w, gy11.w, gz11.w, gw11.w);
 
 
-		detail::tvec4<T, P> norm00 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));
+		detail::tvec4<T, P> norm00 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));
 		g0000 *= norm00.x;
 		g0000 *= norm00.x;
 		g0100 *= norm00.y;
 		g0100 *= norm00.y;
 		g1000 *= norm00.z;
 		g1000 *= norm00.z;
 		g1100 *= norm00.w;
 		g1100 *= norm00.w;
 
 
-		detail::tvec4<T, P> norm01 = taylorInvSqrt(detail::tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));
+		detail::tvec4<T, P> norm01 = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));
 		g0001 *= norm01.x;
 		g0001 *= norm01.x;
 		g0101 *= norm01.y;
 		g0101 *= norm01.y;
 		g1001 *= norm01.z;
 		g1001 *= norm01.z;
@@ -727,8 +631,8 @@ namespace glm
 
 
 		// Permutations
 		// Permutations
 		i = mod(i, T(289)); // Avoid truncation effects in permutation
 		i = mod(i, T(289)); // Avoid truncation effects in permutation
-		detail::tvec3<T, P> p = permute(
-			permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1)))
+		detail::tvec3<T, P> p = detail::permute(
+			detail::permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1)))
 			+ i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
 			+ i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
 
 
 		detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
 		detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
@@ -785,9 +689,9 @@ namespace glm
 
 
 		// Permutations
 		// Permutations
 		i = mod289(i); 
 		i = mod289(i); 
-		detail::tvec4<T, P> p(permute(permute(permute( 
-			i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) + 
-			i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) + 
+		detail::tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
+			i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
+			i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
 			i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
 			i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
 
 
 		// Gradients: 7x7 points over a square, mapped onto an octahedron.
 		// Gradients: 7x7 points over a square, mapped onto an octahedron.
@@ -822,7 +726,7 @@ namespace glm
 		detail::tvec3<T, P> p3(a1.z, a1.w, h.w);
 		detail::tvec3<T, P> p3(a1.z, a1.w, h.w);
 
 
 		// Normalise gradients
 		// Normalise gradients
-		detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
+		detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
 		p0 *= norm.x;
 		p0 *= norm.x;
 		p1 *= norm.y;
 		p1 *= norm.y;
 		p2 *= norm.z;
 		p2 *= norm.z;
@@ -885,8 +789,8 @@ namespace glm
 
 
 		// Permutations
 		// Permutations
 		i = mod(i, T(289)); 
 		i = mod(i, T(289)); 
-		T j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);
-		detail::tvec4<T, P> j1 = permute(permute(permute(permute(
+		T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
+		detail::tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
 					i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1)))
 					i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1)))
 				+ i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1)))
 				+ i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1)))
 				+ i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1)))
 				+ i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1)))
@@ -896,19 +800,19 @@ namespace glm
 		// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
 		// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
 		detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
 		detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
 
 
-		detail::tvec4<T, P> p0 = grad4(j0,   ip);
-		detail::tvec4<T, P> p1 = grad4(j1.x, ip);
-		detail::tvec4<T, P> p2 = grad4(j1.y, ip);
-		detail::tvec4<T, P> p3 = grad4(j1.z, ip);
-		detail::tvec4<T, P> p4 = grad4(j1.w, ip);
+		detail::tvec4<T, P> p0 = detail::grad4(j0,   ip);
+		detail::tvec4<T, P> p1 = detail::grad4(j1.x, ip);
+		detail::tvec4<T, P> p2 = detail::grad4(j1.y, ip);
+		detail::tvec4<T, P> p3 = detail::grad4(j1.z, ip);
+		detail::tvec4<T, P> p4 = detail::grad4(j1.w, ip);
 
 
 		// Normalise gradients
 		// Normalise gradients
-		detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
+		detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
 		p0 *= norm.x;
 		p0 *= norm.x;
 		p1 *= norm.y;
 		p1 *= norm.y;
 		p2 *= norm.z;
 		p2 *= norm.z;
 		p3 *= norm.w;
 		p3 *= norm.w;
-		p4 *= taylorInvSqrt(dot(p4, p4));
+		p4 *= detail::taylorInvSqrt(dot(p4, p4));
 
 
 		// Mix contributions from the five corners
 		// Mix contributions from the five corners
 		detail::tvec3<T, P> m0 = max(T(0.6) - detail::tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
 		detail::tvec3<T, P> m0 = max(T(0.6) - detail::tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));

+ 1 - 1
glm/gtc/packing.hpp

@@ -40,7 +40,7 @@
 #define GLM_GTC_packing
 #define GLM_GTC_packing
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "type_precision.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_packing extension included")
 #	pragma message("GLM: GLM_GTC_packing extension included")

+ 9 - 3
glm/gtc/packing.inl

@@ -26,6 +26,12 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../common.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
+#include "../detail/type_half.hpp"
+
 namespace glm{
 namespace glm{
 namespace detail
 namespace detail
 {
 {
@@ -42,9 +48,9 @@ namespace detail
 		// 0x7f800000 => 01111111 10000000 00000000 00000000
 		// 0x7f800000 => 01111111 10000000 00000000 00000000
 		// 0x00008000 => 00000000 00000000 10000000 00000000
 		// 0x00008000 => 00000000 00000000 10000000 00000000
 		return
 		return
-		((f >> 16) & 0x8000) | // sign
-		((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential
-		((f >> 13) & 0x03ff); // Mantissa
+			((f >> 16) & 0x8000) | // sign
+			((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential
+			((f >> 13) & 0x03ff); // Mantissa
 	}
 	}
 
 
 	GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 const & f)
 	GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 const & f)

+ 9 - 6
glm/gtc/quaternion.hpp

@@ -41,7 +41,10 @@
 #define GLM_GTC_quaternion
 #define GLM_GTC_quaternion
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "../mat3x3.hpp"
+#include "../mat4x4.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
 #include "../gtc/constants.hpp"
 #include "../gtc/constants.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
@@ -61,7 +64,7 @@ namespace detail
 	public:
 	public:
 		T x, y, z, w;
 		T x, y, z, w;
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR int length() const;
+		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 
 
 		// Constructors
 		// Constructors
 		GLM_FUNC_DECL tquat();
 		GLM_FUNC_DECL tquat();
@@ -102,12 +105,12 @@ namespace detail
 			tmat4x4<T, P> const & m);
 			tmat4x4<T, P> const & m);
 
 
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL T & operator[](int i);
-		GLM_FUNC_DECL T const & operator[](int i) const;
+		GLM_FUNC_DECL T & operator[](length_t i);
+		GLM_FUNC_DECL T const & operator[](length_t i) const;
 
 
 		// Operators
 		// Operators
-    GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<T, P> const & q);
-    GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<T, P> const & q);
+		GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<T, P> const & q);
+		GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<T, P> const & q);
 		GLM_FUNC_DECL tquat<T, P> & operator*=(T const & s);
 		GLM_FUNC_DECL tquat<T, P> & operator*=(T const & s);
 		GLM_FUNC_DECL tquat<T, P> & operator/=(T const & s);
 		GLM_FUNC_DECL tquat<T, P> & operator/=(T const & s);
 	};
 	};

+ 28 - 25
glm/gtc/quaternion.inl

@@ -26,13 +26,16 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../trigonometric.hpp"
+#include "../geometric.hpp"
+#include "../exponential.hpp"
 #include <limits>
 #include <limits>
 
 
 namespace glm{
 namespace glm{
 namespace detail
 namespace detail
 {
 {
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR int tquat<T, P>::length() const
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tquat<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
@@ -166,14 +169,14 @@ namespace detail
 	// tquat<T, P> accesses
 	// tquat<T, P> accesses
 
 
 	template <typename T, precision P> 
 	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[] (int i)
+	GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[] (length_t i)
 	{
 	{
 		assert(i >= 0 && i < this->length());
 		assert(i >= 0 && i < this->length());
 		return (&x)[i];
 		return (&x)[i];
 	}
 	}
 
 
-	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[] (int i) const
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[] (length_t i) const
 	{
 	{
 		assert(i >= 0 && i < this->length());
 		assert(i >= 0 && i < this->length());
 		return (&x)[i];
 		return (&x)[i];
@@ -182,34 +185,34 @@ namespace detail
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// tquat<valType> operators
 	// tquat<valType> operators
 
 
-  template <typename T, precision P>
-  GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator +=
-  (
-   tquat<T, P> const & q
-  )
-  {
-    this->w += q.w;
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator +=
+	(
+		tquat<T, P> const & q
+	)
+	{
+		this->w += q.w;
 		this->x += q.x;
 		this->x += q.x;
 		this->y += q.y;
 		this->y += q.y;
 		this->z += q.z;
 		this->z += q.z;
 		return *this;
 		return *this;
-  }
-
-  template <typename T, precision P>
-  GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
-  (
-   tquat<T, P> const & q
-  )
-  {
-    tquat<T, P> const p(*this);
-    
-    this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z;
+	}
+
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
+	(
+		tquat<T, P> const & q
+	)
+	{
+		tquat<T, P> const p(*this);
+
+		this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z;
 		this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y;
 		this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y;
 		this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z;
 		this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z;
 		this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x;
 		this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x;
 		return *this;
 		return *this;
-  }
-    
+	}
+
 	template <typename T, precision P> 
 	template <typename T, precision P> 
 	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
 	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
 	(
 	(
@@ -222,7 +225,7 @@ namespace detail
 		this->z *= s;
 		this->z *= s;
 		return *this;
 		return *this;
 	}
 	}
-    
+
 	template <typename T, precision P> 
 	template <typename T, precision P> 
 	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator /=
 	GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator /=
 	(
 	(

+ 2 - 1
glm/gtc/random.hpp

@@ -41,7 +41,8 @@
 #define GLM_GTC_random
 #define GLM_GTC_random
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_random extension included")
 #	pragma message("GLM: GLM_GTC_random extension included")

+ 3 - 1
glm/gtc/random.inl

@@ -26,6 +26,8 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../geometric.hpp"
+#include "../exponential.hpp"
 #include <cstdlib>
 #include <cstdlib>
 #include <ctime>
 #include <ctime>
 #include <cassert>
 #include <cassert>
@@ -67,7 +69,7 @@ namespace detail
 	template <typename genType> 
 	template <typename genType> 
 	GLM_FUNC_QUALIFIER genType linearRand
 	GLM_FUNC_QUALIFIER genType linearRand
 	(
 	(
-		genType const & Min, 
+		genType const & Min,
 		genType const & Max
 		genType const & Max
 	)
 	)
 	{
 	{

+ 2 - 2
glm/gtc/reciprocal.hpp

@@ -38,8 +38,8 @@
 #ifndef GLM_GTC_reciprocal
 #ifndef GLM_GTC_reciprocal
 #define GLM_GTC_reciprocal
 #define GLM_GTC_reciprocal
 
 
-// Dependency:
-#include "../glm.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_reciprocal extension included")
 #	pragma message("GLM: GLM_GTC_reciprocal extension included")

+ 3 - 0
glm/gtc/reciprocal.inl

@@ -26,6 +26,9 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../trigonometric.hpp"
+#include <limits>
+
 namespace glm
 namespace glm
 {
 {
 	// sec
 	// sec

+ 12 - 1
glm/gtc/type_precision.hpp

@@ -44,8 +44,19 @@
 #define GLM_GTC_type_precision
 #define GLM_GTC_type_precision
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
 #include "../gtc/quaternion.hpp"
 #include "../gtc/quaternion.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
+#include "../mat2x2.hpp"
+#include "../mat2x3.hpp"
+#include "../mat2x4.hpp"
+#include "../mat3x2.hpp"
+#include "../mat3x3.hpp"
+#include "../mat3x4.hpp"
+#include "../mat4x2.hpp"
+#include "../mat4x3.hpp"
+#include "../mat4x4.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_type_precision extension included")
 #	pragma message("GLM: GLM_GTC_type_precision extension included")

+ 12 - 1
glm/gtc/type_ptr.hpp

@@ -60,8 +60,19 @@
 #define GLM_GTC_type_ptr
 #define GLM_GTC_type_ptr
 
 
 // Dependency:
 // Dependency:
-#include "../glm.hpp"
 #include "../gtc/quaternion.hpp"
 #include "../gtc/quaternion.hpp"
+#include "../vec2.hpp"
+#include "../vec3.hpp"
+#include "../vec4.hpp"
+#include "../mat2x2.hpp"
+#include "../mat2x3.hpp"
+#include "../mat2x4.hpp"
+#include "../mat3x2.hpp"
+#include "../mat3x3.hpp"
+#include "../mat3x4.hpp"
+#include "../mat4x2.hpp"
+#include "../mat4x3.hpp"
+#include "../mat4x4.hpp"
 #include <cstring>
 #include <cstring>
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))

+ 2 - 2
glm/gtc/ulp.hpp

@@ -39,8 +39,8 @@
 #ifndef GLM_GTC_ulp
 #ifndef GLM_GTC_ulp
 #define GLM_GTC_ulp
 #define GLM_GTC_ulp
 
 
-// Dependency:
-#include "../glm.hpp"
+// Dependencies
+#include "../detail/setup.hpp"
 
 
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
 #	pragma message("GLM: GLM_GTC_ulp extension included")
 #	pragma message("GLM: GLM_GTC_ulp extension included")

+ 23 - 22
glm/gtc/ulp.inl

@@ -33,6 +33,7 @@
 /// is preserved.
 /// is preserved.
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../detail/type_int.hpp"
 #include <cmath>
 #include <cmath>
 #include <cfloat>
 #include <cfloat>
 
 
@@ -212,11 +213,11 @@ namespace glm
 		return GLM_NEXT_AFTER_DBL(x, std::numeric_limits<double>::max());
 		return GLM_NEXT_AFTER_DBL(x, std::numeric_limits<double>::max());
 	}
 	}
 
 
-	template<typename T, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T> next_float(vecType<T> const & x)
+	template<typename T, precision P, template<typename, precision> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x)
 	{
 	{
-		vecType<T> Result;
-		for(std::size_t i = 0; i < Result.length(); ++i)
+		vecType<T, P> Result;
+		for(length_t i = 0; i < Result.length(); ++i)
 			Result[i] = next_float(x[i]);
 			Result[i] = next_float(x[i]);
 		return Result;
 		return Result;
 	}
 	}
@@ -231,11 +232,11 @@ namespace glm
 		return GLM_NEXT_AFTER_DBL(x, std::numeric_limits<double>::min());
 		return GLM_NEXT_AFTER_DBL(x, std::numeric_limits<double>::min());
 	}
 	}
 
 
-	template<typename T, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T> prev_float(vecType<T> const & x)
+	template<typename T, precision P, template<typename, precision> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x)
 	{
 	{
-		vecType<T> Result;
-		for(std::size_t i = 0; i < Result.length(); ++i)
+		vecType<T, P> Result;
+		for(length_t i = 0; i < Result.length(); ++i)
 			Result[i] = prev_float(x[i]);
 			Result[i] = prev_float(x[i]);
 		return Result;
 		return Result;
 	}
 	}
@@ -244,16 +245,16 @@ namespace glm
 	GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps)
 	GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps)
 	{
 	{
 		T temp = x;
 		T temp = x;
-		for(std::size_t i = 0; i < ulps; ++i)
+		for(length_t i = 0; i < ulps; ++i)
 			temp = next_float(temp);
 			temp = next_float(temp);
 		return temp;
 		return temp;
 	}
 	}
 
 
-	template<typename T, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T> next_float(vecType<T> const & x, vecType<uint> const & ulps)
+	template<typename T, precision P, template<typename, precision> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x, vecType<uint, P> const & ulps)
 	{
 	{
-		vecType<T> Result;
-		for(std::size_t i = 0; i < Result.length(); ++i)
+		vecType<T, P> Result;
+		for(length_t i = 0; i < Result.length(); ++i)
 			Result[i] = next_float(x[i], ulps[i]);
 			Result[i] = next_float(x[i], ulps[i]);
 		return Result;
 		return Result;
 	}
 	}
@@ -262,16 +263,16 @@ namespace glm
 	GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps)
 	GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps)
 	{
 	{
 		T temp = x;
 		T temp = x;
-		for(std::size_t i = 0; i < ulps; ++i)
+		for(length_t i = 0; i < ulps; ++i)
 			temp = prev_float(temp);
 			temp = prev_float(temp);
 		return temp;
 		return temp;
 	}
 	}
 
 
-	template<typename T, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<T> prev_float(vecType<T> const & x, vecType<uint> const & ulps)
+	template<typename T, precision P, template<typename, precision> class vecType>
+	GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x, vecType<uint, P> const & ulps)
 	{
 	{
-		vecType<T> Result;
-		for(std::size_t i = 0; i < Result.length(); ++i)
+		vecType<T, P> Result;
+		for(length_t i = 0; i < Result.length(); ++i)
 			Result[i] = prev_float(x[i], ulps[i]);
 			Result[i] = prev_float(x[i], ulps[i]);
 		return Result;
 		return Result;
 	}
 	}
@@ -307,11 +308,11 @@ namespace glm
 		return ulp;
 		return ulp;
 	}
 	}
 
 
-	template<typename T, template<typename> class vecType>
-	GLM_FUNC_QUALIFIER vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y)
+	template<typename T, precision P, template<typename, precision> class vecType>
+	GLM_FUNC_QUALIFIER vecType<uint, P> float_distance(vecType<T, P> const & x, vecType<T, P> const & y)
 	{
 	{
-		vecType<uint> Result;
-		for(std::size_t i = 0; i < Result.length(); ++i)
+		vecType<uint, P> Result;
+		for(length_t i = 0; i < Result.length(); ++i)
 			Result[i] = float_distance(x[i], y[i]);
 			Result[i] = float_distance(x[i], y[i]);
 		return Result;
 		return Result;
 	}
 	}

+ 1 - 0
glm/gtx/dual_quaternion.inl

@@ -26,6 +26,7 @@
 /// @author Maksim Vorobiev ([email protected])
 /// @author Maksim Vorobiev ([email protected])
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../geometric.hpp"
 #include <limits>
 #include <limits>
 
 
 namespace glm{
 namespace glm{

+ 1 - 0
glm/gtx/intersect.inl

@@ -7,6 +7,7 @@
 // File    : glm/gtx/intersect.inl
 // File    : glm/gtx/intersect.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
+#include "../geometric.hpp"
 #include <cfloat>
 #include <cfloat>
 #include <limits>
 #include <limits>
 
 

+ 3 - 3
glm/gtx/mixed_product.inl

@@ -9,11 +9,11 @@
 
 
 namespace glm
 namespace glm
 {
 {
-	template <typename T, precision P> 
+	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER T mixedProduct
 	GLM_FUNC_QUALIFIER T mixedProduct
 	(
 	(
-		detail::tvec3<T, P> const & v1, 
-		detail::tvec3<T, P> const & v2, 
+		detail::tvec3<T, P> const & v1,
+		detail::tvec3<T, P> const & v2,
 		detail::tvec3<T, P> const & v3
 		detail::tvec3<T, P> const & v3
 	)
 	)
 	{
 	{

+ 1 - 0
test/core/core_type_mat2x2.cpp

@@ -8,6 +8,7 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 #include <glm/gtc/epsilon.hpp>
 #include <glm/gtc/epsilon.hpp>
+#include <glm/matrix.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/mat2x2.hpp>
 #include <glm/mat2x2.hpp>
 #include <vector>
 #include <vector>

+ 3 - 1
test/core/core_type_mat3x3.cpp

@@ -7,8 +7,10 @@
 // File    : test/core/type_mat3x3.cpp
 // File    : test/core/type_mat3x3.cpp
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
-#include <glm/mat3x3.hpp>
 #include <glm/gtc/epsilon.hpp>
 #include <glm/gtc/epsilon.hpp>
+#include <glm/matrix.hpp>
+#include <glm/vector_relational.hpp>
+#include <glm/mat3x3.hpp>
 #include <cstdio>
 #include <cstdio>
 #include <vector>
 #include <vector>
 
 

+ 2 - 1
test/core/core_type_mat4x4.cpp

@@ -7,8 +7,9 @@
 // File    : test/core/type_mat4x4.cpp
 // File    : test/core/type_mat4x4.cpp
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
-#include <glm/mat4x4.hpp>
 #include <glm/gtc/epsilon.hpp>
 #include <glm/gtc/epsilon.hpp>
+#include <glm/matrix.hpp>
+#include <glm/mat4x4.hpp>
 #include <cstdio>
 #include <cstdio>
 #include <vector>
 #include <vector>