Rotate a matrix around the y-axis
| 62 | |
| 63 | // Rotate a matrix around the y-axis |
| 64 | void matrixRotateY(Matrix& result, sf::Angle angle) |
| 65 | { |
| 66 | const float rad = angle.asRadians(); |
| 67 | |
| 68 | // clang-format off |
| 69 | const Matrix matrix = {{ |
| 70 | { std::cos(rad), 0.f, std::sin(rad), 0.f}, |
| 71 | { 0.f, 1.f, 0.f, 0.f}, |
| 72 | {-std::sin(rad), 0.f, std::cos(rad), 0.f}, |
| 73 | { 0.f, 0.f, 0.f, 1.f} |
| 74 | }}; |
| 75 | // clang-format on |
| 76 | |
| 77 | matrixMultiply(result, result, matrix); |
| 78 | } |
| 79 | |
| 80 | // Rotate a matrix around the z-axis |
| 81 | void matrixRotateZ(Matrix& result, sf::Angle angle) |
no test coverage detected