Browse Source

Doc++

pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
e24207f620
  1. 11
      doc/matrix-vector.dox
  2. 13
      src/Math/Matrix.h
  3. 2
      src/Math/Matrix3.h
  4. 2
      src/Math/Matrix4.h

11
doc/matrix-vector.dox

@ -131,6 +131,17 @@ xyz.xy() *= 5;
@endcode
Color3 and Color4 name their components `rgba` instead of `xyzw`.
Matrix3 and Matrix4 have functions for accessing properties of given 2D/3D
transformation:
@code
Matrix4<float> a = Matrix4<float>::translation(Vector3::yAxis(4.0f));
Vector3<float> translation = a.translation();
Matrix3<float> b = Matrix3<float>::rotation(deg(15.f));
Matrix<2, float> rotationScaling = b.rotationScaling();
Vector2<float> up = b.up();
@endcode
For more involved operations with components there is the swizzle() function:
@code
Vector4<int> original(-1, 2, 3, 4);

13
src/Math/Matrix.h

@ -74,7 +74,18 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
*/
template<class ...U> inline constexpr /*implicit*/ Matrix(const Vector<size, T>& first, const U&... next): RectangularMatrix<size, size, T>(first, next...) {}
/** @copydoc RectangularMatrix::RectangularMatrix(const RectangularMatrix<cols, rows, U>&) */
/**
* @brief Construct matrix from another of different type
*
* Performs only default casting on the values, no rounding or
* anything else. Example usage:
* @code
* Matrix<2, float> floatingPoint({1.3f, 2.7f},
* {-15.0f, 7.0f});
* Matrix<2, std::int8_t> integral(floatingPoint);
* // integral == {{1, 2}, {-15, 7}}
* @endcode
*/
template<class U> inline constexpr explicit Matrix(const RectangularMatrix<size, size, U>& other): RectangularMatrix<size, size, T>(other) {}
/** @brief Copy constructor */

2
src/Math/Matrix3.h

@ -128,7 +128,7 @@ template<class T> class Matrix3: public Matrix<3, T> {
/** @brief %Matrix from column vectors */
inline constexpr /*implicit*/ Matrix3(const Vector3<T>& first, const Vector3<T>& second, const Vector3<T>& third): Matrix<3, T>(first, second, third) {}
/** @copydoc Matrix::Matrix(const RectangularMatrix<cols, rows, U>&) */
/** @copydoc Matrix::Matrix(const RectangularMatrix<size, size, U>&) */
template<class U> inline constexpr explicit Matrix3(const RectangularMatrix<3, 3, U>& other): Matrix<3, T>(other) {}
/** @brief Copy constructor */

2
src/Math/Matrix4.h

@ -253,7 +253,7 @@ template<class T> class Matrix4: public Matrix<4, T> {
/** @brief %Matrix from column vectors */
inline constexpr /*implicit*/ Matrix4(const Vector4<T>& first, const Vector4<T>& second, const Vector4<T>& third, const Vector4<T>& fourth): Matrix<4, T>(first, second, third, fourth) {}
/** @copydoc Matrix::Matrix(const RectangularMatrix<cols, rows, U>&) */
/** @copydoc Matrix::Matrix(const RectangularMatrix<size, size, U>&) */
template<class U> inline constexpr explicit Matrix4(const RectangularMatrix<4, 4, U>& other): Matrix<4, T>(other) {}
/** @brief Copy constructor */

Loading…
Cancel
Save