From 7c67703bca0daef11c2213bae73da891645d899c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 9 May 2011 12:33:00 +0100 Subject: [PATCH 001/103] Extended bit field functions: #4 --- glm/gtx/bit.hpp | 16 ++++++++++++++++ glm/gtx/bit.inl | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp index f6c689f2..676b1ad0 100644 --- a/glm/gtx/bit.hpp +++ b/glm/gtx/bit.hpp @@ -101,6 +101,22 @@ namespace glm template genType bitRotateLeft(genType const & In, std::size_t Shift); + //! Set to 1 a range of bits. + //! From GLM_GTX_bit extension. + template + genIUType fillBitfieldWithOne( + genIUType const & Value, + int const & FromBit, + int const & ToBit); + + //! Set to 0 a range of bits. + //! From GLM_GTX_bit extension. + template + genIUType fillBitfieldWithZero( + genIUType const & Value, + int const & FromBit, + int const & ToBit); + ///@} }//namespace bit diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl index 5c3ec8e2..f1d29c35 100644 --- a/glm/gtx/bit.inl +++ b/glm/gtx/bit.inl @@ -738,6 +738,40 @@ GLM_FUNC_QUALIFIER detail::tvec4 bitRotateLeft bitRotateLeft(Value[3], Shift)); } +template +GLM_FUNC_QUALIFIER genIUType fillBitfieldWithOne +( + genIUType const & Value, + int const & FromBit, + int const & ToBit +) +{ + assert(FromBit <= ToBit); + assert(ToBit <= sizeof(genIUType) * std::size_t(8)); + + genIUType Result = Value; + for(std::size_t i = 0; i <= ToBit; ++i) + Result |= (1 << i); + return Result; +} + +template +GLM_FUNC_QUALIFIER genIUType fillBitfieldWithZero +( + genIUType const & Value, + int const & FromBit, + int const & ToBit +) +{ + assert(FromBit <= ToBit); + assert(ToBit <= sizeof(genIUType) * std::size_t(8)); + + genIUType Result = Value; + for(std::size_t i = 0; i <= ToBit; ++i) + Result &= ~(1 << i); + return Result; +} + }//namespace bit }//namespace gtx }//namespace glm From 6d19231a70ca67b1e27fa889280e0f256b1ee1de Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 9 May 2011 17:42:29 +0100 Subject: [PATCH 002/103] Automatic detection of the CUDA compiler? --- glm/core/setup.hpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 06c6010f..e180a5bd 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -88,6 +88,23 @@ // Force generic C++ compiler #ifdef GLM_FORCE_COMPILER_UNKNOWN # define GLM_COMPILER GLM_COMPILER_UNKNOWN + +// CUDA +#elif defined(__CUDACC__) +# if CUDA_VERSION < 3000 +# error "GLM requires CUDA 3.0 or higher" +# elif CUDA_VERSION == 3000 +# define GLM_COMPILER GLM_COMPILER_CUDA30 +# elif CUDA_VERSION == 3010 +# define GLM_COMPILER GLM_COMPILER_CUDA31 +# elif CUDA_VERSION == 3020 +# define GLM_COMPILER GLM_COMPILER_CUDA32 +# elif CUDA_VERSION == 4000 +# define GLM_COMPILER GLM_COMPILER_CUDA40 +# else +# define GLM_COMPILER GLM_COMPILER_CUDA +# endif + // Visual C++ #elif defined(_MSC_VER) # if _MSC_VER == 900 @@ -168,24 +185,6 @@ #elif defined(__MWERKS__) # define GLM_COMPILER GLM_COMPILER_CODEWARRIOR -// CUDA -/* -#elif defined(__CUDACC__) -# if CUDA_VERSION < 3000 -# error "GLM requires CUDA 3.0 or higher" -# elif CUDA_VERSION == 3000 -# define GLM_COMPILER GLM_COMPILER_CUDA30 -# elif CUDA_VERSION == 3010 -# define GLM_COMPILER GLM_COMPILER_CUDA31 -# elif CUDA_VERSION == 3020 -# define GLM_COMPILER GLM_COMPILER_CUDA32 -# elif CUDA_VERSION == 4000 -# define GLM_COMPILER GLM_COMPILER_CUDA40 -# else -# define GLM_COMPILER GLM_COMPILER_CUDA -# endif -*/ - #else # define GLM_COMPILER GLM_COMPILER_UNKNOWN #endif From ad60108e2c321c74e80577dfc5aeaee42b41f4f5 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 12 May 2011 17:36:29 +0100 Subject: [PATCH 003/103] Added more doxygen documentation --- doc/coreModules.doxy | 2 ++ glm/glm.hpp | 2 +- glm/gtc/half_float.hpp | 10 +++++----- glm/gtc/matrix_transform.hpp | 15 +++++++-------- glm/gtc/quaternion.hpp | 16 ++++++++-------- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/coreModules.doxy b/doc/coreModules.doxy index 1961ff71..df3df17f 100644 --- a/doc/coreModules.doxy +++ b/doc/coreModules.doxy @@ -12,6 +12,8 @@ version 4.1 (pdf file). There are a few \ref pg_differences "differences" between GLM core and GLSL. + + GLM core functionnalities requires to be included to be used. **/ diff --git a/glm/glm.hpp b/glm/glm.hpp index 394ecf4b..ec5afbb1 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -4,7 +4,7 @@ // Created : 2005-01-14 // Updated : 2011-01-19 // Licence : This source is under MIT License -// File : glm/glm.hpp +//! \file glm/glm.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #include "core/_fixes.hpp" diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 9c9d81e1..ea50c0c3 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -1,10 +1,10 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +//! OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2010-02-07 -// Licence : This source is under MIT License -// File : glm/gtc/half_float.hpp +//! Created : 2009-04-29 +//! Updated : 2010-02-07 +//! Licence : This source is under MIT License +//! \file glm/gtc/half_float.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_half_float diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 241bb3ac..8505e22e 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -1,14 +1,13 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +//! OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_transform.hpp +//! Created : 2009-04-29 +//! Updated : 2009-04-29 +//! Licence : This source is under MIT License +//! \file glm/gtc/matrix_transform.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_matrix_operation +//! Dependency: +//! - GLM core /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_transform diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index bc4890fd..cf1c4b27 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -1,14 +1,14 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +//! OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-21 -// Updated : 2010-02-04 -// Licence : This source is under MIT License -// File : glm/gtc/quaternion.hpp +//! Created : 2009-05-21 +//! Updated : 2010-02-04 +//! Licence : This source is under MIT License +//! \file glm/gtc/quaternion.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_half_float +//! Dependency: +//! - GLM core +//! - \link glm/gtc/half_float.hpp GLM_GTC_half_float \endlink /////////////////////////////////////////////////////////////////////////////////////////////////// // ToDo: // - Study constructors with angles and axis From 0cafee2f53affc74e3af25e2c1e5203fce1dd165 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 14:55:06 +0100 Subject: [PATCH 004/103] Added see also concept and new header --- glm/gtc/matrix_transform.hpp | 68 ++++++++++++++++++++++++------------ glm/gtx/transform.hpp | 27 +++++++++----- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 8505e22e..a1ed2c58 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -1,14 +1,33 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -//! OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -//! Created : 2009-04-29 -//! Updated : 2009-04-29 -//! Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////// +//! OpenGL Mathematics (glm.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////// +//! Copyright (c) 2005 - 2011 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 gtc_matrix_transform GLM_GTC_matrix_transform +//! \date 2009-04-29 / 2011-05-16 //! \file glm/gtc/matrix_transform.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// +//! \author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// //! Dependency: -//! - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// +//! - \ref core GLM core +/////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_transform #define glm_gtc_matrix_transform @@ -34,14 +53,16 @@ namespace glm ///@{ //! Builds a translation 4 * 4 matrix created from a vector of 3 components. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! - See also: \link glm::gtx::transform::translate GLM_GTX_transform \endlink template detail::tmat4x4 translate( detail::tmat4x4 const & m, detail::tvec3 const & v); //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! - See also: \link glm::gtx::transform::rotate GLM_GTX_transform \endlink template detail::tmat4x4 rotate( detail::tmat4x4 const & m, @@ -49,14 +70,15 @@ namespace glm detail::tvec3 const & v); //! Builds a scale 4 * 4 matrix created from 3 scalars. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! - See also: \link glm::gtx::transform::scale GLM_GTX_transform \endlink template detail::tmat4x4 scale( detail::tmat4x4 const & m, detail::tvec3 const & v); //! Creates a matrix for an orthographic parallel viewing volume. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 ortho( T const & left, @@ -67,7 +89,7 @@ namespace glm T const & zFar); //! Creates a matrix for projecting two-dimensional coordinates onto the screen. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 ortho( T const & left, @@ -76,7 +98,7 @@ namespace glm T const & top); //! Creates a frustum matrix. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 frustum( T const & left, @@ -87,7 +109,7 @@ namespace glm T const & farVal); //! Creates a matrix for a symetric perspective-view frustum. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 perspective( T const & fovy, @@ -96,7 +118,7 @@ namespace glm T const & zFar); //! Builds a perspective projection matrix based on a field of view - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 perspectiveFov( valType const & fov, @@ -106,19 +128,19 @@ namespace glm valType const & zFar); //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 infinitePerspective( T fovy, T aspect, T zNear); //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 tweakedInfinitePerspective( T fovy, T aspect, T zNear); //! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tvec3 project( detail::tvec3 const & obj, @@ -127,7 +149,7 @@ namespace glm detail::tvec4 const & viewport); //! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tvec3 unProject( detail::tvec3 const & win, @@ -136,7 +158,7 @@ namespace glm detail::tvec4 const & viewport); //! Define a picking region - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 pickMatrix( detail::tvec2 const & center, @@ -144,7 +166,7 @@ namespace glm detail::tvec4 const & viewport); //! Build a look at view matrix. - //! From GLM_GTC_matrix_transform extension. + //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension template detail::tmat4x4 lookAt( detail::tvec3 const & eye, diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index adf18639..73b188f0 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -38,40 +38,46 @@ namespace glm ///@{ //! Builds a translation 4 * 4 matrix created from 3 scalars. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::translate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 translate( T x, T y, T z); //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::translate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 translate( detail::tmat4x4 const & m, T x, T y, T z); //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::translate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 translate( detail::tvec3 const & v); //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::rotate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 rotate( T angle, T x, T y, T z); //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::rotate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 rotate( T angle, detail::tvec3 const & v); //! Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::rotate GLM_GTC_matrix_transform \endlink template detail::tmat4x4 rotate( detail::tmat4x4 const & m, @@ -79,20 +85,23 @@ namespace glm T x, T y, T z); //! Builds a scale 4 * 4 matrix created from 3 scalars. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::scale GLM_GTC_matrix_transform \endlink template detail::tmat4x4 scale( T x, T y, T z); //! Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::scale GLM_GTC_matrix_transform \endlink template detail::tmat4x4 scale( detail::tmat4x4 const & m, T x, T y, T z); //! Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. - //! From GLM_GTX_transform extension. + //! - From \link gtx_transform GLM_GTX_transform \endlink extension + //! - See also: \link glm::gtc::matrix_transform::scale GLM_GTC_matrix_transform \endlink template detail::tmat4x4 scale( detail::tvec3 const & v); From 921175612ba5e4f9798c762f72432f2681a9cb24 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 17:14:13 +0100 Subject: [PATCH 005/103] Fixed doxygen warning --- doc/pages.doxy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/pages.doxy b/doc/pages.doxy index 5c6231fd..c9f7755a 100644 --- a/doc/pages.doxy +++ b/doc/pages.doxy @@ -407,7 +407,7 @@ void foo() \section faq7 Should I use 'using namespace glm;'? This is unwise. Chances are that if 'using namespace glm;' is called, name collisions will happen. - GLSL names for functions are fairly generic, so it is entirely likely that there is another function called, for example, \link glm::sqrt sqrt \endlink. + GLSL names for functions are fairly generic, so it is entirely likely that there is another function called, for example, \link glm::sqrt() sqrt \endlink. For frequent use of particular types, they can be brough into the global namespace with a 'using' declaration like this: From db651b18451a6327bc4f4e4f2dc6307f313aa90c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 17:14:33 +0100 Subject: [PATCH 006/103] Improved see also --- glm/gtc/matrix_transform.hpp | 19 +++++++++++----- glm/gtx/transform.hpp | 43 ++++++++++++++++++++++++++---------- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index a1ed2c58..89a806b4 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -26,7 +26,7 @@ //! \author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// //! Dependency: -//! - \ref core GLM core +//! - \link core GLM core \endlink /////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_transform @@ -53,16 +53,20 @@ namespace glm ///@{ //! Builds a translation 4 * 4 matrix created from a vector of 3 components. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension - //! - See also: \link glm::gtx::transform::translate GLM_GTX_transform \endlink + //! \sa + //! - \link gtx_transform GLM_GTX_transform \endlink extension + //! - glm::gtx::transform::translate(T x, T y, T z) + //! - glm::gtx::transform::translate(detail::tmat4x4 const & m, T x, T y, T z) template detail::tmat4x4 translate( detail::tmat4x4 const & m, detail::tvec3 const & v); //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension - //! - See also: \link glm::gtx::transform::rotate GLM_GTX_transform \endlink + //! \sa + //! - \link gtx_transform GLM_GTX_transform \endlink extension + //! - glm::gtx::transform::rotate(T angle, T x, T y, T z) + //! - glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) template detail::tmat4x4 rotate( detail::tmat4x4 const & m, @@ -166,7 +170,10 @@ namespace glm detail::tvec4 const & viewport); //! Build a look at view matrix. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa frustum() + //! \param eye Position of the camera + //! \param center Position where the camera is looking at + //! \param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) template detail::tmat4x4 lookAt( detail::tvec3 const & eye, diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index 73b188f0..a1808955 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -1,15 +1,34 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtx/transform.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_matric_transform -/////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +//! OpenGL Mathematics (glm.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////// +//! Copyright (c) 2005 - 2011 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 gtc_matrix_transform GLM_GTC_matrix_transform +//! \date 2005-12-21 / 2011-05-16 +//! \file glm/gtx/transform.hpp +//! \author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// +//! Dependency: +//! - \link core GLM core \endlink +//! - \link gtc_matrix_transform GLM_GTC_matric_transform \endlink +/////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_transform #define glm_gtx_transform From b02f491ceccef35f0c924041c495dfd62c9c37e7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 17:49:47 +0100 Subject: [PATCH 007/103] Improved doxygens see also --- doc/gtcModules.doxy | 12 ++++---- glm/gtc/matrix_transform.hpp | 55 ++++++++++++++++++++---------------- glm/gtx/transform.hpp | 11 ++++---- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/doc/gtcModules.doxy b/doc/gtcModules.doxy index 3c4e49d2..b6e53fd8 100644 --- a/doc/gtcModules.doxy +++ b/doc/gtcModules.doxy @@ -10,7 +10,7 @@ **/ /*! - \defgroup gtc_half_float GLM_GTC_half_float: Half-precision floating-point based types and functions. + \defgroup gtc_half_float GLM_GTC_half_float: Half-precision floating-point based types and functions \ingroup gtc Defines the half-precision floating-point type, along with various typedefs for vectors and matrices. @@ -18,7 +18,7 @@ **/ /*! - \defgroup gtc_matrix_access GLM_GTC_matrix_access: Access matrix rows and columns. + \defgroup gtc_matrix_access GLM_GTC_matrix_access: Access matrix rows and columns \ingroup gtc Defines functions to access rows or columns of a matrix easily. @@ -26,7 +26,7 @@ **/ /*! - \defgroup gtc_matrix_integer GLM_GTC_matrix_integer: Integer matrix types. + \defgroup gtc_matrix_integer GLM_GTC_matrix_integer: Integer matrix types \ingroup gtc Defines a number of matrices with integer types. @@ -42,7 +42,7 @@ **/ /*! - \defgroup gtc_matrix_transform GLM_GTC_matrix_transform: Matrix transform functions. + \defgroup gtc_matrix_transform GLM_GTC_matrix_transform: Matrix transform functions \ingroup gtc \brief Defines functions that generate common transformation matrices. @@ -66,7 +66,7 @@ **/ /*! - \defgroup gtc_type_precision GLM_GTC_type_precision: Vector and matrix types with defined precisions. + \defgroup gtc_type_precision GLM_GTC_type_precision: Vector and matrix types with defined precisions \ingroup gtc \brief Defines specific C++-based precision types. @@ -78,7 +78,7 @@ **/ /*! - \defgroup gtc_type_ptr GLM_GTC_type_ptr: Memory layout access. + \defgroup gtc_type_ptr GLM_GTC_type_ptr: Memory layout access \ingroup gtc \brief Used to get a pointer to the memory layout of a basic type. diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 89a806b4..8362f5bc 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -20,13 +20,15 @@ //! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN //! THE SOFTWARE. /////////////////////////////////////////////////////////////////////////////////// -//! \ref gtc_matrix_transform GLM_GTC_matrix_transform -//! \date 2009-04-29 / 2011-05-16 +//! \ref gtc_matrix_transform //! \file glm/gtc/matrix_transform.hpp +//! \date 2009-04-29 / 2011-05-16 //! \author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -//! Dependency: -//! - \link core GLM core \endlink +//! \sa core (dependence) +//! \sa gtc_matrix_transform +//! \sa gtx_transform +//! \sa gtx_transform2 /////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_transform @@ -53,8 +55,8 @@ namespace glm ///@{ //! Builds a translation 4 * 4 matrix created from a vector of 3 components. - //! \sa - //! - \link gtx_transform GLM_GTX_transform \endlink extension + //! \sa - gtc_matrix_transform + //! \sa - gtx_transform: //! - glm::gtx::transform::translate(T x, T y, T z) //! - glm::gtx::transform::translate(detail::tmat4x4 const & m, T x, T y, T z) template @@ -63,10 +65,10 @@ namespace glm detail::tvec3 const & v); //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. - //! \sa - //! - \link gtx_transform GLM_GTX_transform \endlink extension - //! - glm::gtx::transform::rotate(T angle, T x, T y, T z) - //! - glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) + //! \sa - gtc_matrix_transform + //! \sa - gtx_transform: + //! - \link glm::gtx::transform::rotate(T angle, T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) \endlink + //! - \link glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) \endlink template detail::tmat4x4 rotate( detail::tmat4x4 const & m, @@ -74,15 +76,18 @@ namespace glm detail::tvec3 const & v); //! Builds a scale 4 * 4 matrix created from 3 scalars. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension - //! - See also: \link glm::gtx::transform::scale GLM_GTX_transform \endlink + //! \sa - gtc_matrix_transform + //! \sa - gtx_transform: + //! - \link glm::gtx::transform::scale(T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) \endlink + //! - \link glm::gtx::transform::scale(detail::tmat4x4 const & m, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) \endlink template detail::tmat4x4 scale( detail::tmat4x4 const & m, detail::tvec3 const & v); //! Creates a matrix for an orthographic parallel viewing volume. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - 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 template detail::tmat4x4 ortho( T const & left, @@ -93,8 +98,9 @@ namespace glm T const & zFar); //! Creates a matrix for projecting two-dimensional coordinates onto the screen. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension - template + //! \sa - 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 + template detail::tmat4x4 ortho( T const & left, T const & right, @@ -102,7 +108,7 @@ namespace glm T const & top); //! Creates a frustum matrix. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 frustum( T const & left, @@ -113,7 +119,7 @@ namespace glm T const & farVal); //! Creates a matrix for a symetric perspective-view frustum. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 perspective( T const & fovy, @@ -122,7 +128,7 @@ namespace glm T const & zFar); //! Builds a perspective projection matrix based on a field of view - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 perspectiveFov( valType const & fov, @@ -132,19 +138,19 @@ namespace glm valType const & zFar); //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 infinitePerspective( T fovy, T aspect, T zNear); //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 tweakedInfinitePerspective( T fovy, T aspect, T zNear); //! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tvec3 project( detail::tvec3 const & obj, @@ -153,7 +159,7 @@ namespace glm detail::tvec4 const & viewport); //! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tvec3 unProject( detail::tvec3 const & win, @@ -162,7 +168,7 @@ namespace glm detail::tvec4 const & viewport); //! Define a picking region - //! - From \link gtc_matrix_transform GLM_GTC_matrix_transform \endlink extension + //! \sa - gtc_matrix_transform template detail::tmat4x4 pickMatrix( detail::tvec2 const & center, @@ -170,7 +176,8 @@ namespace glm detail::tvec4 const & viewport); //! Build a look at view matrix. - //! \sa frustum() + //! \sa - gtc_matrix_transform: + //! - \link frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)\endlink //! \param eye Position of the camera //! \param center Position where the camera is looking at //! \param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp index a1808955..5ef2805b 100644 --- a/glm/gtx/transform.hpp +++ b/glm/gtx/transform.hpp @@ -20,14 +20,15 @@ //! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN //! THE SOFTWARE. /////////////////////////////////////////////////////////////////////////////////// -//! \ref gtc_matrix_transform GLM_GTC_matrix_transform -//! \date 2005-12-21 / 2011-05-16 +//! \ref gtx_transform //! \file glm/gtx/transform.hpp +//! \date 2005-12-21 / 2011-05-16 //! \author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -//! Dependency: -//! - \link core GLM core \endlink -//! - \link gtc_matrix_transform GLM_GTC_matric_transform \endlink +//! \sa core (dependence) +//! \sa gtc_matrix_transform (dependence) +//! \sa gtx_transform +//! \sa gtx_transform2 /////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_transform From 96a0a678ad1f9387d48058a6808d226a9d036a8c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 18:44:16 +0100 Subject: [PATCH 008/103] Updated doxygen comment convensions --- glm/core/_fixes.hpp | 34 +++- glm/glm.hpp | 87 ++++++---- glm/gtc/matrix_transform.hpp | 325 +++++++++++++++++------------------ 3 files changed, 239 insertions(+), 207 deletions(-) diff --git a/glm/core/_fixes.hpp b/glm/core/_fixes.hpp index ba708003..2f217f53 100644 --- a/glm/core/_fixes.hpp +++ b/glm/core/_fixes.hpp @@ -1,11 +1,29 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2011-02-21 -// Updated : 2011-02-21 -// Licence : This source is under MIT License -// File : glm/core/_fixes.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2011 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. +/// +/// @file glm/core/_fixes.hpp +/// @date 2011-02-21 / 2011-02-16 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// //! Workaround for compatibility with other libraries #ifdef max diff --git a/glm/glm.hpp b/glm/glm.hpp index ec5afbb1..bda8427b 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -1,11 +1,31 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-14 -// Updated : 2011-01-19 -// Licence : This source is under MIT License -//! \file glm/glm.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2011 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. +/// +/// @file glm/glm.hpp +/// @date 2005-01-14 / 2011-05-16 +/// @author Christophe Riccio +/// +/// @ref core +/////////////////////////////////////////////////////////////////////////////////// #include "core/_fixes.hpp" @@ -24,39 +44,34 @@ #endif//GLM_MESSAGE //! GLM namespace, it contains all GLSL based features. -namespace glm +namespace glm{ +namespace test { - namespace test - { - bool main_bug(); - bool main_core(); - }//namespace test + bool main_bug(); + bool main_core(); +}//namespace test - //! GLM core. Namespace that includes all the feature define by GLSL 4.10.6 specification. This namespace is included in glm namespace. - namespace core - { - //! Scalar, vectors and matrices - //! from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, - //! 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification. - //! This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification. - namespace type{} +/// GLM core. Namespace that includes all the feature define by GLSL 4.10.6 specification. This namespace is included in glm namespace. +namespace core +{ + //! Scalar, vectors and matrices + //! from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, + //! 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification. + //! This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification. + namespace type{} - //! Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification. - //! Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions. - namespace function{} - } - //namespace core + //! Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification. + //! Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions. + namespace function{} +} +//namespace core - //! G-Truc Creation stable extensions. - namespace gtc{} - - //! G-Truc Creation experimental extensions. - //! The interface could change between releases. - namespace gtx{} - - //! VIRTREV extensions. - namespace img{} +/// G-Truc Creation stable extensions. +namespace gtc{} +/// G-Truc Creation experimental extensions. +/// The interface could change between releases. +namespace gtx{} } //namespace glm #include "./core/_detail.hpp" diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 8362f5bc..09acf6c4 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -1,34 +1,34 @@ /////////////////////////////////////////////////////////////////////////////////// -//! OpenGL Mathematics (glm.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////// -//! Copyright (c) 2005 - 2011 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 gtc_matrix_transform -//! \file glm/gtc/matrix_transform.hpp -//! \date 2009-04-29 / 2011-05-16 -//! \author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// -//! \sa core (dependence) -//! \sa gtc_matrix_transform -//! \sa gtx_transform -//! \sa gtx_transform2 +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2011 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. +/// +/// @file glm/gtc/matrix_transform.hpp +/// @date 2009-04-29 / 2011-05-16 +/// @author Christophe Riccio +/// +/// @ref gtc_matrix_transform +/// @see core (dependence) +/// @see gtc_matrix_transform +/// @see gtx_transform +/// @see gtx_transform2 /////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_transform @@ -41,155 +41,154 @@ # pragma message("GLM: GLM_GTC_matrix_transform extension included") #endif -namespace glm +namespace glm{ +namespace test{ + bool main_gtc_matrix_transform(); +}//namespace test + +namespace gtc{ +/// GLM_GTC_matrix_transform extension: Add transformation matrices +namespace matrix_transform { - namespace test{ - bool main_gtc_matrix_transform(); - }//namespace test + /// @addtogroup gtc_matrix_transform + /// @{ - namespace gtc{ - //! GLM_GTC_matrix_transform extension: Add transformation matrices - namespace matrix_transform - { - /// \addtogroup gtc_matrix_transform - ///@{ - - //! Builds a translation 4 * 4 matrix created from a vector of 3 components. - //! \sa - gtc_matrix_transform - //! \sa - gtx_transform: - //! - glm::gtx::transform::translate(T x, T y, T z) - //! - glm::gtx::transform::translate(detail::tmat4x4 const & m, T x, T y, T z) - template - detail::tmat4x4 translate( - detail::tmat4x4 const & m, - detail::tvec3 const & v); + /// Builds a translation 4 * 4 matrix created from a vector of 3 components. + /// @see - gtc_matrix_transform + /// @see - gtx_transform: + /// - @link glm::gtx::transform::translate(T x, T y, T z) translate(T x, T y, T z) @endlink + /// - @link glm::gtx::transform::translate(detail::tmat4x4 const & m, T x, T y, T z) translate(mat4x4 const & m, T x, T y, T z) @endlink + template + detail::tmat4x4 translate( + detail::tmat4x4 const & m, + detail::tvec3 const & v); - //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. - //! \sa - gtc_matrix_transform - //! \sa - gtx_transform: - //! - \link glm::gtx::transform::rotate(T angle, T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) \endlink - //! - \link glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) \endlink - template - detail::tmat4x4 rotate( - detail::tmat4x4 const & m, - T const & angle, - detail::tvec3 const & v); + /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. + /// @see - gtc_matrix_transform + /// @see - gtx_transform: + /// - @link glm::gtx::transform::rotate(T angle, T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) @endlink + template + detail::tmat4x4 rotate( + detail::tmat4x4 const & m, + T const & angle, + detail::tvec3 const & v); - //! Builds a scale 4 * 4 matrix created from 3 scalars. - //! \sa - gtc_matrix_transform - //! \sa - gtx_transform: - //! - \link glm::gtx::transform::scale(T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) \endlink - //! - \link glm::gtx::transform::scale(detail::tmat4x4 const & m, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) \endlink - template - detail::tmat4x4 scale( - detail::tmat4x4 const & m, - detail::tvec3 const & v); + /// Builds a scale 4 * 4 matrix created from 3 scalars. + /// @see - gtc_matrix_transform + /// @see - gtx_transform: + /// - @link glm::gtx::transform::scale(T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::scale(detail::tmat4x4 const & m, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) @endlink + template + detail::tmat4x4 scale( + detail::tmat4x4 const & m, + detail::tvec3 const & v); - //! Creates a matrix for an orthographic parallel viewing volume. - //! \sa - 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 - template - detail::tmat4x4 ortho( - T const & left, - T const & right, - T const & bottom, - T const & top, - T const & zNear, - T const & zFar); + /// 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 + template + detail::tmat4x4 ortho( + T const & left, + T const & right, + T const & bottom, + T const & top, + T const & zNear, + T const & zFar); - //! Creates a matrix for projecting two-dimensional coordinates onto the screen. - //! \sa - 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 - template - detail::tmat4x4 ortho( - T const & left, - T const & right, - T const & bottom, - T const & top); + /// 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 + template + detail::tmat4x4 ortho( + T const & left, + T const & right, + T const & bottom, + T const & top); - //! Creates a frustum matrix. - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 frustum( - T const & left, - T const & right, - T const & bottom, - T const & top, - T const & nearVal, - T const & farVal); + /// Creates a frustum matrix. + /// @see - gtc_matrix_transform + template + detail::tmat4x4 frustum( + T const & left, + T const & right, + T const & bottom, + T const & top, + T const & nearVal, + T const & farVal); - //! Creates a matrix for a symetric perspective-view frustum. - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 perspective( - T const & fovy, - T const & aspect, - T const & zNear, - T const & zFar); + /// Creates a matrix for a symetric perspective-view frustum. + /// @see - gtc_matrix_transform + template + detail::tmat4x4 perspective( + T const & fovy, + T const & aspect, + T const & zNear, + T const & zFar); - //! Builds a perspective projection matrix based on a field of view - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 perspectiveFov( - valType const & fov, - valType const & width, - valType const & height, - valType const & zNear, - valType const & zFar); + /// Builds a perspective projection matrix based on a field of view + /// @see - gtc_matrix_transform + template + detail::tmat4x4 perspectiveFov( + valType const & fov, + valType const & width, + valType const & height, + valType const & zNear, + valType const & zFar); - //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 infinitePerspective( - T fovy, T aspect, T zNear); + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . + /// @see - gtc_matrix_transform + template + detail::tmat4x4 infinitePerspective( + T fovy, T aspect, T zNear); - //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 tweakedInfinitePerspective( - T fovy, T aspect, T zNear); + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// @see - gtc_matrix_transform + template + detail::tmat4x4 tweakedInfinitePerspective( + T fovy, T aspect, T zNear); - //! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - //! \sa - gtc_matrix_transform - template - detail::tvec3 project( - detail::tvec3 const & obj, - detail::tmat4x4 const & model, - detail::tmat4x4 const & proj, - detail::tvec4 const & viewport); + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// @see - gtc_matrix_transform + template + detail::tvec3 project( + detail::tvec3 const & obj, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport); - //! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - //! \sa - gtc_matrix_transform - template - detail::tvec3 unProject( - detail::tvec3 const & win, - detail::tmat4x4 const & model, - detail::tmat4x4 const & proj, - detail::tvec4 const & viewport); + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// @see - gtc_matrix_transform + template + detail::tvec3 unProject( + detail::tvec3 const & win, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport); - //! Define a picking region - //! \sa - gtc_matrix_transform - template - detail::tmat4x4 pickMatrix( - detail::tvec2 const & center, - detail::tvec2 const & delta, - detail::tvec4 const & viewport); + /// Define a picking region + /// @see - gtc_matrix_transform + template + detail::tmat4x4 pickMatrix( + detail::tvec2 const & center, + detail::tvec2 const & delta, + detail::tvec4 const & viewport); - //! Build a look at view matrix. - //! \sa - gtc_matrix_transform: - //! - \link frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)\endlink - //! \param eye Position of the camera - //! \param center Position where the camera is looking at - //! \param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - template - detail::tmat4x4 lookAt( - detail::tvec3 const & eye, - detail::tvec3 const & center, - detail::tvec3 const & up); + /// Build a look at view matrix. + /// @see - gtc_matrix_transform: + /// - @link frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) @endlink + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + template + detail::tmat4x4 lookAt( + detail::tvec3 const & eye, + detail::tvec3 const & center, + detail::tvec3 const & up); - ///@} - }//namespace matrix_transform - }//namespace gtc + /// @} +}//namespace matrix_transform +}//namespace gtc }//namespace glm #include "matrix_transform.inl" From 231bcde7e33710fb1dd8d88732337ee4744650f5 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 16 May 2011 19:28:59 +0100 Subject: [PATCH 009/103] Improved doxygens documentation --- glm/gtc/matrix_transform.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 09acf6c4..581e3c5a 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -20,13 +20,12 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// +/// @ref gtc_matrix_transform /// @file glm/gtc/matrix_transform.hpp /// @date 2009-04-29 / 2011-05-16 /// @author Christophe Riccio /// -/// @ref gtc_matrix_transform /// @see core (dependence) -/// @see gtc_matrix_transform /// @see gtx_transform /// @see gtx_transform2 /////////////////////////////////////////////////////////////////////////////////// @@ -58,6 +57,7 @@ namespace matrix_transform /// @see - gtx_transform: /// - @link glm::gtx::transform::translate(T x, T y, T z) translate(T x, T y, T z) @endlink /// - @link glm::gtx::transform::translate(detail::tmat4x4 const & m, T x, T y, T z) translate(mat4x4 const & m, T x, T y, T z) @endlink + /// - @link glm::gtx::transform::translate(detail::tvec3 const & v) translate(vec3 const & v) @endlink template detail::tmat4x4 translate( detail::tmat4x4 const & m, @@ -68,6 +68,7 @@ namespace matrix_transform /// @see - gtx_transform: /// - @link glm::gtx::transform::rotate(T angle, T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) @endlink /// - @link glm::gtx::transform::rotate(detail::tmat4x4 const & m, T angle, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::rotate(T angle, detail::tvec3 const & v) rotate(T const & angle, vec3 const & v) @endlink template detail::tmat4x4 rotate( detail::tmat4x4 const & m, @@ -77,8 +78,9 @@ namespace matrix_transform /// Builds a scale 4 * 4 matrix created from 3 scalars. /// @see - gtc_matrix_transform /// @see - gtx_transform: - /// - @link glm::gtx::transform::scale(T x, T y, T z) rotate(T const & angle, T const & x, T const & y, T const & z) @endlink - /// - @link glm::gtx::transform::scale(detail::tmat4x4 const & m, T x, T y, T z) rotate(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::scale(T x, T y, T z) scale(T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::scale(detail::tmat4x4 const & m, T x, T y, T z) scale(mat4x4 const & m, T const & angle, T const & x, T const & y, T const & z) @endlink + /// - @link glm::gtx::transform::scale(detail::tvec3 const & v) scale(vec3 const & v) @endlink template detail::tmat4x4 scale( detail::tmat4x4 const & m, From d44abf89f4fa62ab640cb8b7fc62704a2acc0b8a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 19 May 2011 01:14:13 +0100 Subject: [PATCH 010/103] Updated release number --- glm/core/setup.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index d8d0dc4f..d4124369 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -13,11 +13,11 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // Version -#define GLM_VERSION 92 +#define GLM_VERSION 93 #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 -#define GLM_VERSION_PATCH 2 -#define GLM_VERSION_REVISION 1 +#define GLM_VERSION_PATCH 3 +#define GLM_VERSION_REVISION 0 /////////////////////////////////////////////////////////////////////////////////////////////////// From f5fd037ade6b5c40ecf52e28c10543885f9cfc6b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 20 May 2011 18:58:29 +0100 Subject: [PATCH 011/103] Updated doxygen documentation --- glm/gtc/matrix_access.hpp | 63 +++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp index 670fa909..f9f7feae 100644 --- a/glm/gtc/matrix_access.hpp +++ b/glm/gtc/matrix_access.hpp @@ -1,14 +1,32 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-27 -// Updated : 2010-11-12 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_access.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2011 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 gtc_matrix_access +/// @file glm/gtc/matrix_access.hpp +/// @date 2005-12-27 / 2011-05-16 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_matrix_access #define glm_gtc_matrix_access @@ -24,41 +42,40 @@ 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 - ///@{ + /// @addtogroup gtc_matrix_access + /// @{ - //! Get a specific row of a matrix. - //! From GLM_GTC_matrix_access extension. + /// Get a specific row of a matrix. + /// @see - gtc_matrix_access template typename genType::row_type row( genType const & m, int index); - //! Set a specific row to a matrix. - //! From GLM_GTC_matrix_access extension. + /// Set a specific row to a matrix. + /// @see - gtc_matrix_access template genType row( genType const & m, int index, typename genType::row_type const & x); - //! Get a specific column of a matrix. - //! From GLM_GTC_matrix_access extension. + /// Get a specific column of a matrix. + /// @see - gtc_matrix_access template typename genType::col_type column( genType const & m, int index); - //! Set a specific column to a matrix. - //! From GLM_GTC_matrix_access extension. + /// Set a specific column to a matrix. + /// @see - gtc_matrix_access template genType column( genType const & m, int index, typename genType::col_type const & x); - ///@} - + /// @} }//namespace matrix_access }//namespace gtc }//namespace glm From f58cc0900f582fe5f3f39de3d8d0db3016b44297 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 25 May 2011 19:59:31 +0100 Subject: [PATCH 012/103] Added length function tests --- test/core/CMakeLists.txt | 1 + test/core/core_type_length.cpp | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 test/core/core_type_length.cpp diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index d851ac7d..9b3c64e3 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -1,6 +1,7 @@ glmCreateTestGTC(core_type_float) glmCreateTestGTC(core_type_half) glmCreateTestGTC(core_type_int) +glmCreateTestGTC(core_type_length) glmCreateTestGTC(core_type_mat2x2) glmCreateTestGTC(core_type_mat2x3) glmCreateTestGTC(core_type_mat2x4) diff --git a/test/core/core_type_length.cpp b/test/core/core_type_length.cpp new file mode 100644 index 00000000..7f5dadb9 --- /dev/null +++ b/test/core/core_type_length.cpp @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2011-05-25 +// Updated : 2011-05-25 +// Licence : This source is under MIT License +// File : test/core/type_length.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +int test_length_mat_non_squared() +{ + int Error = 0; + + Error += glm::mat2x3().length() == 6 ? 0 : 1; + Error += glm::mat2x4().length() == 8 ? 0 : 1; + Error += glm::mat3x2().length() == 6 ? 0 : 1; + Error += glm::mat3x4().length() == 12 ? 0 : 1; + Error += glm::mat4x2().length() == 8 ? 0 : 1; + Error += glm::mat4x3().length() == 12 ? 0 : 1; + + return Error; +} + +int test_length_mat() +{ + int Error = 0; + + Error += glm::mat2().length() == 4 ? 0 : 1; + Error += glm::mat3().length() == 9 ? 0 : 1; + Error += glm::mat4().length() == 16 ? 0 : 1; + Error += glm::mat2x2().length() == 4 ? 0 : 1; + Error += glm::mat3x3().length() == 9 ? 0 : 1; + Error += glm::mat4x4().length() == 16 ? 0 : 1; + + return Error; +} + +int test_length_vec() +{ + + int Error = 0; + + Error += glm::vec2().length() == 2 ? 0 : 1; + Error += glm::vec3().length() == 3 ? 0 : 1; + Error += glm::vec4().length() == 4 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_length_vec(); + Error += test_length_mat(); + Error += test_length_mat_non_squared(); + + return Error; +} + From 706c29963682b96160b03f9f264f25650a564d9a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 26 May 2011 02:23:51 +0100 Subject: [PATCH 013/103] Added length functions to matrix types and quaternions and tests. Ticket #97 --- glm/core/type_mat2x2.hpp | 1 + glm/core/type_mat2x2.inl | 6 +++ glm/core/type_mat2x3.hpp | 1 + glm/core/type_mat2x3.inl | 6 +++ glm/core/type_mat2x4.hpp | 1 + glm/core/type_mat2x4.inl | 6 +++ glm/core/type_mat3x2.hpp | 1 + glm/core/type_mat3x2.inl | 6 +++ glm/core/type_mat3x3.hpp | 1 + glm/core/type_mat3x3.inl | 6 +++ glm/core/type_mat3x4.hpp | 1 + glm/core/type_mat3x4.inl | 6 +++ glm/core/type_mat4x2.hpp | 1 + glm/core/type_mat4x2.inl | 8 +++- glm/core/type_mat4x3.hpp | 1 + glm/core/type_mat4x3.inl | 8 +++- glm/core/type_mat4x4.hpp | 1 + glm/core/type_mat4x4.inl | 8 +++- glm/gtc/quaternion.hpp | 8 +++- test/core/core_type_length.cpp | 69 ++++++++++++++++++++++++++++------ 20 files changed, 130 insertions(+), 16 deletions(-) diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index aade1ef4..d3543245 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec2 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index 7a53a969..12d04840 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat2x2::size_type tmat2x2::length() const + { + return 2; + } + template GLM_FUNC_QUALIFIER typename tmat2x2::size_type tmat2x2::col_size() { diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index ed87f9e2..45169a8e 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec2 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 83e8b2e3..77441fb0 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::length() const + { + return 2; + } + template GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::col_size() { diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index a14cc033..229b9996 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec2 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index b19193f6..4736805d 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat2x4::size_type tmat2x4::length() const + { + return 2; + } + template GLM_FUNC_QUALIFIER typename tmat2x4::size_type tmat2x4::col_size() { diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 3457b72f..2c61e5c7 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec3 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index 5fddb4c1..ec95a3dc 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::length() const + { + return 2; + } + template GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::col_size() { diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index bf18c167..7d534a93 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec3 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index 667f2235..80a3e8ed 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat3x3::size_type tmat3x3::length() const + { + return 3; + } + template GLM_FUNC_QUALIFIER typename tmat3x3::size_type tmat3x3::col_size() { diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 1f84ec7b..fa96870f 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec3 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index 3d322718..e840fc19 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::length() const + { + return 3; + } + template GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::col_size() { diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index 3354ce8e..7959423f 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec4 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index cb30a98c..7121d1b9 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2006-10-01 -// Updated : 2010-02-03 +// Updated : 2011-05-26 // Licence : This source is under MIT License // File : glm/core/type_mat4x2.inl /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::length() const + { + return 4; + } + template GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::col_size() { diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index b15a3c30..226b0dc2 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec4 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index b882af27..af199e70 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2006-04-17 -// Updated : 2010-02-02 +// Updated : 2011-05-26 // Licence : This source is under MIT License // File : glm/core/type_mat4x3.inl /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::length() const + { + return 4; + } + template GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::col_size() { diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index 6aa1f68a..4e510fd1 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -45,6 +45,7 @@ namespace glm typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec4 row_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index 8df4b062..593ff283 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2005-01-27 -// Updated : 2010-02-05 +// Updated : 2011-05-26 // Licence : This source is under MIT License // File : glm/core/type_mat4x4.inl /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -10,6 +10,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::length() const + { + return 4; + } + template GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::col_size() { diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index d5d087a8..923b810c 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -35,10 +35,16 @@ namespace detail template struct tquat// : public genType { - typedef T value_type; + + enum ctor{null}; + + typedef T value_type; + typedef std::size_t size_type; public: value_type x, y, z, w; + + GLM_FUNC_DECL size_type length() const; // Constructors tquat(); diff --git a/test/core/core_type_length.cpp b/test/core/core_type_length.cpp index 7f5dadb9..7b496173 100644 --- a/test/core/core_type_length.cpp +++ b/test/core/core_type_length.cpp @@ -8,17 +8,32 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include +#include int test_length_mat_non_squared() { int Error = 0; + + Error += glm::mat2x3().length() == 2 ? 0 : 1; + Error += glm::mat2x4().length() == 2 ? 0 : 1; + Error += glm::mat3x2().length() == 3 ? 0 : 1; + Error += glm::mat3x4().length() == 3 ? 0 : 1; + Error += glm::mat4x2().length() == 4 ? 0 : 1; + Error += glm::mat4x3().length() == 4 ? 0 : 1; - Error += glm::mat2x3().length() == 6 ? 0 : 1; - Error += glm::mat2x4().length() == 8 ? 0 : 1; - Error += glm::mat3x2().length() == 6 ? 0 : 1; - Error += glm::mat3x4().length() == 12 ? 0 : 1; - Error += glm::mat4x2().length() == 8 ? 0 : 1; - Error += glm::mat4x3().length() == 12 ? 0 : 1; + Error += glm::dmat2x3().length() == 2 ? 0 : 1; + Error += glm::dmat2x4().length() == 2 ? 0 : 1; + Error += glm::dmat3x2().length() == 3 ? 0 : 1; + Error += glm::dmat3x4().length() == 3 ? 0 : 1; + Error += glm::dmat4x2().length() == 4 ? 0 : 1; + Error += glm::dmat4x3().length() == 4 ? 0 : 1; + + Error += glm::hmat2x3().length() == 2 ? 0 : 1; + Error += glm::hmat2x4().length() == 2 ? 0 : 1; + Error += glm::hmat3x2().length() == 3 ? 0 : 1; + Error += glm::hmat3x4().length() == 3 ? 0 : 1; + Error += glm::hmat4x2().length() == 4 ? 0 : 1; + Error += glm::hmat4x3().length() == 4 ? 0 : 1; return Error; } @@ -27,12 +42,26 @@ int test_length_mat() { int Error = 0; - Error += glm::mat2().length() == 4 ? 0 : 1; - Error += glm::mat3().length() == 9 ? 0 : 1; - Error += glm::mat4().length() == 16 ? 0 : 1; - Error += glm::mat2x2().length() == 4 ? 0 : 1; - Error += glm::mat3x3().length() == 9 ? 0 : 1; - Error += glm::mat4x4().length() == 16 ? 0 : 1; + Error += glm::mat2().length() == 2 ? 0 : 1; + Error += glm::mat3().length() == 3 ? 0 : 1; + Error += glm::mat4().length() == 4 ? 0 : 1; + Error += glm::mat2x2().length() == 2 ? 0 : 1; + Error += glm::mat3x3().length() == 3 ? 0 : 1; + Error += glm::mat4x4().length() == 4 ? 0 : 1; + + Error += glm::dmat2().length() == 2 ? 0 : 1; + Error += glm::dmat3().length() == 3 ? 0 : 1; + Error += glm::dmat4().length() == 4 ? 0 : 1; + Error += glm::dmat2x2().length() == 2 ? 0 : 1; + Error += glm::dmat3x3().length() == 3 ? 0 : 1; + Error += glm::dmat4x4().length() == 4 ? 0 : 1; + + Error += glm::hmat2().length() == 2 ? 0 : 1; + Error += glm::hmat3().length() == 3 ? 0 : 1; + Error += glm::hmat4().length() == 4 ? 0 : 1; + Error += glm::hmat2x2().length() == 2 ? 0 : 1; + Error += glm::hmat3x3().length() == 3 ? 0 : 1; + Error += glm::hmat4x4().length() == 4 ? 0 : 1; return Error; } @@ -45,6 +74,22 @@ int test_length_vec() Error += glm::vec2().length() == 2 ? 0 : 1; Error += glm::vec3().length() == 3 ? 0 : 1; Error += glm::vec4().length() == 4 ? 0 : 1; + + Error += glm::ivec2().length() == 2 ? 0 : 1; + Error += glm::ivec3().length() == 3 ? 0 : 1; + Error += glm::ivec4().length() == 4 ? 0 : 1; + + Error += glm::uvec2().length() == 2 ? 0 : 1; + Error += glm::uvec3().length() == 3 ? 0 : 1; + Error += glm::uvec4().length() == 4 ? 0 : 1; + + Error += glm::hvec2().length() == 2 ? 0 : 1; + Error += glm::hvec3().length() == 3 ? 0 : 1; + Error += glm::hvec4().length() == 4 ? 0 : 1; + + Error += glm::dvec2().length() == 2 ? 0 : 1; + Error += glm::dvec3().length() == 3 ? 0 : 1; + Error += glm::dvec4().length() == 4 ? 0 : 1; return Error; } From bf11a54bc8ad08329b3ed9817086c2d7746f0dd5 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 26 May 2011 22:39:08 +0100 Subject: [PATCH 014/103] Fixed half based types, missing non square matrices types --- glm/gtc/half_float.hpp | 47 ++++++++++++++++++++++++++++++++++++++---- glm/gtc/half_float.inl | 15 ++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 84f34a46..e7476529 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -27,7 +27,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec2 type; typedef tvec2 bool_type; @@ -119,7 +120,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec3 type; typedef tvec3 bool_type; @@ -215,7 +217,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec4 type; typedef tvec4 bool_type; @@ -343,7 +346,7 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre /// 2 * 2 matrix of half-precision floating-point numbers. /// From GLM_GTC_half_float extension. typedef detail::tmat2x2 hmat2; - + /// 3 * 3 matrix of half-precision floating-point numbers. /// From GLM_GTC_half_float extension. typedef detail::tmat3x3 hmat3; @@ -352,6 +355,42 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre /// From GLM_GTC_half_float extension. typedef detail::tmat4x4 hmat4; + /// 2 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x2 hmat2x2; + + /// 2 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x3 hmat2x3; + + /// 2 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x4 hmat2x4; + + /// 3 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x2 hmat3x2; + + /// 3 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x3 hmat3x3; + + /// 3 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x4 hmat3x4; + + /// 4 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x2 hmat4x2; + + /// 4 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x3 hmat4x3; + + /// 4 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x4 hmat4x4; + /// @} }// namespace half_float diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl index b3c36a99..68cd91a7 100644 --- a/glm/gtc/half_float.inl +++ b/glm/gtc/half_float.inl @@ -15,6 +15,11 @@ namespace detail{ ////////////////////////////////////// // hvec2 +GLM_FUNC_QUALIFIER tvec2::size_type tvec2::length() const +{ + return 2; +} + GLM_FUNC_QUALIFIER tvec2::size_type tvec2::value_size() { return 2; @@ -283,6 +288,11 @@ GLM_FUNC_QUALIFIER tref2 tvec2::swizzle(comp x, comp y) ////////////////////////////////////// // hvec3 +GLM_FUNC_QUALIFIER tvec3::size_type tvec3::length() const +{ + return 3; +} + GLM_FUNC_QUALIFIER tvec3::size_type tvec3::value_size() { return 3; @@ -595,6 +605,11 @@ GLM_FUNC_QUALIFIER tref3 tvec3::swizzle(comp x, comp y, comp z) ////////////////////////////////////// // hvec4 +GLM_FUNC_QUALIFIER tvec4::size_type tvec4::length() const +{ + return 4; +} + GLM_FUNC_QUALIFIER tvec4::size_type tvec4::value_size() { return 4; From f73b0c5b80dae4432bf67b7161c3f988e116c8ec Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 2 Jun 2011 13:39:30 +0100 Subject: [PATCH 015/103] Fixed more typos --- glm/core/func_common.hpp | 16 +- glm/core/func_exponential.hpp | 18 +- glm/core/func_geometric.hpp | 21 +- glm/core/func_integer.hpp | 250 ++++++++++---------- glm/core/func_matrix.hpp | 22 +- glm/core/func_noise.hpp | 22 +- glm/core/func_packing.hpp | 202 ++++++++-------- glm/core/func_trigonometric.hpp | 27 +-- glm/core/func_vector_relational.hpp | 345 ++++++++++++++-------------- glm/gtc/half_float.hpp | 2 +- glm/gtc/matrix_integer.hpp | 2 +- glm/gtc/quaternion.hpp | 1 - glm/gtc/type_ptr.hpp | 1 - glm/gtx/associated_min_max.hpp | 4 +- glm/gtx/bit.hpp | 2 +- glm/gtx/color_cast.hpp | 4 +- glm/gtx/color_space_YCoCg.hpp | 2 +- 17 files changed, 454 insertions(+), 487 deletions(-) diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp index 1af20fad..a3eb7ff0 100644 --- a/glm/core/func_common.hpp +++ b/glm/core/func_common.hpp @@ -12,12 +12,11 @@ #include "_fixes.hpp" -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace common //!< Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. { - namespace core{ - namespace function{ - namespace common{ //!< Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. - /// \addtogroup core_funcs ///@{ @@ -325,10 +324,9 @@ namespace glm genType ldexp(genType const & x, genIType const & exp); ///@} - }//namespace common - }//namespace function - }//namespace core - +}//namespace common +}//namespace function +}//namespace core using namespace core::function::common; }//namespace glm diff --git a/glm/core/func_exponential.hpp b/glm/core/func_exponential.hpp index c3bc0bd2..46e84e1b 100644 --- a/glm/core/func_exponential.hpp +++ b/glm/core/func_exponential.hpp @@ -10,13 +10,11 @@ #ifndef glm_core_func_exponential #define glm_core_func_exponential -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace exponential //!< Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. { - namespace core{ - namespace function{ - //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. - namespace exponential{ - /// \addtogroup core_funcs ///@{ @@ -73,11 +71,9 @@ namespace glm genType inversesqrt(genType const & x); ///@} - - }//namespace exponential - }//namespace function - }//namespace core - +}//namespace exponential +}//namespace function +}//namespace core using namespace core::function::exponential; }//namespace glm diff --git a/glm/core/func_geometric.hpp b/glm/core/func_geometric.hpp index bf572338..0cd2ee30 100644 --- a/glm/core/func_geometric.hpp +++ b/glm/core/func_geometric.hpp @@ -10,14 +10,13 @@ #ifndef glm_core_func_geometric #define glm_core_func_geometric -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace geometric //!< Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. { - namespace core{ - namespace function{ - namespace geometric{ //!< Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. - /// \addtogroup core_funcs - ///@{ + /// @{ //! Returns the length of x, i.e., sqrt(x * x). //! @@ -94,12 +93,10 @@ namespace glm genType const & N, typename genType::value_type const & eta); - ///@} - - }//namespace geometric - }//namespace function - }//namespace core - + /// @} +}//namespace geometric +}//namespace function +}//namespace core using namespace core::function::geometric; }//namespace glm diff --git a/glm/core/func_integer.hpp b/glm/core/func_integer.hpp index f75593a9..c4801d69 100644 --- a/glm/core/func_integer.hpp +++ b/glm/core/func_integer.hpp @@ -10,145 +10,141 @@ #ifndef glm_core_func_integer #define glm_core_func_integer -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace integer //!< Define integer functions from Section 8.8 of GLSL 4.00.8 specification. { - namespace core{ - namespace function{ - //! Define integer functions from Section 8.8 of GLSL 4.00.8 specification. - namespace integer{ + /// \addtogroup core_funcs + /// @{ - /// \addtogroup core_funcs - ///@{ + //! Adds 32-bit unsigned integer x and y, returning the sum + //! modulo pow(2, 32). The value carry is set to 0 if the sum was + //! less than pow(2, 32), or to 1 otherwise. + //! + //! \li GLSL uaddCarry man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + genUType uaddCarry( + genUType const & x, + genUType const & y, + genUType & carry); - //! Adds 32-bit unsigned integer x and y, returning the sum - //! modulo pow(2, 32). The value carry is set to 0 if the sum was - //! less than pow(2, 32), or to 1 otherwise. - //! - //! \li GLSL uaddCarry man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - genUType uaddCarry( - genUType const & x, - genUType const & y, - genUType & carry); - - //! Subtracts the 32-bit unsigned integer y from x, returning - //! the difference if non-negative, or pow(2, 32) plus the difference - //! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. - //! - //! \li GLSL usubBorrow man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - genUType usubBorrow( - genUType const & x, - genUType const & y, - genUType & borrow); + //! Subtracts the 32-bit unsigned integer y from x, returning + //! the difference if non-negative, or pow(2, 32) plus the difference + //! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. + //! + //! \li GLSL usubBorrow man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + genUType usubBorrow( + genUType const & x, + genUType const & y, + genUType & borrow); - //! Multiplies 32-bit integers x and y, producing a 64-bit - //! result. The 32 least-significant bits are returned in lsb. - //! The 32 most-significant bits are returned in msb. - //! - //! \li GLSL umulExtended man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - void umulExtended( - genUType const & x, - genUType const & y, - genUType & msb, - genUType & lsb); + //! Multiplies 32-bit integers x and y, producing a 64-bit + //! result. The 32 least-significant bits are returned in lsb. + //! The 32 most-significant bits are returned in msb. + //! + //! \li GLSL umulExtended man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + void umulExtended( + genUType const & x, + genUType const & y, + genUType & msb, + genUType & lsb); - //! Multiplies 32-bit integers x and y, producing a 64-bit - //! result. The 32 least-significant bits are returned in lsb. - //! The 32 most-significant bits are returned in msb. - //! - //! \li GLSL imulExtended man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - void imulExtended( - genIType const & x, - genIType const & y, - genIType & msb, - genIType & lsb); + //! Multiplies 32-bit integers x and y, producing a 64-bit + //! result. The 32 least-significant bits are returned in lsb. + //! The 32 most-significant bits are returned in msb. + //! + //! \li GLSL imulExtended man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + void imulExtended( + genIType const & x, + genIType const & y, + genIType & msb, + genIType & lsb); - //! Extracts bits [offset, offset + bits - 1] from value, - //! returning them in the least significant bits of the result. - //! For unsigned data types, the most significant bits of the - //! result will be set to zero. For signed data types, the - //! most significant bits will be set to the value of bit offset + base – 1. - //! - //! If bits is zero, the result will be zero. The result will be - //! undefined if offset or bits is negative, or if the sum of - //! offset and bits is greater than the number of bits used - //! to store the operand. - //! - //! \li GLSL bitfieldExtract man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - genIUType bitfieldExtract( - genIUType const & Value, - int const & Offset, - int const & Bits); + //! Extracts bits [offset, offset + bits - 1] from value, + //! returning them in the least significant bits of the result. + //! For unsigned data types, the most significant bits of the + //! result will be set to zero. For signed data types, the + //! most significant bits will be set to the value of bit offset + base – 1. + //! + //! If bits is zero, the result will be zero. The result will be + //! undefined if offset or bits is negative, or if the sum of + //! offset and bits is greater than the number of bits used + //! to store the operand. + //! + //! \li GLSL bitfieldExtract man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + genIUType bitfieldExtract( + genIUType const & Value, + int const & Offset, + int const & Bits); - //! Returns the insertion the bits least-significant bits of insert into base. - //! - //! The result will have bits [offset, offset + bits - 1] taken - //! from bits [0, bits – 1] of insert, and all other bits taken - //! directly from the corresponding bits of base. If bits is - //! zero, the result will simply be base. The result will be - //! undefined if offset or bits is negative, or if the sum of - //! offset and bits is greater than the number of bits used to - //! store the operand. - //! - //! \li GLSL bitfieldInsert man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - genIUType bitfieldInsert( - genIUType const & Base, - genIUType const & Insert, - int const & Offset, - int const & Bits); + //! Returns the insertion the bits least-significant bits of insert into base. + //! + //! The result will have bits [offset, offset + bits - 1] taken + //! from bits [0, bits – 1] of insert, and all other bits taken + //! directly from the corresponding bits of base. If bits is + //! zero, the result will simply be base. The result will be + //! undefined if offset or bits is negative, or if the sum of + //! offset and bits is greater than the number of bits used to + //! store the operand. + //! + //! \li GLSL bitfieldInsert man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + genIUType bitfieldInsert( + genIUType const & Base, + genIUType const & Insert, + int const & Offset, + int const & Bits); - //! Returns the reversal of the bits of value. - //! The bit numbered n of the result will be taken from bit (bits - 1) - n of value, - //! where bits is the total number of bits used to represent value. - //! - //! \li GLSL bitfieldReverse man page - //! \li GLSL 4.00.08 specification, section 8.8 - template - genIUType bitfieldReverse(genIUType const & value); + //! Returns the reversal of the bits of value. + //! The bit numbered n of the result will be taken from bit (bits - 1) - n of value, + //! where bits is the total number of bits used to represent value. + //! + //! \li GLSL bitfieldReverse man page + //! \li GLSL 4.00.08 specification, section 8.8 + template + genIUType bitfieldReverse(genIUType const & value); - //! Returns the number of bits set to 1 in the binary representation of value. - //! - //! \li GLSL bitCount man page - //! \li GLSL 4.00.08 specification, section 8.8 - template class C> - typename C::signed_type bitCount(C const & Value); + //! Returns the number of bits set to 1 in the binary representation of value. + //! + //! \li GLSL bitCount man page + //! \li GLSL 4.00.08 specification, section 8.8 + template class C> + typename C::signed_type bitCount(C const & Value); - //! Returns the bit number of the least significant bit set to - //! 1 in the binary representation of value. - //! If value is zero, -1 will be returned. - //! - //! \li GLSL findLSB man page - //! \li GLSL 4.00.08 specification, section 8.8 - template class C> - typename C::signed_type findLSB(C const & Value); + //! Returns the bit number of the least significant bit set to + //! 1 in the binary representation of value. + //! If value is zero, -1 will be returned. + //! + //! \li GLSL findLSB man page + //! \li GLSL 4.00.08 specification, section 8.8 + template class C> + typename C::signed_type findLSB(C const & Value); - //! Returns the bit number of the most significant bit in the binary representation of value. - //! For positive integers, the result will be the bit number of the most significant bit set to 1. - //! For negative integers, the result will be the bit number of the most significant - //! bit set to 0. For a value of zero or negative one, -1 will be returned. - //! - //! \li GLSL findMSB man page - //! \li GLSL 4.00.08 specification, section 8.8 - template class C> - typename C::signed_type findMSB(C const & Value); - - ///@} - - }//namespace integer - }//namespace function - }//namespace core + //! Returns the bit number of the most significant bit in the binary representation of value. + //! For positive integers, the result will be the bit number of the most significant bit set to 1. + //! For negative integers, the result will be the bit number of the most significant + //! bit set to 0. For a value of zero or negative one, -1 will be returned. + //! + //! \li GLSL findMSB man page + //! \li GLSL 4.00.08 specification, section 8.8 + template class C> + typename C::signed_type findMSB(C const & Value); + /// @} +}//namespace integer +}//namespace function +}//namespace core using namespace core::function::integer; }//namespace glm diff --git a/glm/core/func_matrix.hpp b/glm/core/func_matrix.hpp index 14f0b91d..c2276af1 100644 --- a/glm/core/func_matrix.hpp +++ b/glm/core/func_matrix.hpp @@ -10,15 +10,13 @@ #ifndef glm_core_func_matrix #define glm_core_func_matrix -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace matrix //!< Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. { - namespace core{ - namespace function{ - //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. - namespace matrix{ - /// \addtogroup core_funcs - ///@{ + /// @{ //! Multiply matrix x by matrix y component-wise, i.e., //! result[i][j] is the scalar product of x[i][j] and y[i][j]. @@ -97,12 +95,10 @@ namespace glm detail::tmat4x4 inverse( detail::tmat4x4 const & m); - ///@} - - }//namespace matrix - }//namespace function - }//namespace core - + /// @} +}//namespace matrix +}//namespace function +}//namespace core using namespace core::function::matrix; }//namespace glm diff --git a/glm/core/func_noise.hpp b/glm/core/func_noise.hpp index 181ccee6..dfb9c95c 100644 --- a/glm/core/func_noise.hpp +++ b/glm/core/func_noise.hpp @@ -10,15 +10,13 @@ #ifndef glm_core_func_noise #define glm_core_func_noise -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace noise //< Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace. { - namespace core{ - namespace function{ - // Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace. - namespace noise{ - /// \addtogroup core_funcs - ///@{ + /// @{ //! Returns a 1D noise value based on the input value x. //! @@ -48,12 +46,10 @@ namespace glm template detail::tvec4 noise4(genType const & x); - ///@} - - }//namespace noise - }//namespace function - }//namespace core - + /// @} +}//namespace noise +}//namespace function +}//namespace core using namespace core::function::noise; }//namespace glm diff --git a/glm/core/func_packing.hpp b/glm/core/func_packing.hpp index 8f589e69..4b5d13c2 100644 --- a/glm/core/func_packing.hpp +++ b/glm/core/func_packing.hpp @@ -10,119 +10,115 @@ #ifndef glm_core_func_packing #define glm_core_func_packing -namespace glm +namespace glm{ +namespace core{ +namespace function{ +namespace packing //!< Define packing functions from section 8.4 floating-point pack and unpack functions of GLSL 4.00.8 specification { - namespace core{ - namespace function{ - //! Define packing functions from section 8.4 floating-point pack and unpack functions of GLSL 4.00.8 specification - namespace packing - { - /// \addtogroup core_funcs - ///@{ + /// \addtogroup core_funcs + ///@{ - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - //! \li GLSL packUnorm2x16 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::uint32 packUnorm2x16(detail::tvec2 const & v); + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + //! \li GLSL packUnorm2x16 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::uint32 packUnorm2x16(detail::tvec2 const & v); - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packUnorm4x8: round(clamp(c, 0, +1) * 255.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - //! \li GLSL packUnorm4x8 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::uint32 packUnorm4x8(detail::tvec4 const & v); + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + //! \li GLSL packUnorm4x8 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::uint32 packUnorm4x8(detail::tvec4 const & v); - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packSnorm4x8: round(clamp(c, -1, +1) * 127.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - //! \li GLSL packSnorm4x8 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::uint32 packSnorm4x8(detail::tvec4 const & v); + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + //! \li GLSL packSnorm4x8 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::uint32 packSnorm4x8(detail::tvec4 const & v); - //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - //! - //! The conversion for unpacked fixed-point value f to floating point is done as follows: - //! unpackUnorm2x16: f / 65535.0 - //! - //! The first component of the returned vector will be extracted from the least significant bits of the input; - //! the last component will be extracted from the most significant bits. - //! - //! \li GLSL unpackUnorm2x16 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::tvec2 unpackUnorm2x16(detail::uint32 const & p); + //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + //! + //! The conversion for unpacked fixed-point value f to floating point is done as follows: + //! unpackUnorm2x16: f / 65535.0 + //! + //! The first component of the returned vector will be extracted from the least significant bits of the input; + //! the last component will be extracted from the most significant bits. + //! + //! \li GLSL unpackUnorm2x16 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::tvec2 unpackUnorm2x16(detail::uint32 const & p); - //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - //! - //! The conversion for unpacked fixed-point value f to floating point is done as follows: - //! unpackUnorm4x8: f / 255.0 - //! - //! The first component of the returned vector will be extracted from the least significant bits of the input; - //! the last component will be extracted from the most significant bits. - //! - //! \li GLSL unpackUnorm4x8 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::tvec4 unpackUnorm4x8(detail::uint32 const & p); + //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + //! + //! The conversion for unpacked fixed-point value f to floating point is done as follows: + //! unpackUnorm4x8: f / 255.0 + //! + //! The first component of the returned vector will be extracted from the least significant bits of the input; + //! the last component will be extracted from the most significant bits. + //! + //! \li GLSL unpackUnorm4x8 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::tvec4 unpackUnorm4x8(detail::uint32 const & p); - //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - //! - //! The conversion for unpacked fixed-point value f to floating point is done as follows: - //! unpackSnorm4x8: clamp(f / 127.0, -1, +1) - //! - //! The first component of the returned vector will be extracted from the least significant bits of the input; - //! the last component will be extracted from the most significant bits. - //! - //! \li GLSL unpackSnorm4x8 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::tvec4 unpackSnorm4x8(detail::uint32 const & p); + //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + //! + //! The conversion for unpacked fixed-point value f to floating point is done as follows: + //! unpackSnorm4x8: clamp(f / 127.0, -1, +1) + //! + //! The first component of the returned vector will be extracted from the least significant bits of the input; + //! the last component will be extracted from the most significant bits. + //! + //! \li GLSL unpackSnorm4x8 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::tvec4 unpackSnorm4x8(detail::uint32 const & p); - //! Returns a double-precision value obtained by packing the components of v into a 64-bit value. - //! If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. - //! Otherwise, the bit- level representation of v is preserved. - //! The first vector component specifies the 32 least significant bits; - //! the second component specifies the 32 most significant bits. - //! - //! \li GLSL packDouble2x32 man page - //! \li GLSL 4.00.08 specification, section 8.4 - double packDouble2x32(detail::tvec2 const & v); + //! Returns a double-precision value obtained by packing the components of v into a 64-bit value. + //! If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. + //! Otherwise, the bit- level representation of v is preserved. + //! The first vector component specifies the 32 least significant bits; + //! the second component specifies the 32 most significant bits. + //! + //! \li GLSL packDouble2x32 man page + //! \li GLSL 4.00.08 specification, section 8.4 + double packDouble2x32(detail::tvec2 const & v); - //! Returns a two-component unsigned integer vector representation of v. - //! The bit-level representation of v is preserved. - //! The first component of the vector contains the 32 least significant bits of the double; - //! the second component consists the 32 most significant bits. - //! - //! \li GLSL unpackDouble2x32 man page - //! \li GLSL 4.00.08 specification, section 8.4 - detail::tvec2 unpackDouble2x32(double const & v); - - ///@} - - }//namespace packing - }//namespace function - }//namespace core + //! Returns a two-component unsigned integer vector representation of v. + //! The bit-level representation of v is preserved. + //! The first component of the vector contains the 32 least significant bits of the double; + //! the second component consists the 32 most significant bits. + //! + //! \li GLSL unpackDouble2x32 man page + //! \li GLSL 4.00.08 specification, section 8.4 + detail::tvec2 unpackDouble2x32(double const & v); + ///@} +}//namespace packing +}//namespace function +}//namespace core using namespace core::function::packing; }//namespace glm diff --git a/glm/core/func_trigonometric.hpp b/glm/core/func_trigonometric.hpp index aa34ebe7..2f8d7638 100644 --- a/glm/core/func_trigonometric.hpp +++ b/glm/core/func_trigonometric.hpp @@ -10,17 +10,16 @@ #ifndef glm_core_func_trigonometric #define glm_core_func_trigonometric -namespace glm +namespace glm{ +namespace core{ +namespace function{ +//! Define Angle and trigonometry functions +//! from Section 8.1 of GLSL 1.30.8 specification. +//! Included in glm namespace. +namespace trigonometric { - namespace core{ - namespace function{ - //! Define Angle and trigonometry functions - //! from Section 8.1 of GLSL 1.30.8 specification. - //! Included in glm namespace. - namespace trigonometric{ - /// \addtogroup core_funcs - ///@{ + /// @{ //! Converts degrees to radians and returns the result. //! @@ -140,12 +139,10 @@ namespace glm template genType atanh(genType const & x); - ///@} - - }//namespace trigonometric - }//namespace function - }//namespace core - + /// @} +}//namespace trigonometric +}//namespace function +}//namespace core using namespace core::function::trigonometric; }//namespace glm diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp index ffdc1a26..83a8cff9 100644 --- a/glm/core/func_vector_relational.hpp +++ b/glm/core/func_vector_relational.hpp @@ -12,201 +12,198 @@ #include "_detail.hpp" -namespace glm +namespace glm{ +namespace core{ +namespace function{ +//! Define vector relational functions from Section 8.6 of GLSL 1.30.8 specification. +//! Included in glm namespace. +namespace vector_relational { - namespace core{ - namespace function{ - //! Define vector relational functions from Section 8.6 of GLSL 1.30.8 specification. - //! Included in glm namespace. - namespace vector_relational + /// \addtogroup core_funcs + /// @{ + + //! Returns the component-wise comparison result of x < y. + //! + //! \li GLSL lessThan man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan + ( + vecType const & x, + vecType const & y + ) { - /// \addtogroup core_funcs - ///@{ + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'lessThan', GLM vector types required"); + GLM_STATIC_ASSERT(detail::is_bool::_NO, + "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); - //! Returns the component-wise comparison result of x < y. - //! - //! \li GLSL lessThan man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'lessThan', GLM vector types required"); - GLM_STATIC_ASSERT(detail::is_bool::_NO, - "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] < y[i]; - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] < y[i]; + return Result; + } - return Result; - } + //! Returns the component-wise comparison of result x <= y. + //! + //! \li GLSL lessThanEqual man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type lessThanEqual + ( + vecType const & x, + vecType const & y + ) + { + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'lessThanEqual', GLM vector types required"); + GLM_STATIC_ASSERT(detail::is_bool::_NO, + "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); - //! Returns the component-wise comparison of result x <= y. - //! - //! \li GLSL lessThanEqual man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type lessThanEqual - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'lessThanEqual', GLM vector types required"); - GLM_STATIC_ASSERT(detail::is_bool::_NO, - "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] <= y[i]; + return Result; + } - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] <= y[i]; - return Result; - } + //! Returns the component-wise comparison of result x > y. + //! + //! \li GLSL greaterThan man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThan + ( + vecType const & x, + vecType const & y + ) + { + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'greaterThan', GLM vector types required"); + GLM_STATIC_ASSERT(detail::is_bool::_NO, + "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); - //! Returns the component-wise comparison of result x > y. - //! - //! \li GLSL greaterThan man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThan - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'greaterThan', GLM vector types required"); - GLM_STATIC_ASSERT(detail::is_bool::_NO, - "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] > y[i]; + return Result; + } - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] > y[i]; - return Result; - } + //! Returns the component-wise comparison of result x >= y. + //! + //! \li GLSL greaterThanEqual man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThanEqual + ( + vecType const & x, + vecType const & y + ) + { + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'greaterThanEqual', GLM vector types required"); + GLM_STATIC_ASSERT(detail::is_bool::_NO, + "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); - //! Returns the component-wise comparison of result x >= y. - //! - //! \li GLSL greaterThanEqual man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThanEqual - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'greaterThanEqual', GLM vector types required"); - GLM_STATIC_ASSERT(detail::is_bool::_NO, - "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] >= y[i]; + return Result; + } - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] >= y[i]; - return Result; - } + //! Returns the component-wise comparison of result x == y. + //! + //! \li GLSL equal man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type equal + ( + vecType const & x, + vecType const & y + ) + { + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'equal', GLM vector types required"); - //! Returns the component-wise comparison of result x == y. - //! - //! \li GLSL equal man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type equal - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'equal', GLM vector types required"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] == y[i]; + return Result; + } - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] == y[i]; - return Result; - } + //! Returns the component-wise comparison of result x != y. + //! + //! \li GLSL notEqual man page + //! \li GLSL 1.30.08 specification, section 8.6 + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type notEqual + ( + vecType const & x, + vecType const & y + ) + { + GLM_STATIC_ASSERT(detail::is_vector >::_YES, + "Invalid template instantiation of 'notEqual', GLM vector types required"); - //! Returns the component-wise comparison of result x != y. - //! - //! \li GLSL notEqual man page - //! \li GLSL 1.30.08 specification, section 8.6 - template class vecType> - GLM_FUNC_QUALIFIER typename vecType::bool_type notEqual - ( - vecType const & x, - vecType const & y - ) - { - GLM_STATIC_ASSERT(detail::is_vector >::_YES, - "Invalid template instantiation of 'notEqual', GLM vector types required"); + typename vecType::bool_type Result(vecType::null); + for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) + Result[i] = x[i] != y[i]; + return Result; + } - typename vecType::bool_type Result(vecType::null); - for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) - Result[i] = x[i] != y[i]; - return Result; - } + //! Returns true if any component of x is true. + //! + //! \li GLSL any man page + //! \li GLSL 1.30.08 specification, section 8.6 + template