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

Function matrixRotateZ

examples/vulkan/Vulkan.cpp:81–95  ·  view source on GitHub ↗

Rotate a matrix around the z-axis

Source from the content-addressed store, hash-verified

79
80// Rotate a matrix around the z-axis
81void 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
98void matrixLookAt(Matrix& result, const sf::Vector3f& eye, const sf::Vector3f& center, const sf::Vector3f& up)

Callers 1

updateUniformBufferMethod · 0.85

Calls 1

matrixMultiplyFunction · 0.85

Tested by

no test coverage detected