///////////////////////////////////////////////////////
| 38 | |
| 39 | //////////////////////////////////////////////////////////// |
| 40 | void 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 | //////////////////////////////////////////////////////////// |