Browse Source

Math: doc++, add search aliases for GLSL functions.

pull/231/head
Vladimír Vondruš 8 years ago
parent
commit
2136466f0f
  1. 2
      src/Magnum/Math/Angle.h
  2. 16
      src/Magnum/Math/Color.h
  3. 4
      src/Magnum/Math/Complex.h
  4. 7
      src/Magnum/Math/Functions.h
  5. 2
      src/Magnum/Math/Math.h
  6. 1
      src/Magnum/Math/Matrix.h
  7. 1
      src/Magnum/Math/Matrix4.h
  8. 4
      src/Magnum/Math/Packing.h
  9. 8
      src/Magnum/Math/Quaternion.h
  10. 2
      src/Magnum/Math/Range.h
  11. 2
      src/Magnum/Math/RectangularMatrix.h
  12. 29
      src/Magnum/Math/Vector.h
  13. 2
      src/Magnum/Math/Vector2.h
  14. 2
      src/Magnum/Math/Vector3.h

2
src/Magnum/Math/Angle.h

@ -163,6 +163,7 @@ template<class T> class Deg: public Unit<Deg, T> {
* Performs conversion from radians to degrees, i.e.: @f[ * Performs conversion from radians to degrees, i.e.: @f[
* deg = 180 \frac {rad} \pi * deg = 180 \frac {rad} \pi
* @f] * @f]
* @m_keyword{degrees(),GLSL degrees(),}
*/ */
constexpr /*implicit*/ Deg(Unit<Rad, T> value); constexpr /*implicit*/ Deg(Unit<Rad, T> value);
}; };
@ -238,6 +239,7 @@ template<class T> class Rad: public Unit<Rad, T> {
* Performs conversion from degrees to radians, i.e.: @f[ * Performs conversion from degrees to radians, i.e.: @f[
* rad = deg \frac \pi 180 * rad = deg \frac \pi 180
* @f] * @f]
* @m_keyword{radians(),GLSL radians(),}
*/ */
constexpr /*implicit*/ Rad(Unit<Deg, T> value); constexpr /*implicit*/ Rad(Unit<Deg, T> value);
}; };

16
src/Magnum/Math/Color.h

