]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/util/numeric.cpp
use unordered containers where possible (patch 4 on X)
[dragonfireclient.git] / src / util / numeric.cpp
index bfd5d6e387f3b972e9662a0c90a36c91d9518d8e..6a7bfcac91dad9bc52d78757cc014ec462e9418c 100644 (file)
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string.h>
 #include <iostream>
 
-std::map<u16, std::vector<v3s16> > FacePositionCache::m_cache;
+UNORDERED_MAP<u16, std::vector<v3s16> > FacePositionCache::m_cache;
 Mutex FacePositionCache::m_cache_mutex;
 // Calculate the borders of a "d-radius" cube
 // TODO: Make it work without mutex and data races, probably thread-local
@@ -244,7 +244,10 @@ bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir,
        f32 cosangle = dforward / blockpos_adj.getLength();
 
        // If block is not in the field of view, skip it
-       if(cosangle < cos(camera_fov / 2))
+       // HOTFIX: use sligthly increased angle (+10%) to fix too agressive
+       // culling. Somebody have to find out whats wrong with the math here.
+       // Previous value: camera_fov / 2
+       if(cosangle < cos(camera_fov * 0.55))
                return false;
 
        return true;