236 int Matrix::ConstRowView::row() |
236 int Matrix::ConstRowView::row() |
237 { |
237 { |
238 return _row; |
238 return _row; |
239 } |
239 } |
240 |
240 |
241 Matrix Matrix::fromRotationMatrix(const GLRotationMatrix& rotationMatrix) |
241 Matrix Matrix::fromQMatrix(const QMatrix4x4& matrix) |
242 { |
242 { |
243 Matrix result; |
243 Matrix result; |
244 |
244 |
245 for (int i = 0; i < 3; ++i) |
245 for (int i = 0; i < 3; ++i) |
246 for (int j = 0; j < 3; ++j) |
246 for (int j = 0; j < 3; ++j) |
247 result(i, j) = rotationMatrix(i, j); |
247 result(i, j) = matrix(i, j); |
248 |
248 |
249 return result; |
249 return result; |
250 } |
250 } |
|
251 |
|
252 Matrix Matrix::scaleMatrix(qreal scalar) |
|
253 { |
|
254 return { |
|
255 scalar, 0, 0, |
|
256 0, scalar, 0, |
|
257 0, 0, scalar |
|
258 }; |
|
259 } |
|
260 |
|
261 Matrix& Matrix::operator*=(const Matrix& other) |
|
262 { |
|
263 *this = *this * other; |
|
264 return *this; |
|
265 } |