From 493c5a56147fe79ee430d40904638576a7ab1e5d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 7 Jun 2011 01:13:51 +0100 Subject: [PATCH] Removed GTC extensions namespace --- glm/gtc/half_float.hpp | 7 +- glm/gtc/matrix_access.hpp | 6 +- glm/gtc/matrix_integer.hpp | 9 +- glm/gtc/matrix_inverse.hpp | 13 +-- glm/gtc/matrix_inverse.inl | 4 +- glm/gtc/matrix_transform.hpp | 10 +- glm/gtc/matrix_transform.inl | 7 +- glm/gtc/quaternion.hpp | 10 +- glm/gtc/quaternion.inl | 10 +- glm/gtc/swizzle.hpp | 3 - glm/gtc/type_precision.hpp | 17 +-- glm/gtc/type_ptr.hpp | 15 +-- glm/gtx/bit.hpp | 2 - glm/gtx/bit.inl | 6 +- glm/gtx/color_cast.hpp | 84 +++++++------- glm/gtx/color_cast.inl | 212 +++++++++++++++++------------------ glm/gtx/number_precision.hpp | 2 - glm/gtx/quaternion.hpp | 12 +- glm/gtx/quaternion.inl | 4 +- glm/gtx/transform.hpp | 6 +- glm/gtx/transform.inl | 18 +-- 21 files changed, 199 insertions(+), 258 deletions(-) diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 28fb03b3..2de393d7 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -342,8 +342,7 @@ namespace detail } //namespace detail -namespace gtc{ -namespace half_float ///< GLM_GTC_half_float extension: Add support for half precision floating-point types +namespace gtc { /// \addtogroup gtc_half_float /// @{ @@ -413,13 +412,9 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre typedef detail::tmat4x4 hmat4x4; /// @} - -}// namespace half_float }// namespace gtc }// namespace glm #include "half_float.inl" -namespace glm{using namespace gtc::half_float;} - #endif//glm_gtc_half_float diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp index f9f7feae..6a459f24 100644 --- a/glm/gtc/matrix_access.hpp +++ b/glm/gtc/matrix_access.hpp @@ -40,8 +40,7 @@ namespace glm{ namespace gtc{ -namespace matrix_access ///< GLM_GTC_matrix_access extension: Set a column or a row of a matrix -{ + /// @addtogroup gtc_matrix_access /// @{ @@ -76,12 +75,9 @@ namespace matrix_access ///< GLM_GTC_matrix_access extension: Set a column or a typename genType::col_type const & x); /// @} -}//namespace matrix_access }//namespace gtc }//namespace glm #include "matrix_access.inl" -namespace glm{using namespace gtc::matrix_access;} - #endif//glm_gtc_matrix_access diff --git a/glm/gtc/matrix_integer.hpp b/glm/gtc/matrix_integer.hpp index e11517fb..de480b60 100644 --- a/glm/gtc/matrix_integer.hpp +++ b/glm/gtc/matrix_integer.hpp @@ -40,8 +40,7 @@ namespace glm{ namespace gtc{ -namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matrices -{ + /// \addtogroup gtc_matrix_integer /// @{ @@ -211,12 +210,8 @@ namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matr typedef mediump_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) #endif//GLM_PRECISION - ///@} - -}//namespace matrix_integer + /// @} }//namespace gtc }//namespace glm -namespace glm{using namespace gtc::matrix_integer;} - #endif//glm_gtc_matrix_integer diff --git a/glm/gtc/matrix_inverse.hpp b/glm/gtc/matrix_inverse.hpp index a0524dc6..16b2e3ed 100644 --- a/glm/gtc/matrix_inverse.hpp +++ b/glm/gtc/matrix_inverse.hpp @@ -40,10 +40,9 @@ namespace glm{ namespace gtc{ -namespace matrix_inverse ///< GLM_GTC_matrix_inverse extension: Inverse matrix functions -{ - /// \addtogroup gtc_matrix_inverse - ///@{ + + /// @addtogroup gtc_matrix_inverse + /// @{ //! Fast matrix inverse for affine matrix. //! From GLM_GTC_matrix_inverse extension. @@ -56,14 +55,10 @@ namespace matrix_inverse ///< GLM_GTC_matrix_inverse extension: Inverse matrix f GLM_FUNC_QUALIFIER typename genType::value_type inverseTranspose( genType const & m); - ///@} - -}//namespace matrix_inverse + /// @} }//namespace gtc }//namespace glm #include "matrix_inverse.inl" -namespace glm{using namespace gtc::matrix_inverse;} - #endif//glm_gtc_matrix_inverse diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index 86acd189..6dc8e11b 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -9,8 +9,7 @@ namespace glm{ namespace gtc{ -namespace matrix_inverse -{ + template GLM_FUNC_QUALIFIER detail::tmat3x3 affineInverse ( @@ -134,6 +133,5 @@ namespace matrix_inverse return Inverse; } -}//namespace matrix_inverse }//namespace gtc }//namespace glm diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 3e72ee87..83fdf7c7 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -42,8 +42,7 @@ namespace glm{ namespace gtc{ -namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transformation matrices -{ + /// @addtogroup gtc_matrix_transform /// @{ @@ -83,7 +82,7 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor /// Creates a matrix for an orthographic parallel viewing volume. /// @see - gtc_matrix_transform: - /// - @link glm::gtc::matrix_transform::ortho(T const & left, T const & right, T const & bottom, T const & top) ortho(T const & left, T const & right, T const & bottom, T const & top) @endlink + /// - @link glm::gtc::ortho(T const & left, T const & right, T const & bottom, T const & top) ortho(T const & left, T const & right, T const & bottom, T const & top) @endlink template detail::tmat4x4 ortho( T const & left, @@ -95,7 +94,7 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor /// Creates a matrix for projecting two-dimensional coordinates onto the screen. /// @see - gtc_matrix_transform: - /// - @link glm::gtc::matrix_transform::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) @endlink + /// - @link glm::gtc::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) @endlink template detail::tmat4x4 ortho( T const & left, @@ -184,12 +183,9 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor detail::tvec3 const & up); /// @} -}//namespace matrix_transform }//namespace gtc }//namespace glm #include "matrix_transform.inl" -namespace glm{using namespace gtc::matrix_transform;} - #endif//glm_gtc_matrix_transform diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 525fbffa..7d4ed21f 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -9,8 +9,7 @@ namespace glm{ namespace gtc{ -namespace matrix_transform -{ + template GLM_FUNC_QUALIFIER detail::tmat4x4 translate ( @@ -390,8 +389,8 @@ namespace matrix_transform Result[3][1] =-dot(y, eye); Result[3][2] = dot(f, eye); */ - return gtc::matrix_transform::translate(Result, -eye); + return gtc::translate(Result, -eye); } -}//namespace matrix_transform + }//namespace gtc }//namespace glm diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 94caa28e..c2ffbd0f 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -144,10 +144,9 @@ namespace detail } //namespace detail namespace gtc{ -namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and functions -{ - /// \addtogroup gtc_quaternion - ///@{ + + /// @addtogroup gtc_quaternion + /// @{ //! Returns the length of the quaternion. //! From GLM_GTC_quaternion extension. @@ -249,12 +248,9 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun typedef detail::tquat highp_quat; /// @} -} //namespace quaternion } //namespace gtc } //namespace glm #include "quaternion.inl" -namespace glm{using namespace gtc::quaternion;} - #endif//glm_gtc_quaternion diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 37e10472..e0383d2a 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -211,7 +211,7 @@ namespace detail{ detail::tquat const & q ) { - return gtc::quaternion::inverse(q) * v; + return gtc::inverse(q) * v; } template @@ -231,7 +231,7 @@ namespace detail{ detail::tquat const & q ) { - return gtc::quaternion::inverse(q) * v; + return gtc::inverse(q) * v; } template @@ -292,7 +292,6 @@ namespace detail{ }//namespace detail namespace gtc{ -namespace quaternion{ //////////////////////////////////////////////////////// template @@ -448,7 +447,7 @@ namespace quaternion{ detail::tquat const & q ) { - return gtc::quaternion::conjugate(q) / gtc::quaternion::dot(q, q); + return gtc::conjugate(q) / gtc::dot(q, q); } template @@ -474,7 +473,7 @@ namespace quaternion{ typename detail::tquat::value_type AngleRad = radians(angle); typename detail::tquat::value_type fSin = sin(AngleRad * T(0.5)); - return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + return gtc::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } template @@ -579,6 +578,5 @@ namespace quaternion{ return quat_cast(detail::tmat3x3(m4)); } -}//namespace quaternion }//namespace gtc }//namespace glm diff --git a/glm/gtc/swizzle.hpp b/glm/gtc/swizzle.hpp index 4ce767b3..a0c5325c 100644 --- a/glm/gtc/swizzle.hpp +++ b/glm/gtc/swizzle.hpp @@ -42,8 +42,6 @@ namespace glm{ namespace gtc { - using namespace gtc::half_float; - template class vecType> T const & swizzle( vecType const & v, @@ -360,7 +358,6 @@ namespace gtc static_swizzle4_ref(glm::u32, 4) static_swizzle4_ref(glm::u64, 4) - }//namespace gtc }//namespace glm diff --git a/glm/gtc/type_precision.hpp b/glm/gtc/type_precision.hpp index 53d93115..6e80bedb 100644 --- a/glm/gtc/type_precision.hpp +++ b/glm/gtc/type_precision.hpp @@ -44,19 +44,12 @@ namespace glm{ namespace gtc{ -namespace type_precision ///< GLM_GTC_type_precision extension: Defined types with specific size. -{ - /////////////////////////// - // Dependences - - using namespace gtc::half_float; - using namespace gtc::quaternion; /////////////////////////// // Signed int vector types - /// \addtogroup gtc_type_precision - ///@{ + /// @addtogroup gtc_type_precision + /// @{ typedef detail::int8 int8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension) typedef detail::int16 int16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension) @@ -225,14 +218,10 @@ namespace type_precision ///< GLM_GTC_type_precision extension: Defined types wi typedef detail::tquat f32quat; //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension) typedef detail::tquat f64quat; //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension) - ///@} - -}//namespace type_precision + /// @} }//namespace gtc }//namespace glm #include "type_precision.inl" -namespace glm{using namespace gtc::type_precision;} - #endif//glm_gtc_type_precision diff --git a/glm/gtc/type_ptr.hpp b/glm/gtc/type_ptr.hpp index ab259f03..5849d243 100644 --- a/glm/gtc/type_ptr.hpp +++ b/glm/gtc/type_ptr.hpp @@ -44,14 +44,12 @@ #endif namespace glm{ -namespace gtc{ -namespace type_ptr ///< GLM_GTC_type_ptr extension: Get access to vectors & matrices value type address. -{ - /// \addtogroup gtc_type_ptr - ///@{ +namespace gtc{ + /// @addtogroup gtc_type_ptr + /// @{ - //! Return the constant address to the data of the input parameter. - //! From GLM_GTC_type_ptr extension. + /// Return the constant address to the data of the input parameter. + /// From GLM_GTC_type_ptr extension. template GLM_FUNC_QUALIFIER T const * value_ptr ( @@ -477,13 +475,10 @@ namespace type_ptr ///< GLM_GTC_type_ptr extension: Get access to vectors & matr } /// @} -}//namespace type_ptr }//namespace gtc }//namespace glm #include "type_ptr.inl" -namespace glm{using namespace gtc::type_ptr;} - #endif//glm_gtx_type_ptr diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp index 795c885e..a519730f 100644 --- a/glm/gtx/bit.hpp +++ b/glm/gtx/bit.hpp @@ -26,8 +26,6 @@ namespace glm{ namespace gtx{ namespace bit ///< GLM_GTX_bit extension: Allow to perform bit operations on integer values { - using namespace gtc::half_float; - /// \addtogroup gtx_bit /// @{ diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl index f1d29c35..8b4c1a5d 100644 --- a/glm/gtx/bit.inl +++ b/glm/gtx/bit.inl @@ -62,13 +62,13 @@ GLM_FUNC_QUALIFIER detail::tvec4 mask template GLM_FUNC_QUALIFIER genIType extractField ( - gtc::half_float::half const & value, + gtc::half const & value, genIType const & first, genIType const & count ) { - assert(first + count < sizeof(gtc::half_float::half)); - return (value._data() << first) >> ((sizeof(gtc::half_float::half) << 3) - count); + assert(first + count < sizeof(gtc::half)); + return (value._data() << first) >> ((sizeof(gtc::half) << 3) - count); } template diff --git a/glm/gtx/color_cast.hpp b/glm/gtx/color_cast.hpp index 614c3102..89928d95 100644 --- a/glm/gtx/color_cast.hpp +++ b/glm/gtx/color_cast.hpp @@ -33,67 +33,67 @@ namespace color_cast ///< GLM_GTX_color_cast extension: Conversion between two c //! Conversion of a floating value into a 8bit unsigned int value. //! From GLM_GTX_color_cast extension. - template gtc::type_precision::uint8 u8channel_cast(valType a); + template gtc::uint8 u8channel_cast(valType a); //! Conversion of a floating value into a 16bit unsigned int value. //! From GLM_GTX_color_cast extension. - template gtc::type_precision::uint16 u16channel_cast(valType a); + template gtc::uint16 u16channel_cast(valType a); - template gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint32 u32_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::uint64 u64_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template gtx::number_precision::f16vec1 f16_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec3 f16_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec3 f16_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec3 f16_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec3 f16_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec3 f16_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec3 f16_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec3 f16_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec3 f16_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec4 f16_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec4 f16_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec4 f16_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f16vec4 f16_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec4 f16_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec4 f16_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec4 f16_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f16vec4 f16_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template gtx::number_precision::f32vec1 f32_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec3 f32_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec3 f32_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec3 f32_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec3 f32_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec3 f32_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec3 f32_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec3 f32_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec3 f32_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec4 f32_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec4 f32_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec4 f32_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f32vec4 f32_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec4 f32_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec4 f32_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec4 f32_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f32vec4 f32_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template gtx::number_precision::f64vec1 f64_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec3 f64_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec3 f64_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec3 f64_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec3 f64_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec3 f64_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec3 f64_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec3 f64_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec3 f64_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec4 f64_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec4 f64_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec4 f64_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template gtc::type_precision::f64vec4 f64_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec4 f64_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec4 f64_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec4 f64_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::f64vec4 f64_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) /// @} }//namespace color_space diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl index 5236869b..f7d8e4fc 100644 --- a/glm/gtx/color_cast.inl +++ b/glm/gtx/color_cast.inl @@ -13,210 +13,210 @@ namespace gtx{ namespace color_cast{ template -GLM_FUNC_QUALIFIER gtc::type_precision::uint8 u8channel_cast(T a) +GLM_FUNC_QUALIFIER gtc::uint8 u8channel_cast(T a) { - return static_cast(a * T(255)); + return static_cast(a * T(255)); } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint16 u16channel_cast(T a) +GLM_FUNC_QUALIFIER gtc::uint16 u16channel_cast(T a) { - return static_cast(a * T(65535)); + return static_cast(a * T(65535)); } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_rgbx_cast(const detail::tvec3& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(255)) << 0; - result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; - result += static_cast(c.z * detail::tvec3::value_type(255)) << 16; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 0; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 16; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_xrgb_cast(const detail::tvec3& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(255)) << 8; - result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; - result += static_cast(c.z * detail::tvec3::value_type(255)) << 24; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 24; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_bgrx_cast(const detail::tvec3& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(255)) << 16; - result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; - result += static_cast(c.z * detail::tvec3::value_type(255)) << 0; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_xbgr_cast(const detail::tvec3& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(255)) << 24; - result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; - result += static_cast(c.z * detail::tvec3::value_type(255)) << 8; - result += static_cast(c.w * detail::tvec3::value_type(255)) << 0; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 24; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.w * detail::tvec3::value_type(255)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_rgba_cast(const detail::tvec4& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(255)) << 0; - result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; - result += static_cast(c.z * detail::tvec4::value_type(255)) << 16; - result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 0; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_argb_cast(const detail::tvec4& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(255)) << 8; - result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; - result += static_cast(c.z * detail::tvec4::value_type(255)) << 24; - result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 24; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_bgra_cast(const detail::tvec4& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(255)) << 16; - result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; - result += static_cast(c.z * detail::tvec4::value_type(255)) << 0; - result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 0; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint32 u32_abgr_cast(const detail::tvec4& c) { - gtc::type_precision::uint32 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(255)) << 24; - result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; - result += static_cast(c.z * detail::tvec4::value_type(255)) << 8; - result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; + gtc::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 24; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint64 u64_rgbx_cast(const detail::tvec3& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(65535)) << 0; - result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; - result += static_cast(c.z * detail::tvec3::value_type(65535)) << 32; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 0; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 32; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_xrgb_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint64 u32_xrgb_cast(const detail::tvec3& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(65535)) << 16; - result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; - result += static_cast(c.z * detail::tvec3::value_type(65535)) << 48; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 48; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_bgrx_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint64 u32_bgrx_cast(const detail::tvec3& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(65535)) << 32; - result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; - result += static_cast(c.z * detail::tvec3::value_type(65535)) << 0; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_xbgr_cast(const detail::tvec3& c) +GLM_FUNC_QUALIFIER gtc::uint64 u32_xbgr_cast(const detail::tvec3& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec3::value_type(65535)) << 48; - result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; - result += static_cast(c.z * detail::tvec3::value_type(65535)) << 16; - result += static_cast(c.w * detail::tvec3::value_type(65535)) << 0; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 48; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.w * detail::tvec3::value_type(65535)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint64 u64_rgba_cast(const detail::tvec4& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(65535)) << 0; - result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; - result += static_cast(c.z * detail::tvec4::value_type(65535)) << 32; - result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 0; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint64 u64_argb_cast(const detail::tvec4& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(65535)) << 16; - result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; - result += static_cast(c.z * detail::tvec4::value_type(65535)) << 48; - result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 48; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint64 u64_bgra_cast(const detail::tvec4& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(65535)) << 32; - result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; - result += static_cast(c.z * detail::tvec4::value_type(65535)) << 0; - result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 0; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; return result; } template -GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4& c) +GLM_FUNC_QUALIFIER gtc::uint64 u64_abgr_cast(const detail::tvec4& c) { - gtc::type_precision::uint64 result = 0; - result += static_cast(c.x * detail::tvec4::value_type(65535)) << 48; - result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; - result += static_cast(c.z * detail::tvec4::value_type(65535)) << 16; - result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; + gtc::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 48; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; return result; } template <> -GLM_FUNC_QUALIFIER f16vec1 f16_channel_cast(gtc::type_precision::uint32 color) +GLM_FUNC_QUALIFIER f16vec1 f16_channel_cast(gtc::uint32 color) { - return gtc::type_precision::f16(static_cast(color >> 0) / static_cast(255)); + return gtc::f16(static_cast(color >> 0) / static_cast(255)); } template <> -GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_rgbx_cast(gtc::type_precision::uint32 color) +GLM_FUNC_QUALIFIER gtc::f16vec3 f16_rgbx_cast(gtc::uint32 color) { - gtc::type_precision::f16vec3 result; - result.x = gtc::type_precision::f16(static_cast(color >> 0) / static_cast(255)); - result.y = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); - result.z = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); + gtc::f16vec3 result; + result.x = gtc::f16(static_cast(color >> 0) / static_cast(255)); + result.y = gtc::f16(static_cast(color >> 8) / static_cast(255)); + result.z = gtc::f16(static_cast(color >> 16) / static_cast(255)); return result; } template <> -GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_xrgb_cast(gtc::type_precision::uint32 color) +GLM_FUNC_QUALIFIER gtc::f16vec3 f16_xrgb_cast(gtc::uint32 color) { - gtc::type_precision::f16vec3 result; - result.x = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); - result.y = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); - result.z = gtc::type_precision::f16(static_cast(color >> 24) / static_cast(255)); + gtc::f16vec3 result; + result.x = gtc::f16(static_cast(color >> 8) / static_cast(255)); + result.y = gtc::f16(static_cast(color >> 16) / static_cast(255)); + result.z = gtc::f16(static_cast(color >> 24) / static_cast(255)); return result; } diff --git a/glm/gtx/number_precision.hpp b/glm/gtx/number_precision.hpp index 7a086ce2..6c4bfc6a 100644 --- a/glm/gtx/number_precision.hpp +++ b/glm/gtx/number_precision.hpp @@ -27,8 +27,6 @@ namespace glm{ namespace gtx{ namespace number_precision ///< GLM_GTX_number_precision extension: Defined size types. { - using namespace gtc::type_precision; - ///////////////////////////// // Unsigned int vector types diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp index 91a09300..5e1e09a4 100644 --- a/glm/gtx/quaternion.hpp +++ b/glm/gtx/quaternion.hpp @@ -29,8 +29,6 @@ namespace glm{ namespace gtx{ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and functions { - using namespace gtc::quaternion; - /// \addtogroup gtx_quaternion ///@{ @@ -169,25 +167,25 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun //! From GLM_GTX_quaternion extension. template detail::tmat3x3 toMat3( - detail::tquat const & x){return gtc::quaternion::mat3_cast(x);} + detail::tquat const & x){return gtc::mat3_cast(x);} //! Converts a quaternion to a 4 * 4 matrix. //! From GLM_GTX_quaternion extension. template detail::tmat4x4 toMat4( - detail::tquat const & x){return gtc::quaternion::mat4_cast(x);} + detail::tquat const & x){return gtc::mat4_cast(x);} //! Converts a 3 * 3 matrix to a quaternion. //! From GLM_GTX_quaternion extension. template detail::tquat toQuat( - detail::tmat3x3 const & x){return gtc::quaternion::quat_cast(x);} + detail::tmat3x3 const & x){return gtc::quat_cast(x);} //! Converts a 4 * 4 matrix to a quaternion. //! From GLM_GTX_quaternion extension. template detail::tquat toQuat( - detail::tmat4x4 const & x){return gtc::quaternion::quat_cast(x);} + detail::tmat4x4 const & x){return gtc::quat_cast(x);} //! Quaternion interpolation using the rotation short path. //! From GLM_GTX_quaternion extension. @@ -208,7 +206,7 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun /// @} }//namespace quaternion }//namespace gtx -} //namespace glm +}//namespace glm #include "quaternion.inl" diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index 910cdd78..41d3b982 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -20,7 +20,7 @@ namespace quaternion detail::tquat const & q ) { - return gtc::quaternion::inverse(q) * v; + return gtc::inverse(q) * v; } template @@ -53,7 +53,7 @@ namespace quaternion detail::tquat const & next ) { - detail::tquat invQuat = gtc::quaternion::inverse(curr); + detail::tquat invQuat = gtc::inverse(curr); return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr; } diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index f35b5b83..9e3be55d 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -45,10 +45,8 @@ namespace glm{ namespace gtx{ namespace transform ///< GLM_GTX_transform extension: Add transformation matrices -{ - using namespace gtc::matrix_transform; - - /// \addtogroup gtx_transform + { + /// @addtogroup gtx_transform /// @{ //! Builds a translation 4 * 4 matrix created from 3 scalars. diff --git a/glm/gtx/transform.inl b/glm/gtx/transform.inl index 908a3277..4e2ca43a 100644 --- a/glm/gtx/transform.inl +++ b/glm/gtx/transform.inl @@ -15,7 +15,7 @@ namespace transform GLM_FUNC_QUALIFIER detail::tmat4x4 translate( T x, T y, T z) { - return gtc::matrix_transform::translate( + return gtc::translate( detail::tmat4x4(1.0f), detail::tvec3(x, y , z)); } @@ -25,7 +25,7 @@ namespace transform detail::tmat4x4 const & m, T x, T y, T z) { - return gtc::matrix_transform::translate( + return gtc::translate( m, detail::tvec3(x, y , z)); } @@ -33,7 +33,7 @@ namespace transform GLM_FUNC_QUALIFIER detail::tmat4x4 translate( detail::tvec3 const & v) { - return gtc::matrix_transform::translate( + return gtc::translate( detail::tmat4x4(1.0f), v); } @@ -42,7 +42,7 @@ namespace transform T angle, T x, T y, T z) { - return gtc::matrix_transform::rotate( + return gtc::rotate( detail::tmat4x4(1), angle, detail::tvec3(x, y, z)); } @@ -51,7 +51,7 @@ namespace transform T angle, detail::tvec3 const & v) { - return gtc::matrix_transform::rotate( + return gtc::rotate( detail::tmat4x4(1), angle, v); } @@ -61,14 +61,14 @@ namespace transform T angle, T x, T y, T z) { - return gtc::matrix_transform::rotate( + return gtc::rotate( m, angle, detail::tvec3(x, y, z)); } template GLM_FUNC_QUALIFIER detail::tmat4x4 scale(T x, T y, T z) { - return gtc::matrix_transform::scale( + return gtc::scale( detail::tmat4x4(1), detail::tvec3(x, y, z)); } @@ -77,7 +77,7 @@ namespace transform detail::tmat4x4 const & m, T x, T y, T z) { - return gtc::matrix_transform::scale( + return gtc::scale( m, detail::tvec3(x, y, z)); } @@ -85,7 +85,7 @@ namespace transform GLM_FUNC_QUALIFIER detail::tmat4x4 scale( detail::tvec3 const & v) { - return gtc::matrix_transform::scale( + return gtc::scale( detail::tmat4x4(1.0f), v); }