Переглянути джерело

Tweak vector_3::apply_rotation

Scott Lahteine 6 роки тому
джерело
коміт
e10f730478
1 змінених файлів з 4 додано та 4 видалено
  1. 4
    4
      Marlin/src/libs/vector_3.cpp

+ 4
- 4
Marlin/src/libs/vector_3.cpp Переглянути файл

@@ -76,10 +76,10 @@ void vector_3::normalize() {
76 76
 }
77 77
 
78 78
 void vector_3::apply_rotation(const matrix_3x3 &matrix) {
79
-  const float _x = x * matrix.matrix[3 * 0 + 0] + y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0],
80
-              _y = x * matrix.matrix[3 * 0 + 1] + y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1],
81
-              _z = x * matrix.matrix[3 * 0 + 2] + y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2];
82
-  x = _x; y = _y; z = _z;
79
+  const float _x = x, _y = y;
80
+  x = _x * matrix.matrix[3 * 0 + 0] + _y * matrix.matrix[3 * 1 + 0] + z * matrix.matrix[3 * 2 + 0];
81
+  y = _x * matrix.matrix[3 * 0 + 1] + _y * matrix.matrix[3 * 1 + 1] + z * matrix.matrix[3 * 2 + 1];
82
+  z = _x * matrix.matrix[3 * 0 + 2] + _y * matrix.matrix[3 * 1 + 2] + z * matrix.matrix[3 * 2 + 2];
83 83
 }
84 84
 
85 85
 void vector_3::debug(const char * const title) {

Завантаження…
Відмінити
Зберегти