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:
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user