@ -318,7 +318,7 @@ template<class T> class Color3: public Vector3<T> {
typedef std::tuple<Deg<FloatingPointType>, FloatingPointType, FloatingPointType> Hsv; typedef std::tuple<Deg<FloatingPointType>, FloatingPointType, FloatingPointType> Hsv;
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief Hsv /** @brief @copybrief Hsv
* @deprecated Use @ref Hsv instead. * @deprecated Use @ref Hsv instead.
*/ */
typedef CORRADE_DEPRECATED("use Hsv instead") Hsv HSV; typedef CORRADE_DEPRECATED("use Hsv instead") Hsv HSV;
@ -340,13 +340,13 @@ template<class T> class Color3: public Vector3<T> {
} }
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief fromHsv(const Hsv&) /** @brief @copybrief fromHsv(const Hsv&)
* @deprecated Use @ref fromHsv(const Hsv&) instead. * @deprecated Use @ref fromHsv(const Hsv&) instead.
*/ */
CORRADE_DEPRECATED("use fromHsv() instead") static Color3<T> fromHSV(const Hsv& hsv) { CORRADE_DEPRECATED("use fromHsv() instead") static Color3<T> fromHSV(const Hsv& hsv) {
return fromHsv(hsv); return fromHsv(hsv);
} }
/** @copybrief fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType) /** @brief @copybrief fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType)
* @deprecated Use @ref fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType) * @deprecated Use @ref fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType)
* instead. * instead.
*/ */
@ -488,7 +488,7 @@ template<class T> class Color3: public Vector3<T> {
} }
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief toHsv() /** @brief @copybrief toHsv()
* @deprecated Use @ref toHsv() instead. * @deprecated Use @ref toHsv() instead.
*/ */
CORRADE_DEPRECATED("use toHsv() instead") Hsv toHSV() const { return toHsv(); } CORRADE_DEPRECATED("use toHsv() instead") Hsv toHSV() const { return toHsv(); }
@ -611,7 +611,7 @@ class Color4: public Vector4<T> {
typedef typename Color3<T>::Hsv Hsv; typedef typename Color3<T>::Hsv Hsv;
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief Hsv /** @brief @copybrief Hsv
* @deprecated Use @ref Hsv instead. * @deprecated Use @ref Hsv instead.
*/ */
typedef CORRADE_DEPRECATED("use Hsv instead") Hsv HSV; typedef CORRADE_DEPRECATED("use Hsv instead") Hsv HSV;
@ -696,13 +696,13 @@ class Color4: public Vector4<T> {
} }
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief fromHsv(const Hsv&, T) /** @brief @copybrief fromHsv(const Hsv&, T)
* @deprecated Use @ref fromHsv(const Hsv&, T) instead. * @deprecated Use @ref fromHsv(const Hsv&, T) instead.
*/ */
CORRADE_DEPRECATED("use fromHsv() instead") static Color4<T> fromHSV(const Hsv& hsv, T a = Implementation::fullChannel<T>()) { CORRADE_DEPRECATED("use fromHsv() instead") static Color4<T> fromHSV(const Hsv& hsv, T a = Implementation::fullChannel<T>()) {
return fromHsv(hsv, a); return fromHsv(hsv, a);
} }
/** @copybrief fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType, T) /** @brief @copybrief fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType, T)
* @deprecated Use @ref fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType, T) * @deprecated Use @ref fromHsv(Deg<FloatingPointType>, FloatingPointType, FloatingPointType, T)
* instead. * instead.
*/ */
@ -891,7 +891,7 @@ class Color4: public Vector4<T> {
} }
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief toHsv() /** @brief @copybrief toHsv()
* @deprecated Use @ref toHsv() instead. * @deprecated Use @ref toHsv() instead.
*/ */
CORRADE_DEPRECATED("use toHsv() instead") Hsv toHSV() const { return toHsv(); } CORRADE_DEPRECATED("use toHsv() instead") Hsv toHSV() const { return toHsv(); }

4
src/Magnum/Math/Complex.h

@ -90,7 +90,7 @@ template<class T> class Complex {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief Math::dot(const Complex<T>&, const Complex<T>&) * @brief @copybrief Math::dot(const Complex<T>&, const Complex<T>&)
* @deprecated Use @ref Math::dot(const Complex<T>&, const Complex<T>&) * @deprecated Use @ref Math::dot(const Complex<T>&, const Complex<T>&)
* instead. * instead.
*/ */
@ -99,7 +99,7 @@ template<class T> class Complex {
} }
/** /**
* @copybrief Math::angle(const Complex<T>&, const Complex<T>&) * @brief @copybrief Math::angle(const Complex<T>&, const Complex<T>&)
* @deprecated Use @ref Math::angle(const Complex<T>&, const Complex<T>&) * @deprecated Use @ref Math::angle(const Complex<T>&, const Complex<T>&)
* instead. * instead.
*/ */

7
src/Magnum/Math/Functions.h

