1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix rendering glitches when far from the center of the map

This commit is contained in:
Novatux 2014-01-26 11:40:21 +01:00
parent 8e15179e7d
commit 062de11b4c
17 changed files with 112 additions and 35 deletions

View file

@ -81,7 +81,7 @@ class MapBlockMesh
{
public:
// Builds the mesh given
MapBlockMesh(MeshMakeData *data);
MapBlockMesh(MeshMakeData *data, v3s16 camera_offset);
~MapBlockMesh();
// Main animation function, parameters:
@ -107,6 +107,8 @@ public:
if(m_animation_force_timer > 0)
m_animation_force_timer--;
}
void updateCameraOffset(v3s16 camera_offset);
private:
scene::SMesh *m_mesh;
@ -133,6 +135,9 @@ private:
u32 m_last_daynight_ratio;
// For each meshbuffer, maps vertex indices to (day,night) pairs
std::map<u32, std::map<u32, std::pair<u8, u8> > > m_daynight_diffs;
// Camera offset info -> do we have to translate the mesh?
v3s16 m_camera_offset;
};