Skip to content
Snippets Groups Projects
Commit b7db91c4 authored by Evgeny-SPB's avatar Evgeny-SPB Committed by Scott Lahteine
Browse files

Fix apply_rotation function (#15636)

parent 0b0b8226
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,9 @@ void vector_3::normalize() {
// Apply a rotation to the matrix
void vector_3::apply_rotation(const matrix_3x3 &matrix) {
const float _x = x, _y = y, _z = z;
*this = matrix.vectors[0] * _x + matrix.vectors[1] * _y + matrix.vectors[2] * _z;
x = _x * matrix.vectors[0][0] + _y * matrix.vectors[1][0] + _z * matrix.vectors[2][0];
y = _x * matrix.vectors[0][1] + _y * matrix.vectors[1][1] + _z * matrix.vectors[2][1];
z = _x * matrix.vectors[0][2] + _y * matrix.vectors[1][2] + _z * matrix.vectors[2][2];
}
void vector_3::debug(PGM_P const title) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment