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

Function matrixMultiply

examples/vulkan/Vulkan.cpp:32–44  ·  view source on GitHub ↗

Multiply 2 matrices

Source from the content-addressed store, hash-verified

30
31// Multiply 2 matrices
32void matrixMultiply(Matrix& result, const Matrix& left, const Matrix& right)
33{
34 Matrix temp;
35
36 for (std::size_t i = 0; i < temp.size(); ++i)
37 {
38 for (std::size_t j = 0; j < temp[0].size(); ++j)
39 temp[i][j] = left[0][j] * right[i][0] + left[1][j] * right[i][1] + left[2][j] * right[i][2] +
40 left[3][j] * right[i][3];
41 }
42
43 result = temp;
44}
45
46// Rotate a matrix around the x-axis
47void matrixRotateX(Matrix& result, sf::Angle angle)

Callers 3

matrixRotateXFunction · 0.85
matrixRotateYFunction · 0.85
matrixRotateZFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected