Commit Graph

11 Commits

Author SHA1 Message Date
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Jelle Raaijmakers
bc5e5afc7b LibSoftGPU+LibGfx: Transform and normalize normals before lighting
We were transforming the vertices' normals twice (bug 1) and
normalizing them after lighting (bug 2). In the lighting code, we were
then diverting from the spec to deal with the normal situation, which
is now no longer needed.

This fixes the lighting of Tux in Tux Racer.
2022-03-27 09:19:43 -07:00
Hendiadyoin1
cd21e03225 AK+Everywhere: Add sincos and use it in some places
Calculating sin and cos at once is quite a bit cheaper than calculating
them individually.
x87 has even a dedicated instruction for it: `fsincos`.
2022-03-15 11:39:42 +01:00
Hendiadyoin1
ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Stephan Unverwerth
10ceeb092f Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00
Stephan Unverwerth
c2d84efaae 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>.
2021-05-13 22:24:42 +02:00
Stephan Unverwerth
0833db0874 LibGfx: Make Matrix class consistently row-major
Matrix elements were interpreted in different ways.
This makes it definitely row-major, allowing initialization via
initializer list in a standard scientific order. Also matrix
multiplication now happens in the correct order and accessing
elements happens as m_elements[row][column].
2021-05-13 22:24:42 +02:00
Hendiadyoin1
1424c4651f LibGfx: Constexpr Matrices and Vectors 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
09f850728a LibGfx: Add some missing operators to Vector3 Vector4 and Matrix4x4 2021-05-08 10:13:22 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00