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 - ///@{ - - //! 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); + /// \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); + + //! 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); - - //! 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 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); + //! 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); + + //! 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 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 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 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 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 - ///@{ - - //! 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]; - - 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"); - - 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"); - - 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"); - - 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"); - - 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"); - - 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