Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // No means provided to get the matrix from a transformation, so this will need to do
- Matrix4x4 TransformationToMatrix(Transformation &t)
- {
- float temp[16];
- t.ArrayForOpenGL(temp); // This method is non-const (?) so I can't pass by reference to const
- Matrix4x4 m;
- for (unsigned int row = 0; row < 4; ++row)
- {
- for (unsigned int col = 0; col < 4; ++col)
- {
- // Copy transposed
- m[row][col] = *(temp + col * 4 + row);
- }
- }
- return m;
- }
Add Comment
Please, Sign In to add comment