MCPcopy Create free account
hub / github.com/SFML/SFML / matrixRotateX

Function matrixRotateX

examples/vulkan/Vulkan.cpp:47–61  ·  view source on GitHub ↗

Rotate a matrix around the x-axis

Source from the content-addressed store, hash-verified

45
46// Rotate a matrix around the x-axis
47void matrixRotateX(Matrix& result, sf::Angle angle)
48{
49 const float rad = angle.asRadians();
50
51 // clang-format off
52 const Matrix matrix = {{
53 {1.f, 0.f, 0.f, 0.f},
54 {0.f, std::cos(rad), std::sin(rad), 0.f},
55 {0.f, -std::sin(rad), std::cos(rad), 0.f},
56 {0.f, 0.f, 0.f, 1.f}
57 }};
58 // clang-format on
59
60 matrixMultiply(result, result, matrix);
61}
62
63// Rotate a matrix around the y-axis
64void matrixRotateY(Matrix& result, sf::Angle angle)

Callers 1

updateUniformBufferMethod · 0.85

Calls 1

matrixMultiplyFunction · 0.85

Tested by

no test coverage detected