1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Fix last performance-type-promotion-in-math-fn problems

This commit is contained in:
Loic Blot 2018-04-04 07:42:40 +02:00
parent a90d27e1e2
commit 8e0b80aa36
No known key found for this signature in database
GPG key ID: EFAA458E8C153987
11 changed files with 59 additions and 42 deletions

View file

@ -173,6 +173,6 @@ s16 adjustDist(s16 dist, float zoom_fov)
// new_dist = dist * ((1 - cos(FOV / 2)) / (1-cos(zoomFOV /2))) ^ (1/3)
// note: FOV is calculated at compilation time
return round(dist * std::cbrt((1.0f - std::cos(default_fov)) /
return std::round(dist * std::cbrt((1.0f - std::cos(default_fov)) /
(1.0f - std::cos(zoom_fov / 2.0f))));
}