1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Fix CMatrix<T>::getScale returning negative scale (#15687)

This commit is contained in:
Lars Müller 2025-01-18 00:27:27 +01:00 committed by GitHub
parent c8b5e3b741
commit 8719a816e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 58 deletions

View file

@ -66,4 +66,21 @@ SECTION("setRotationRadians") {
}
}
SECTION("getScale") {
SECTION("correctly gets the length of each row of the 3x3 submatrix") {
matrix4 A(
1, 2, 3, 0,
4, 5, 6, 0,
7, 8, 9, 0,
0, 0, 0, 1
);
v3f scale = A.getScale();
CHECK(scale.equals(v3f(
v3f(1, 2, 3).getLength(),
v3f(4, 5, 6).getLength(),
v3f(7, 8, 9).getLength()
)));
}
}
}