diff --git a/Source/engine/displacement.hpp b/Source/engine/displacement.hpp index f636bd6b0..5d2cca73f 100644 --- a/Source/engine/displacement.hpp +++ b/Source/engine/displacement.hpp @@ -120,7 +120,8 @@ struct DisplacementOf { float magnitude() const { - return static_cast(hypot(deltaX, deltaY)); + // We do not use `std::hypot` here because it is slower and we do not need the extra precision. + return sqrtf(deltaX * deltaX + deltaY * deltaY); } /**