16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 19:29: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

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