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

Function copyMatrix

src/SFML/Graphics/Glsl.cpp:40–55  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

38
39////////////////////////////////////////////////////////////
40void copyMatrix(const Transform& source, Matrix<3, 3>& dest)
41{
42 const float* from = source.getMatrix(); // 4x4
43 auto& to = dest.array; // 3x3
44
45 // Use only left-upper 3x3 block (for a 2D transform)
46 to[0] = from[0];
47 to[1] = from[1];
48 to[2] = from[3];
49 to[3] = from[4];
50 to[4] = from[5];
51 to[5] = from[7];
52 to[6] = from[12];
53 to[7] = from[13];
54 to[8] = from[15];
55}
56
57
58////////////////////////////////////////////////////////////

Callers 1

setUniformArrayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected