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

Function matrixRotateY

examples/vulkan/Vulkan.cpp:64–78  ·  view source on GitHub ↗

Rotate a matrix around the y-axis

Source from the content-addressed store, hash-verified

62
63// Rotate a matrix around the y-axis
64void 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
81void matrixRotateZ(Matrix& result, sf::Angle angle)

Callers 1

updateUniformBufferMethod · 0.85

Calls 1

matrixMultiplyFunction · 0.85

Tested by

no test coverage detected