16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 02:09:17 +02:00

Use the sq function to force constexpr expressions for numeric literals and enhance readability

This commit is contained in:
docentYT
2026-04-28 13:23:14 +02:00
parent 6be1b0886d
commit ca839652bf
15 changed files with 64 additions and 59 deletions

View File

@@ -71,7 +71,7 @@ basic_precipitation::update() {
}
// ... from camera jump to another location
// length2 is better than length for comparing because it does not require sqrt function
if( glm::length2( cameramove ) > 100.0 * 100.0 )
if( glm::length2( cameramove ) > sq(100.0) )
{
cameramove = glm::dvec3{ 0.0 };
}