Improved documentation

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent 177e0158b7
commit 9843d38b67
  1. 22
      glm/core/func_geometric.hpp
  2. 146
      glm/core/func_integer.hpp

@ -43,6 +43,8 @@ namespace glm
/// Returns the length of x, i.e., sqrt(x * x). /// Returns the length of x, i.e., sqrt(x * x).
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -51,6 +53,8 @@ namespace glm
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -60,6 +64,8 @@ namespace glm
/// Returns the dot product of x and y, i.e., result = x * y. /// Returns the dot product of x and y, i.e., result = x * y.
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -69,12 +75,14 @@ namespace glm
/// Returns the cross product of x and y. /// Returns the cross product of x and y.
/// ///
/// @tparam valType Floating-point scalar types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename T> template <typename valType>
detail::tvec3<T> cross( detail::tvec3<valType> cross(
detail::tvec3<T> const & x, detail::tvec3<valType> const & x,
detail::tvec3<T> const & y); detail::tvec3<valType> const & y);
/// Returns a vector in the same direction as x but with length of 1. /// Returns a vector in the same direction as x but with length of 1.
/// ///
@ -86,6 +94,8 @@ namespace glm
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -97,6 +107,8 @@ namespace glm
/// For the incident vector I and surface orientation N, /// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -108,6 +120,8 @@ namespace glm
/// and the ratio of indices of refraction eta, /// and the ratio of indices of refraction eta,
/// return the refraction vector. /// return the refraction vector.
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>

@ -43,10 +43,12 @@ namespace glm
/// @addtogroup core_func_integer /// @addtogroup core_func_integer
/// @{ /// @{
//! Adds 32-bit unsigned integer x and y, returning the sum /// 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 /// modulo pow(2, 32). The value carry is set to 0 if the sum was
//! less than pow(2, 32), or to 1 otherwise. /// less than pow(2, 32), or to 1 otherwise.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -55,10 +57,12 @@ namespace glm
genUType const & y, genUType const & y,
genUType & carry); genUType & carry);
//! Subtracts the 32-bit unsigned integer y from x, returning /// Subtracts the 32-bit unsigned integer y from x, returning
//! the difference if non-negative, or pow(2, 32) plus the difference /// 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. /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -67,10 +71,12 @@ namespace glm
genUType const & y, genUType const & y,
genUType & borrow); genUType & borrow);
//! Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb. /// The 32 most-significant bits are returned in msb.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -80,10 +86,12 @@ namespace glm
genUType & msb, genUType & msb,
genUType & lsb); genUType & lsb);
//! Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb. /// The 32 most-significant bits are returned in msb.
//! ///
/// @tparam genIType Signed integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIType> template <typename genIType>
@ -93,17 +101,19 @@ namespace glm
genIType & msb, genIType & msb,
genIType & lsb); genIType & lsb);
//! Extracts bits [offset, offset + bits - 1] from value, /// Extracts bits [offset, offset + bits - 1] from value,
//! returning them in the least significant bits of the result. /// returning them in the least significant bits of the result.
//! For unsigned data types, the most significant bits of the /// For unsigned data types, the most significant bits of the
//! result will be set to zero. For signed data types, 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. /// 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 /// 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 /// undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used /// offset and bits is greater than the number of bits used
//! to store the operand. /// to store the operand.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
@ -112,16 +122,18 @@ namespace glm
int const & Offset, int const & Offset,
int const & Bits); int const & Bits);
//! Returns the insertion the bits least-significant bits of insert into base. /// Returns the insertion the bits least-significant bits of insert into base.
//! ///
//! The result will have bits [offset, offset + bits - 1] taken /// The result will have bits [offset, offset + bits - 1] taken
//! from bits [0, bits – 1] of insert, and all other bits taken /// from bits [0, bits – 1] of insert, and all other bits taken
//! directly from the corresponding bits of base. If bits is /// directly from the corresponding bits of base. If bits is
//! zero, the result will simply be base. The result will be /// zero, the result will simply be base. The result will be
//! undefined if offset or bits is negative, or if the sum of /// undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used to /// offset and bits is greater than the number of bits used to
//! store the operand. /// store the operand.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
@ -131,40 +143,54 @@ namespace glm
int const & Offset, int const & Offset,
int const & Bits); int const & Bits);
//! Returns the reversal of the bits of 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, /// 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. /// where bits is the total number of bits used to represent value.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
genIUType bitfieldReverse(genIUType const & value); genIUType bitfieldReverse(genIUType const & value);
//! Returns the number of bits set to 1 in the binary representation of value. /// Returns the number of bits set to 1 in the binary representation of value.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type bitCount(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported
template <typename T, template <typename> class genIUType>
//! Returns the bit number of the least significant bit set to typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
//! 1 in the binary representation of value.
//! If value is zero, -1 will be returned. /// 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.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type findLSB(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported
template <typename T, template <typename> class genIUType>
//! Returns the bit number of the most significant bit in the binary representation of value. typename genIUType<T>::signed_type findLSB(genIUType<T> const & 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 /// Returns the bit number of the most significant bit in the binary representation of value.
//! bit set to 0. For a value of zero or negative one, -1 will be returned. /// 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.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type findMSB(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
/// @} /// @}
}//namespace glm }//namespace glm

Loading…
Cancel
Save