From b9ab6d94cc31d9353b8b943a82655a8c40c0086a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 6 Jun 2011 14:59:39 +0100 Subject: [PATCH] Removed namespaces --- glm/core/func_exponential.inl | 18 +++++++++--------- glm/core/func_geometric.hpp | 6 +++--- glm/core/type_half.hpp | 2 +- glm/core/type_int.hpp | 4 ++-- glm/gtc/quaternion.hpp | 15 ++++----------- glm/gtc/quaternion.inl | 14 +++++++------- glm/gtc/type_ptr.hpp | 2 ++ 7 files changed, 28 insertions(+), 33 deletions(-) diff --git a/glm/core/func_exponential.inl b/glm/core/func_exponential.inl index cf6c3c91..272149b7 100644 --- a/glm/core/func_exponential.inl +++ b/glm/core/func_exponential.inl @@ -272,8 +272,8 @@ namespace glm ) { return detail::tvec2( - sqrt(x.x), - sqrt(x.y)); + glm::sqrt(x.x), + glm::sqrt(x.y)); } template @@ -283,9 +283,9 @@ namespace glm ) { return detail::tvec3( - sqrt(x.x), - sqrt(x.y), - sqrt(x.z)); + glm::sqrt(x.x), + glm::sqrt(x.y), + glm::sqrt(x.z)); } template @@ -295,10 +295,10 @@ namespace glm ) { return detail::tvec4( - sqrt(x.x), - sqrt(x.y), - sqrt(x.z), - sqrt(x.w)); + glm::sqrt(x.x), + glm::sqrt(x.y), + glm::sqrt(x.z), + glm::sqrt(x.w)); } template diff --git a/glm/core/func_geometric.hpp b/glm/core/func_geometric.hpp index 728e9553..5534acd6 100644 --- a/glm/core/func_geometric.hpp +++ b/glm/core/func_geometric.hpp @@ -19,9 +19,9 @@ namespace glm //! //! \li GLSL length man page //! \li GLSL 1.30.08 specification, section 8.4 - template - typename genType::value_type length( - genType const & x); + //template + //typename genType::value_type length( + // genType const & x); //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). //! diff --git a/glm/core/type_half.hpp b/glm/core/type_half.hpp index 620c76ac..648d9114 100644 --- a/glm/core/type_half.hpp +++ b/glm/core/type_half.hpp @@ -20,7 +20,7 @@ namespace detail float toFloat32(hdata value); hdata toFloat16(float const & value); - ///16-bit floating point type. + /// 16-bit floating point type. /// \ingroup gtc_half_float class thalf { diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 90094d8a..0a57ddc1 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -74,11 +74,11 @@ namespace detail typedef detail::highp_uint_t highp_uint; #if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; + typedef mediump_int int_t; #elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) typedef highp_int int_t; #elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; + typedef mediump_int int_t; #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT)) typedef lowp_int int_t; #else diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index c384c7cb..94caa28e 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -152,7 +152,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun //! Returns the length of the quaternion. //! From GLM_GTC_quaternion extension. template - typename detail::tquat::value_type length( + T length( detail::tquat const & q); //! Returns the normalized quaternion. @@ -164,17 +164,10 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun //! Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... //! From GLM_GTC_quaternion extension. template - typename detail::tquat::value_type dot( + T dot( detail::tquat const & q1, detail::tquat const & q2); - //! Returns the cross product of q1 and q2. - //! From GLM_GTC_quaternion extension. - template - GLM_DEPRECATED detail::tquat cross( - detail::tquat const & q1, - detail::tquat const & q2); - //! Returns a SLERP interpolated quaternion of x and y according a. //! From GLM_GTC_quaternion extension. template @@ -254,8 +247,8 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun //! Quaternion of high precision floating-point numbers. //! From GLM_GTC_quaternion extension. typedef detail::tquat highp_quat; - ///@} - + + /// @} } //namespace quaternion } //namespace gtc } //namespace glm diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index a5ab33e0..37e10472 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -296,7 +296,7 @@ namespace quaternion{ //////////////////////////////////////////////////////// template - GLM_FUNC_QUALIFIER typename detail::tquat::value_type length + GLM_FUNC_QUALIFIER T length ( detail::tquat const & q ) @@ -318,7 +318,7 @@ namespace quaternion{ } template - GLM_FUNC_QUALIFIER typename detail::tquat::value_type dot + GLM_FUNC_QUALIFIER T dot ( detail::tquat const & q1, detail::tquat const & q2 @@ -462,8 +462,8 @@ namespace quaternion{ detail::tvec3 Tmp = v; // Axis of rotation must be normalised - typename detail::tquat::value_type len = glm::core::function::geometric::length(Tmp); - if(abs(len - typename detail::tquat::value_type(1)) > typename detail::tquat::value_type(0.001)) + typename detail::tquat::value_type len = glm::length(Tmp); + if(abs(len - T(1)) > T(0.001)) { T oneOverLen = T(1) / len; Tmp.x *= oneOverLen; @@ -483,7 +483,7 @@ namespace quaternion{ detail::tquat const & q ) { - detail::tmat3x3 Result(typename detail::tquat::value_type(1)); + detail::tmat3x3 Result(T(1)); Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; @@ -536,8 +536,8 @@ namespace quaternion{ biggestIndex = 3; } - typename detail::tquat::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + typename detail::tquat::value_type(1)) * typename detail::tquat::value_type(0.5); - typename detail::tquat::value_type mult = typename detail::tquat::value_type(0.25) / biggestVal; + typename detail::tquat::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); + typename detail::tquat::value_type mult = T(0.25) / biggestVal; detail::tquat Result; switch(biggestIndex) diff --git a/glm/gtc/type_ptr.hpp b/glm/gtc/type_ptr.hpp index da6f81c8..ab259f03 100644 --- a/glm/gtc/type_ptr.hpp +++ b/glm/gtc/type_ptr.hpp @@ -35,6 +35,8 @@ // Dependency: #include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtc/quaternion.hpp" #include #if(defined(GLM_MESSAGES) && !defined(glm_ext))