diff --git a/include/J3ML/LinearAlgebra/Matrix4x4.h b/include/J3ML/LinearAlgebra/Matrix4x4.h index b776573..a1a24a2 100644 --- a/include/J3ML/LinearAlgebra/Matrix4x4.h +++ b/include/J3ML/LinearAlgebra/Matrix4x4.h @@ -5,25 +5,19 @@ namespace LinearAlgebra { - - - - - - /// A 4-by-4 matrix for affine transformations and perspective projections of 3D geometry. -/* This matrix can represent the most generic form of transformations for 3D objects, - * including perspective projections, which a 4-by-3 cannot store, - * and translations, which a 3-by-3 cannot represent. - * The elements of this matrix are - * m_00, m_01, m_02, m_03 - * m_10, m_11, m_12, m_13 - * m_20, m_21, m_22, xm_23, - * m_30, m_31, m_32, m_33 - * - * The element m_yx is the value on the row y and column x. - * You can access m_yx using the double-bracket notation m[y][x] - */ + /* This matrix can represent the most generic form of transformations for 3D objects, + * including perspective projections, which a 4-by-3 cannot store, + * and translations, which a 3-by-3 cannot represent. + * The elements of this matrix are + * m_00, m_01, m_02, m_03 + * m_10, m_11, m_12, m_13 + * m_20, m_21, m_22, am_23, + * m_30, m_31, m_32, m_33 + * + * The element m_yx is the value on the row y and column x. + * You can access m_yx using the double-bracket notation m[y][x] + */ class Matrix4x4 { public: enum { Rows = 4 }; diff --git a/src/J3ML/LinearAlgebra/Matrix3x3.cpp b/src/J3ML/LinearAlgebra/Matrix3x3.cpp index ecabc4a..f410dcf 100644 --- a/src/J3ML/LinearAlgebra/Matrix3x3.cpp +++ b/src/J3ML/LinearAlgebra/Matrix3x3.cpp @@ -228,6 +228,13 @@ namespace LinearAlgebra { elems[i][2] = vec.z; } + void Matrix3x3::SetColumn(int i, const Vector3& vec) + { + elems[0][i] = vec.x; + elems[1][i] = vec.y; + elems[2][i] = vec.z; + } + Matrix3x3 Matrix3x3::LookAt(const Vector3 &forward, const Vector3 &target, const Vector3 &localUp, const Vector3 &worldUp) { // User must input proper normalized input direction vectors