@ -517,6 +517,7 @@ template<std::size_t size, class T> Vector<size, T> sqrt(const Vector<size, T>&
@brief Inverse square root @brief Inverse square root
@see @ref sqrt(), @ref Vector::lengthInverted() @see @ref sqrt(), @ref Vector::lengthInverted()
@m_keyword{inversesqrt(),GLSL inversesqrt(),}
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
template<class T> inline T sqrtInverted(const T& a); template<class T> inline T sqrtInverted(const T& a);
@ -539,6 +540,7 @@ The interpolation for vectors is done as in following, similarly for scalars: @f
\boldsymbol v_{LERP} = (1 - t) \boldsymbol v_A + t \boldsymbol v_B \boldsymbol v_{LERP} = (1 - t) \boldsymbol v_A + t \boldsymbol v_B
@f] @f]
@see @ref lerpInverted(), @ref lerp(const Quaternion<T>&, const Quaternion<T>&, T) @see @ref lerpInverted(), @ref lerp(const Quaternion<T>&, const Quaternion<T>&, T)
@m_keyword{mix(),GLSL mix(),}
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
template<class T, class U> inline T lerp(const T& a, const T& b, U t); template<class T, class U> inline T lerp(const T& a, const T& b, U t);
@ -554,6 +556,7 @@ template<std::size_t size, class T, class U> inline typename std::enable_if<!Imp
/** @overload /** @overload
Similar to the above, but instead of multiplication and addition it just does Similar to the above, but instead of multiplication and addition it just does
component-wise selection from either @p a or @p b based on values in @p t. component-wise selection from either @p a or @p b based on values in @p t.
@m_keyword{mix(),GLSL mix(),}
*/ */
template<std::size_t size, class T> inline Vector<size, T> lerp(const Vector<size, T>& a, const Vector<size, T>& b, const BoolVector<size>& t) { template<std::size_t size, class T> inline Vector<size, T> lerp(const Vector<size, T>& a, const Vector<size, T>& b, const BoolVector<size>& t) {
Vector<size, T> out{NoInit}; Vector<size, T> out{NoInit};
@ -562,7 +565,9 @@ template<std::size_t size, class T> inline Vector<size, T> lerp(const Vector<siz
return out; return out;
} }
/** @overload */ /** @overload
@m_keyword{mix(),GLSL mix(),}
*/
template<std::size_t size> inline BoolVector<size> lerp(const BoolVector<size>& a, const BoolVector<size>& b, const BoolVector<size>& t) { template<std::size_t size> inline BoolVector<size> lerp(const BoolVector<size>& a, const BoolVector<size>& b, const BoolVector<size>& t) {
/* Not using NoInit because it causes some compilers to report unitialized /* Not using NoInit because it causes some compilers to report unitialized
value */ value */

2
src/Magnum/Math/Math.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Forward declarations for @ref Magnum::Math namespace * @brief Forward declarations for the @ref Magnum::Math namespace
*/ */
#include <cstddef> #include <cstddef>

1
src/Magnum/Math/Matrix.h

@ -186,6 +186,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
* @ref Matrix4::invertedRigid() which are faster alternatives for * @ref Matrix4::invertedRigid() which are faster alternatives for
* particular matrix types. * particular matrix types.
* @see @ref Algorithms::gaussJordanInverted() * @see @ref Algorithms::gaussJordanInverted()
* @m_keyword{inverse(),GLSL inverse(),}
*/ */
Matrix<size, T> inverted() const; Matrix<size, T> inverted() const;

1
src/Magnum/Math/Matrix4.h

@ -347,6 +347,7 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* a camera matrix. If you want to get the same what equivalent * a camera matrix. If you want to get the same what equivalent
* call to the well-known `gluLookAt()` would produce, invert the * call to the well-known `gluLookAt()` would produce, invert the
* result using @ref invertedRigid(). * result using @ref invertedRigid().
* @m_keywords{gluLookAt()}
*/ */
static Matrix4<T> lookAt(const Vector3<T>& eye, const Vector3<T>& target, const Vector3<T>& up); static Matrix4<T> lookAt(const Vector3<T>& eye, const Vector3<T>& target, const Vector3<T>& up);

4
src/Magnum/Math/Packing.h

@ -122,7 +122,7 @@ template<class FloatingPoint, UnsignedInt bits, std::size_t size, class Integral
#endif #endif
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief unpack() /** @brief @copybrief unpack()
* @deprecated Use @ref unpack() instead. * @deprecated Use @ref unpack() instead.
*/ */
template<class FloatingPoint, class Integral> CORRADE_DEPRECATED("use unpack() instead") inline FloatingPoint normalize(const Integral& value) { template<class FloatingPoint, class Integral> CORRADE_DEPRECATED("use unpack() instead") inline FloatingPoint normalize(const Integral& value) {
@ -190,7 +190,7 @@ template<class Integral, UnsignedInt bits, std::size_t size, class FloatingPoint
#endif #endif
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief pack() /** @brief @copybrief pack()
* @deprecated Use @ref pack() instead. * @deprecated Use @ref pack() instead.
*/ */
template<class Integral, class FloatingPoint> CORRADE_DEPRECATED("use pack() instead") inline Integral denormalize(const FloatingPoint& value) { template<class Integral, class FloatingPoint> CORRADE_DEPRECATED("use pack() instead") inline Integral denormalize(const FloatingPoint& value) {

8
src/Magnum/Math/Quaternion.h

@ -138,7 +138,7 @@ template<class T> class Quaternion {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief Math::dot(const Quaternion<T>&, const Quaternion<T>&) * @brief @copybrief Math::dot(const Quaternion<T>&, const Quaternion<T>&)
* @deprecated Use @ref Math::dot(const Quaternion<T>&, const Quaternion<T>&) * @deprecated Use @ref Math::dot(const Quaternion<T>&, const Quaternion<T>&)
* instead. * instead.
*/ */
@ -147,7 +147,7 @@ template<class T> class Quaternion {
} }
/** /**
* @copybrief Math::angle(const Quaternion<T>&, const Quaternion<T>&) * @brief @copybrief Math::angle(const Quaternion<T>&, const Quaternion<T>&)
* @deprecated Use @ref Math::angle(const Quaternion<T>&, const Quaternion<T>&) * @deprecated Use @ref Math::angle(const Quaternion<T>&, const Quaternion<T>&)
* instead. * instead.
*/ */
@ -156,7 +156,7 @@ template<class T> class Quaternion {
} }
/** /**
* @copybrief Math::lerp(const Quaternion<T>&, const Quaternion<T>&, T) * @brief @copybrief Math::lerp(const Quaternion<T>&, const Quaternion<T>&, T)
* @deprecated Use @ref Math::lerp(const Quaternion<T>&, const Quaternion<T>&, T) * @deprecated Use @ref Math::lerp(const Quaternion<T>&, const Quaternion<T>&, T)
* instead. * instead.
*/ */
@ -165,7 +165,7 @@ template<class T> class Quaternion {
} }
/** /**
* @copybrief Math::slerp(const Quaternion<T>&, const Quaternion<T>&, T) * @brief @copybrief Math::slerp(const Quaternion<T>&, const Quaternion<T>&, T)
* @deprecated Use @ref Math::slerp(const Quaternion<T>&, const Quaternion<T>&, T) * @deprecated Use @ref Math::slerp(const Quaternion<T>&, const Quaternion<T>&, T)
* instead. * instead.
*/ */

2
src/Magnum/Math/Range.h

@ -371,7 +371,7 @@ template<class T> class Range3D: public Range<3, T> {
#endif #endif
{} {}
/** @copybrief Range(NoInitT) */ /** @brief @copybrief Range(NoInitT) */
explicit Range3D(NoInitT) noexcept explicit Range3D(NoInitT) noexcept
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT

2
src/Magnum/Math/RectangularMatrix.h

@ -370,6 +370,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* @f[ * @f[
* (\boldsymbol {AB})_{ji} = \sum_{k=0}^{m-1} \boldsymbol A_{ki} \boldsymbol B_{jk} * (\boldsymbol {AB})_{ji} = \sum_{k=0}^{m-1} \boldsymbol A_{ki} \boldsymbol B_{jk}
* @f] * @f]
* @m_keyword{outerProduct(),GLSL outerProduct(),}
*/ */
template<std::size_t size> RectangularMatrix<size, rows, T> operator*(const RectangularMatrix<size, cols, T>& other) const; template<std::size_t size> RectangularMatrix<size, rows, T> operator*(const RectangularMatrix<size, cols, T>& other) const;
@ -392,6 +393,7 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* \boldsymbol{A}^T_ij = \boldsymbol{A}_ji * \boldsymbol{A}^T_ij = \boldsymbol{A}_ji
* @f] * @f]
* @see @ref row(), @ref flippedCols(), @ref flippedRows() * @see @ref row(), @ref flippedCols(), @ref flippedRows()
* @m_keyword{transpose(),GLSL transpose(),}
*/ */
RectangularMatrix<rows, cols, T> transposed() const; RectangularMatrix<rows, cols, T> transposed() const;

29
src/Magnum/Math/Vector.h

@ -150,7 +150,7 @@ template<std::size_t size, class T> class Vector {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief Math::dot(const Vector<size, T>&, const Vector<size, T>&) * @brief @copybrief Magnum::Math::dot(const Vector<size, T>&, const Vector<size, T>&)
* @deprecated Use @ref Math::dot(const Vector<size, T>&, const Vector<size, T>&) * @deprecated Use @ref Math::dot(const Vector<size, T>&, const Vector<size, T>&)
* instead. * instead.
*/ */
@ -159,7 +159,7 @@ template<std::size_t size, class T> class Vector {
} }
/** /**
* @copybrief Math::angle(const Vector<size, T>&, const Vector<size, T>&) * @brief @copybrief Magnum::Math::angle(const Vector<size, T>&, const Vector<size, T>&)
* @deprecated Use @ref Math::angle(const Vector<size, T>&, const Vector<size, T>&) * @deprecated Use @ref Math::angle(const Vector<size, T>&, const Vector<size, T>&)
* instead. * instead.
*/ */
@ -249,16 +249,32 @@ template<std::size_t size, class T> class Vector {
return !operator==(other); return !operator==(other);
} }
/** @brief Component-wise less than */ /**
* @brief Component-wise less than
*
* @m_keyword{lessThan(),GLSL lessThan(),}
*/
BoolVector<size> operator<(const Vector<size, T>& other) const; BoolVector<size> operator<(const Vector<size, T>& other) const;
/** @brief Component-wise less than or equal */ /**
* @brief Component-wise less than or equal
*
* @m_keyword{lessThanEqual(),GLSL lessThanEqual(),}
*/
BoolVector<size> operator<=(const Vector<size, T>& other) const; BoolVector<size> operator<=(const Vector<size, T>& other) const;
/** @brief Component-wise greater than or equal */ /**
* @brief Component-wise greater than or equal
*
* @m_keyword{greaterThanEqual(),GLSL greaterThanEqual(),}
*/
BoolVector<size> operator>=(const Vector<size, T>& other) const; BoolVector<size> operator>=(const Vector<size, T>& other) const;
/** @brief Component-wise greater than */ /**
* @brief Component-wise greater than
*
* @m_keyword{greaterThan(),GLSL greaterThan(),}
*/
BoolVector<size> operator>(const Vector<size, T>& other) const; BoolVector<size> operator>(const Vector<size, T>& other) const;
/** /**
@ -488,6 +504,7 @@ template<std::size_t size, class T> class Vector {
* @brief Normalized vector (of unit length) * @brief Normalized vector (of unit length)
* *
* @see @ref isNormalized(), @ref lengthInverted(), @ref resized() * @see @ref isNormalized(), @ref lengthInverted(), @ref resized()
* @m_keyword{normalize(),GLSL normalize(),}
*/ */
Vector<size, T> normalized() const { return *this*lengthInverted(); } Vector<size, T> normalized() const { return *this*lengthInverted(); }

2
src/Magnum/Math/Vector2.h

@ -106,7 +106,7 @@ template<class T> class Vector2: public Vector<2, T> {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief Math::cross(const Vector2<T>&, const Vector2<T>&) * @brief @copybrief Math::cross(const Vector2<T>&, const Vector2<T>&)
* @deprecated Use @ref Math::cross(const Vector2<T>&, const Vector2<T>&) * @deprecated Use @ref Math::cross(const Vector2<T>&, const Vector2<T>&)
* instead. * instead.
*/ */

2
src/Magnum/Math/Vector3.h

@ -128,7 +128,7 @@ template<class T> class Vector3: public Vector<3, T> {
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief Math::cross(const Vector3<T>&, const Vector3<T>&) * @brief @copybrief Math::cross(const Vector3<T>&, const Vector3<T>&)
* @deprecated Use @ref Math::cross(const Vector3<T>&, const Vector3<T>&) * @deprecated Use @ref Math::cross(const Vector3<T>&, const Vector3<T>&)
* instead. * instead.
*/ */

Loading…
Cancel
Save