mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:47:35 +00:00
LibGfx+Demos: Make Matrix4x4 a true alias for Matrix<4,T>
Matrix4x4 was defined as a derived class of Matrix<N,T> before. Furthermore, some code was duplicated and it was overall just messy. This commit turns Matrix4x4 into a simple alias for Matrix<4,T>.
This commit is contained in:
parent
0833db0874
commit
c2d84efaae
5 changed files with 103 additions and 117 deletions
|
@ -128,13 +128,13 @@ void Cube::timer_event(Core::TimerEvent&)
|
|||
static float angle = 0;
|
||||
angle += 0.02f;
|
||||
|
||||
auto matrix = FloatMatrix4x4::translate(FloatVector3(0, 0, 1.5f))
|
||||
* FloatMatrix4x4::rotate(FloatVector3(1, 0, 0), angle * 1.17356641f)
|
||||
* FloatMatrix4x4::rotate(FloatVector3(0, 1, 0), angle * 0.90533273f)
|
||||
* FloatMatrix4x4::rotate(FloatVector3(0, 0, 1), angle);
|
||||
auto matrix = Gfx::translation_matrix(FloatVector3(0, 0, 1.5f))
|
||||
* Gfx::rotation_matrix(FloatVector3(1, 0, 0), angle * 1.17356641f)
|
||||
* Gfx::rotation_matrix(FloatVector3(0, 1, 0), angle * 0.90533273f)
|
||||
* Gfx::rotation_matrix(FloatVector3(0, 0, 1), angle);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
transformed_vertices[i] = matrix.transform_point(vertices[i]);
|
||||
transformed_vertices[i] = transform_point(matrix, vertices[i]);
|
||||
}
|
||||
|
||||
GUI::Painter painter(*m_bitmap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue