Rotate a matrix around the z-axis
| 79 | |
| 80 | // Rotate a matrix around the z-axis |
| 81 | void matrixRotateZ(Matrix& result, sf::Angle angle) |
| 82 | { |
| 83 | const float rad = angle.asRadians(); |
| 84 | |
| 85 | // clang-format off |
| 86 | const Matrix matrix = {{ |
| 87 | { std::cos(rad), std::sin(rad), 0.f, 0.f}, |
| 88 | {-std::sin(rad), std::cos(rad), 0.f, 0.f}, |
| 89 | { 0.f, 0.f, 1.f, 0.f}, |
| 90 | { 0.f, 0.f, 0.f, 1.f} |
| 91 | }}; |
| 92 | // clang-format on |
| 93 | |
| 94 | matrixMultiply(result, result, matrix); |
| 95 | } |
| 96 | |
| 97 | // Construct a lookat view matrix |
| 98 | void matrixLookAt(Matrix& result, const sf::Vector3f& eye, const sf::Vector3f& center, const sf::Vector3f& up) |
no test coverage detected