|
@ -71,9 +71,9 @@ void vector_3::normalize() { |
|
|
// Apply a rotation to the matrix
|
|
|
// Apply a rotation to the matrix
|
|
|
void vector_3::apply_rotation(const matrix_3x3 &matrix) { |
|
|
void vector_3::apply_rotation(const matrix_3x3 &matrix) { |
|
|
const float _x = x, _y = y, _z = z; |
|
|
const float _x = x, _y = y, _z = z; |
|
|
x = _x * matrix.vectors[0][0] + _y * matrix.vectors[1][0] + _z * matrix.vectors[2][0]; |
|
|
*this = { matrix.vectors[0][0] * _x + matrix.vectors[1][0] * _y + matrix.vectors[2][0] * _z, |
|
|
y = _x * matrix.vectors[0][1] + _y * matrix.vectors[1][1] + _z * matrix.vectors[2][1]; |
|
|
matrix.vectors[0][1] * _x + matrix.vectors[1][1] * _y + matrix.vectors[2][1] * _z, |
|
|
z = _x * matrix.vectors[0][2] + _y * matrix.vectors[1][2] + _z * matrix.vectors[2][2]; |
|
|
matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void vector_3::debug(PGM_P const title) { |
|
|
void vector_3::debug(PGM_P const title) { |
|
|