From e10f7304789273dcd1375c43ad8f74e9c84d9bc9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 30 Sep 2018 01:51:21 -0500 Subject: [PATCH] Tweak vector_3::apply_rotation --- Marlin/src/libs/vector_3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index dfed6820e2..2ef98a4365 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -76,10 +76,10 @@ void vector_3::normalize() { } void vector_3::apply_rotation(const matrix_3x3 &matrix) { - const float _x = x * matrix.matrix[3 * 0 + 0] + y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0], - _y = x * matrix.matrix[3 * 0 + 1] + y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1], - _z = x * matrix.matrix[3 * 0 + 2] + y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2]; - x = _x; y = _y; z = _z; + const float _x = x, _y = y; + x = _x * matrix.matrix[3 * 0 + 0] + _y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0]; + y = _x * matrix.matrix[3 * 0 + 1] + _y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1]; + z = _x * matrix.matrix[3 * 0 + 2] + _y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2]; } void vector_3::debug(const char * const title) {