diff --git a/glm/gtc/reciprocal.hpp b/glm/gtc/reciprocal.hpp new file mode 100644 index 00000000..8c328aed --- /dev/null +++ b/glm/gtc/reciprocal.hpp @@ -0,0 +1,121 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2012 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 gtx_reciprocal +/// @file glm/gtx/reciprocal.hpp +/// @date 2008-10-09 / 2011-06-07 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/// +/// @defgroup gtx_reciprocal GLM_GTX_reciprocal: Reciprocal +/// @ingroup gtx +/// +/// @brief Define secant, cosecant and cotangent functions. +/// +/// need to be included to use these functionalities. +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef GLM_GTX_reciprocal +#define GLM_GTX_reciprocal GLM_VERSION + +// Dependency: +#include "../glm.hpp" + +#if(defined(GLM_MESSAGES) && !defined(glm_ext)) +# pragma message("GLM: GLM_GTX_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup gtx_reciprocal + /// @{ + + //! Secant function. + //! hypotenuse / adjacent or 1 / cos(x) + //! From GLM_GTX_reciprocal extension. + template + genType sec(genType const & angle); + + //! Cosecant function. + //! hypotenuse / opposite or 1 / sin(x) + //! From GLM_GTX_reciprocal extension. + template + genType csc(genType const & angle); + + //! Cotangent function. + //! adjacent / opposite or 1 / tan(x) + //! From GLM_GTX_reciprocal extension. + template + genType cot(genType const & angle); + + //! Inverse secant function. + //! From GLM_GTX_reciprocal extension. + template + genType asec(genType const & x); + + //! Inverse cosecant function. + //! From GLM_GTX_reciprocal extension. + template + genType acsc(genType const & x); + + //! Inverse cotangent function. + //! From GLM_GTX_reciprocal extension. + template + genType acot(genType const & x); + + //! Secant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType sech(genType const & angle); + + //! Cosecant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType csch(genType const & angle); + + //! Cotangent hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType coth(genType const & angle); + + //! Inverse secant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType asech(genType const & x); + + //! Inverse cosecant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType acsch(genType const & x); + + //! Inverse cotangent hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType acoth(genType const & x); + + /// @} +}//namespace glm + +#include "reciprocal.inl" + +#endif//GLM_GTX_reciprocal diff --git a/glm/gtx/reciprocal.inl b/glm/gtc/reciprocal.inl similarity index 100% rename from glm/gtx/reciprocal.inl rename to glm/gtc/reciprocal.inl diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp index 7916c503..0f69a644 100644 --- a/glm/gtx/bit.hpp +++ b/glm/gtx/bit.hpp @@ -61,7 +61,7 @@ namespace glm /// genType and genIType could be a scalar or a vector. /// @see gtx_bit template - genIUType extractField( + GLM_DEPRECATED genIUType extractField( genIUType const & v, sizeType const & first, sizeType const & count); @@ -69,12 +69,12 @@ namespace glm //! Find the lowest bit set to 1 in a integer variable. /// @see gtx_bit template - int lowestBit(genType const & value); + GLM_DEPRECATED int lowestBit(genType const & value); //! Find the highest bit set to 1 in a integer variable. /// @see gtx_bit template - int highestBit(genType const & value); + GLM_DEPRECATED int highestBit(genType const & value); //! Find the highest bit set to 1 in a integer variable and return its value. /// @see gtx_bit @@ -104,7 +104,7 @@ namespace glm //! Revert all bits of any integer based type. /// @see gtx_bit template - genType bitRevert(genType const & value); + GLM_DEPRECATED genType bitRevert(genType const & value); //! Rotate all bits to the right. /// @see gtx_bit diff --git a/glm/gtx/noise.hpp b/glm/gtx/noise.hpp index 704de26e..6db21f82 100644 --- a/glm/gtx/noise.hpp +++ b/glm/gtx/noise.hpp @@ -19,45 +19,8 @@ /// 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 gtx_noise -/// @file glm/gtx/noise.hpp -/// @date 2011-04-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_noise GLM_GTX_noise: Procedural noise functions -/// @ingroup gtx -/// -/// Defines 2D, 3D and 4D procedural noise functions -/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -/// https://github.com/ashima/webgl-noise -/// Following Stefan Gustavson's paper "Simplex noise demystified": -/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf -/// Defines the half-precision floating-point type, along with various typedefs for vectors and matrices. -/// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// -#ifndef GLM_GTX_noise -#define GLM_GTX_noise GLM_VERSION - -// Dependency: -#include "../glm.hpp" -#include "../gtc/noise.hpp" - -#if(defined(GLM_MESSAGES) && !defined(glm_ext)) -# pragma message("GLM: GLM_GTX_noise extension included") +#if(defined(GLM_MESSAGES)) +# pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random instead") #endif - -namespace glm -{ - /// @addtogroup gtx_noise - /// @{ - - /// @} -}//namespace glm - -#include "noise.inl" - -#endif//glm_gtx_noise diff --git a/glm/gtx/random.hpp b/glm/gtx/random.hpp index fd3bc570..6db21f82 100644 --- a/glm/gtx/random.hpp +++ b/glm/gtx/random.hpp @@ -19,89 +19,8 @@ /// 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 gtx_random -/// @file glm/gtx/random.hpp -/// @date 2006-01-16 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtc_half_float (dependence) -/// -/// @defgroup gtx_random GLM_GTX_random: Random -/// @ingroup gtx -/// -/// @brief Generate random number from various distribution methods -/// -/// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// -#ifndef GLM_GTX_random -#define GLM_GTX_random GLM_VERSION - -// Dependency: -#include "../glm.hpp" -#include "../gtc/random.hpp" - -#if(defined(GLM_MESSAGES) && !defined(glm_ext)) -# pragma message("GLM: GLM_GTX_random extension included") +#if(defined(GLM_MESSAGES)) +# pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random instead") #endif - -namespace glm -{ - /// @addtogroup gtx_random - /// @{ - - /// Generate a random number in the interval [-1, 1], according a linear distribution. - /// From GLM_GTX_random extension. - template T signedRand1(); - - template <> float signedRand1(); //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> double signedRand1(); //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec2 signedRand2(); //!< \brief Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec3 signedRand3(); //!< \brief Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec4 signedRand4(); //!< \brief Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - - template detail::tvec2 normalizedRand2(); //!< \brief Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::tvec2 normalizedRand2(T Min, T Max); //!< \brief Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::tvec3 normalizedRand3(); //!< \brief Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - template detail::tvec3 normalizedRand3(T Min, T Max); //!< \brief Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - - template T compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> float compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> double compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template T compRand1(T Min, T Max); //!< \brief Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec2 compRand2(T Min, T Max); //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec3 compRand3(T Min, T Max); //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec4 compRand4(T Min, T Max); //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec2 compRand2(const detail::tvec2& Min, const detail::tvec2& Max); //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec3 compRand3(const detail::tvec3& Min, const detail::tvec3& Max); //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::tvec3 compRand4(const detail::tvec4& Min, const detail::tvec4& Max); //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - - template detail::tvec2 vecRand2(); //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::tvec2 vecRand2(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::tvec3 vecRand3(); //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::tvec3 vecRand3(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::tvec4 vecRand4(); //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::tvec4 vecRand4(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - - template T gaussRand1(T mean, T std_deviation); //!< \brief Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec2 gaussRand2(T mean, T std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec3 gaussRand3(T mean, T std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec4 gaussRand4(T mean, T std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec2 gaussRand2(const detail::tvec2& mean, T std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec3 gaussRand3(const detail::tvec3& mean, T std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec4 gaussRand4(const detail::tvec4& mean, T std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec2 gaussRand2(T mean, const detail::tvec2& std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec3 gaussRand3(T mean, const detail::tvec3& std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec4 gaussRand4(T mean, const detail::tvec4& std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec2 gaussRand2(const detail::tvec2& mean, const detail::tvec2& std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec3 gaussRand3(const detail::tvec3& mean, const detail::tvec3& std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::tvec4 gaussRand4(const detail::tvec4& mean, const detail::tvec4& std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - - /// @} -}//namespace glm - -#include "random.inl" - -#endif//GLM_GTX_random diff --git a/glm/gtx/reciprocal.hpp b/glm/gtx/reciprocal.hpp index 8c328aed..26ba76ba 100644 --- a/glm/gtx/reciprocal.hpp +++ b/glm/gtx/reciprocal.hpp @@ -19,103 +19,8 @@ /// 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 gtx_reciprocal -/// @file glm/gtx/reciprocal.hpp -/// @date 2008-10-09 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_reciprocal GLM_GTX_reciprocal: Reciprocal -/// @ingroup gtx -/// -/// @brief Define secant, cosecant and cotangent functions. -/// -/// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// -#ifndef GLM_GTX_reciprocal -#define GLM_GTX_reciprocal GLM_VERSION - -// Dependency: -#include "../glm.hpp" - -#if(defined(GLM_MESSAGES) && !defined(glm_ext)) -# pragma message("GLM: GLM_GTX_reciprocal extension included") +#if(defined(GLM_MESSAGES)) +# pragma message("GLM: GLM_GTX_reciprocal extension is deprecated, include GLM_GTC_reciprocal instead") #endif - -namespace glm -{ - /// @addtogroup gtx_reciprocal - /// @{ - - //! Secant function. - //! hypotenuse / adjacent or 1 / cos(x) - //! From GLM_GTX_reciprocal extension. - template - genType sec(genType const & angle); - - //! Cosecant function. - //! hypotenuse / opposite or 1 / sin(x) - //! From GLM_GTX_reciprocal extension. - template - genType csc(genType const & angle); - - //! Cotangent function. - //! adjacent / opposite or 1 / tan(x) - //! From GLM_GTX_reciprocal extension. - template - genType cot(genType const & angle); - - //! Inverse secant function. - //! From GLM_GTX_reciprocal extension. - template - genType asec(genType const & x); - - //! Inverse cosecant function. - //! From GLM_GTX_reciprocal extension. - template - genType acsc(genType const & x); - - //! Inverse cotangent function. - //! From GLM_GTX_reciprocal extension. - template - genType acot(genType const & x); - - //! Secant hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType sech(genType const & angle); - - //! Cosecant hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType csch(genType const & angle); - - //! Cotangent hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType coth(genType const & angle); - - //! Inverse secant hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType asech(genType const & x); - - //! Inverse cosecant hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType acsch(genType const & x); - - //! Inverse cotangent hyperbolic function. - //! From GLM_GTX_reciprocal extension. - template - genType acoth(genType const & x); - - /// @} -}//namespace glm - -#include "reciprocal.inl" - -#endif//GLM_GTX_reciprocal diff --git a/glm/gtx/std_based_type.hpp b/glm/gtx/std_based_type.hpp index 327939f8..3d56e27f 100644 --- a/glm/gtx/std_based_type.hpp +++ b/glm/gtx/std_based_type.hpp @@ -52,27 +52,27 @@ namespace glm /// @{ /// Vector type based of two std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec2 size2; /// Vector type based of three std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec3 size3; /// Vector type based of four std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec4 size4; /// Vector type based of two std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec2 size2_t; /// Vector type based of three std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec3 size3_t; /// Vector type based of four std::size_t components. - /// @see - GLM_GTX_std_based_type + /// @see GLM_GTX_std_based_type typedef detail::tvec4 size4_t; /// @} diff --git a/glm/gtx/ulp.hpp b/glm/gtx/ulp.hpp new file mode 100644 index 00000000..c14e40b8 --- /dev/null +++ b/glm/gtx/ulp.hpp @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2012 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. +/////////////////////////////////////////////////////////////////////////////////// + +#if(defined(GLM_MESSAGES)) +# pragma message("GLM: GLM_GTX_ulp extension is deprecated, include GLM_GTC_ulp instead") +#endif