-----------------------------------------------------------------------
| 80 | } |
| 81 | //----------------------------------------------------------------------- |
| 82 | void Matrix4x4::makeTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation) |
| 83 | { |
| 84 | // Ordering: |
| 85 | // 1. Scale |
| 86 | // 2. Rotate |
| 87 | // 3. Translate |
| 88 | |
| 89 | Matrix3x3 rot3x3; |
| 90 | orientation.toRotationMatrix(rot3x3); |
| 91 | |
| 92 | // Set up final matrix with scale, rotation and translation |
| 93 | m_mat[0][0] = scale.x * rot3x3[0][0]; |
| 94 | m_mat[0][1] = scale.y * rot3x3[0][1]; |
| 95 | m_mat[0][2] = scale.z * rot3x3[0][2]; |
| 96 | m_mat[0][3] = position.x; |
| 97 | m_mat[1][0] = scale.x * rot3x3[1][0]; |
| 98 | m_mat[1][1] = scale.y * rot3x3[1][1]; |
| 99 | m_mat[1][2] = scale.z * rot3x3[1][2]; |
| 100 | m_mat[1][3] = position.y; |
| 101 | m_mat[2][0] = scale.x * rot3x3[2][0]; |
| 102 | m_mat[2][1] = scale.y * rot3x3[2][1]; |
| 103 | m_mat[2][2] = scale.z * rot3x3[2][2]; |
| 104 | m_mat[2][3] = position.z; |
| 105 | |
| 106 | // No projection term |
| 107 | m_mat[3][0] = 0; |
| 108 | m_mat[3][1] = 0; |
| 109 | m_mat[3][2] = 0; |
| 110 | m_mat[3][3] = 1; |
| 111 | } |
| 112 | |
| 113 | //----------------------------------------------------------------------- |
| 114 | void Matrix4x4::makeInverseTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation) |
no test coverage detected