Removed namespaces

This commit is contained in:
Christophe Riccio 2011-06-06 14:59:39 +01:00
parent 6215aff4b4
commit b9ab6d94cc
7 changed files with 28 additions and 33 deletions

View File

@ -272,8 +272,8 @@ namespace glm
) )
{ {
return detail::tvec2<T>( return detail::tvec2<T>(
sqrt(x.x), glm::sqrt(x.x),
sqrt(x.y)); glm::sqrt(x.y));
} }
template <typename T> template <typename T>
@ -283,9 +283,9 @@ namespace glm
) )
{ {
return detail::tvec3<T>( return detail::tvec3<T>(
sqrt(x.x), glm::sqrt(x.x),
sqrt(x.y), glm::sqrt(x.y),
sqrt(x.z)); glm::sqrt(x.z));
} }
template <typename T> template <typename T>
@ -295,10 +295,10 @@ namespace glm
) )
{ {
return detail::tvec4<T>( return detail::tvec4<T>(
sqrt(x.x), glm::sqrt(x.x),
sqrt(x.y), glm::sqrt(x.y),
sqrt(x.z), glm::sqrt(x.z),
sqrt(x.w)); glm::sqrt(x.w));
} }
template <typename genType> template <typename genType>

View File

@ -19,9 +19,9 @@ namespace glm
//! //!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> //! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
//! \li GLSL 1.30.08 specification, section 8.4 //! \li GLSL 1.30.08 specification, section 8.4
template <typename genType> //template <typename genType>
typename genType::value_type length( //typename genType::value_type length(
genType const & x); // genType const & x);
//! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
//! //!

View File

@ -20,7 +20,7 @@ namespace detail
float toFloat32(hdata value); float toFloat32(hdata value);
hdata toFloat16(float const & value); hdata toFloat16(float const & value);
///16-bit floating point type. /// 16-bit floating point type.
/// \ingroup gtc_half_float /// \ingroup gtc_half_float
class thalf class thalf
{ {

View File

@ -74,11 +74,11 @@ namespace detail
typedef detail::highp_uint_t highp_uint; typedef detail::highp_uint_t highp_uint;
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) #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)) #elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef highp_int int_t; typedef highp_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) #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)) #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef lowp_int int_t; typedef lowp_int int_t;
#else #else

View File

@ -152,7 +152,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
//! Returns the length of the quaternion. //! Returns the length of the quaternion.
//! From GLM_GTC_quaternion extension. //! From GLM_GTC_quaternion extension.
template <typename T> template <typename T>
typename detail::tquat<T>::value_type length( T length(
detail::tquat<T> const & q); detail::tquat<T> const & q);
//! Returns the normalized quaternion. //! 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] + ... //! Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
//! From GLM_GTC_quaternion extension. //! From GLM_GTC_quaternion extension.
template <typename T> template <typename T>
typename detail::tquat<T>::value_type dot( T dot(
detail::tquat<T> const & q1, detail::tquat<T> const & q1,
detail::tquat<T> const & q2); detail::tquat<T> const & q2);
//! Returns the cross product of q1 and q2.
//! From GLM_GTC_quaternion extension.
template <typename T>
GLM_DEPRECATED detail::tquat<T> cross(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2);
//! Returns a SLERP interpolated quaternion of x and y according a. //! Returns a SLERP interpolated quaternion of x and y according a.
//! From GLM_GTC_quaternion extension. //! From GLM_GTC_quaternion extension.
template <typename T> template <typename T>
@ -254,8 +247,8 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
//! Quaternion of high precision floating-point numbers. //! Quaternion of high precision floating-point numbers.
//! From GLM_GTC_quaternion extension. //! From GLM_GTC_quaternion extension.
typedef detail::tquat<highp_float> highp_quat; typedef detail::tquat<highp_float> highp_quat;
///@}
/// @}
} //namespace quaternion } //namespace quaternion
} //namespace gtc } //namespace gtc
} //namespace glm } //namespace glm

View File

@ -296,7 +296,7 @@ namespace quaternion{
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER typename detail::tquat<T>::value_type length GLM_FUNC_QUALIFIER T length
( (
detail::tquat<T> const & q detail::tquat<T> const & q
) )
@ -318,7 +318,7 @@ namespace quaternion{
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER typename detail::tquat<T>::value_type dot GLM_FUNC_QUALIFIER T dot
( (
detail::tquat<T> const & q1, detail::tquat<T> const & q1,
detail::tquat<T> const & q2 detail::tquat<T> const & q2
@ -462,8 +462,8 @@ namespace quaternion{
detail::tvec3<T> Tmp = v; detail::tvec3<T> Tmp = v;
// Axis of rotation must be normalised // Axis of rotation must be normalised
typename detail::tquat<T>::value_type len = glm::core::function::geometric::length(Tmp); typename detail::tquat<T>::value_type len = glm::length(Tmp);
if(abs(len - typename detail::tquat<T>::value_type(1)) > typename detail::tquat<T>::value_type(0.001)) if(abs(len - T(1)) > T(0.001))
{ {
T oneOverLen = T(1) / len; T oneOverLen = T(1) / len;
Tmp.x *= oneOverLen; Tmp.x *= oneOverLen;
@ -483,7 +483,7 @@ namespace quaternion{
detail::tquat<T> const & q detail::tquat<T> const & q
) )
{ {
detail::tmat3x3<T> Result(typename detail::tquat<T>::value_type(1)); detail::tmat3x3<T> Result(T(1));
Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; 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][1] = 2 * q.x * q.y + 2 * q.w * q.z;
Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y;
@ -536,8 +536,8 @@ namespace quaternion{
biggestIndex = 3; biggestIndex = 3;
} }
typename detail::tquat<T>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + typename detail::tquat<T>::value_type(1)) * typename detail::tquat<T>::value_type(0.5); typename detail::tquat<T>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5);
typename detail::tquat<T>::value_type mult = typename detail::tquat<T>::value_type(0.25) / biggestVal; typename detail::tquat<T>::value_type mult = T(0.25) / biggestVal;
detail::tquat<T> Result; detail::tquat<T> Result;
switch(biggestIndex) switch(biggestIndex)

View File

@ -35,6 +35,8 @@
// Dependency: // Dependency:
#include "../glm.hpp" #include "../glm.hpp"
#include "../gtc/half_float.hpp"
#include "../gtc/quaternion.hpp"
#include <cstring> #include <cstring>
#if(defined(GLM_MESSAGES) && !defined(glm_ext)) #if(defined(GLM_MESSAGES) && !defined(glm_ext))