1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 17:15:21 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Pedro Gimeno
ae97435d80 Fix set/getRotationRadians unit test
Gimbal lock is a situation where the pitch (the middle angle) of the Tait-Bryan angles (usually called Euler angles incorrectly) is 90 degrees. If the angles specify a rotation close to gimbal lock, the precision requirements increase significantly, beyond what a single-precision float can provide, and at exactly gimbal lock, there's a loss of information. The test didn't take this into account. Fix this by decreasing the expected precision when close to gimbal lock.

The increased error rate on ARM Macs is probably caused by lesser precision in trigonometric functions. IEC-559 does not specify any semantics for those, and while Intel typically has a precision < 1 ulp for trigonometric functions with angles < 2*pi, it's likely that ARM's precision is a bit worse.
2025-08-08 00:42:57 +02:00
Lars Mueller
26aab6ecf2 Fix flakey matrix rotation unit test for now 2025-07-30 23:43:10 +02:00
Lars Müller
23bf50a07c Document & extend testing for rotation conventions (#16200)
* Document Luanti rotation conventions
* Add test for setPitchYawRollRad (entity) rotation conventions
* Test and document that `vector.rotate` uses (extrinsic) Z-X-Y rotation order
2025-07-13 17:11:12 +02:00
Lars Mueller
d74af2f1a7 Use matrix4::getRotationRadians 2025-02-27 12:31:04 +01:00
Lars Mueller
5abf220979 Fix random usage in matrix4 tests 2025-02-27 12:31:04 +01:00
Lars Mueller
0e86366324 Add test for matrix4::getRotationDegrees 2025-02-27 12:31:04 +01:00
SFENCE
af3f696423 Code style fixes. 2025-01-21 16:29:12 +01:00
Lars Müller
8719a816e7 Fix CMatrix<T>::getScale returning negative scale (#15687) 2025-01-18 00:27:27 +01:00
Lars Müller
23e502fa0e Test & document conventions used by matrix4::setRotation* (#15542)
Also includes a minor `matrix4::transformVect` refactor to make testing easier.
2024-12-14 17:02:16 +01:00