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

Use glm::length2 instead of glm::length where possible

This commit is contained in:
docentYT
2026-04-27 23:27:08 +02:00
parent 7d561f8443
commit cba106e22e
9 changed files with 34 additions and 21 deletions

View File

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