mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement mapblock camera offset correctly (#10702)
Implement mapblock camera offset correctly - reduce client jitter Co-authored-by: hecktest <>
This commit is contained in:
parent
07e0b527cf
commit
6d7067fd37
4 changed files with 63 additions and 74 deletions
|
@ -1175,13 +1175,6 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
|
|||
buf->drop();
|
||||
}
|
||||
|
||||
/*
|
||||
Do some stuff to the mesh
|
||||
*/
|
||||
m_camera_offset = camera_offset;
|
||||
translateMesh(m_mesh[layer],
|
||||
intToFloat(data->m_blockpos * MAP_BLOCKSIZE - camera_offset, BS));
|
||||
|
||||
if (m_mesh[layer]) {
|
||||
#if 0
|
||||
// Usually 1-700 faces and 1-7 materials
|
||||
|
@ -1308,19 +1301,6 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack,
|
|||
return true;
|
||||
}
|
||||
|
||||
void MapBlockMesh::updateCameraOffset(v3s16 camera_offset)
|
||||
{
|
||||
if (camera_offset != m_camera_offset) {
|
||||
for (scene::IMesh *layer : m_mesh) {
|
||||
translateMesh(layer,
|
||||
intToFloat(m_camera_offset - camera_offset, BS));
|
||||
if (m_enable_vbo)
|
||||
layer->setDirty();
|
||||
}
|
||||
m_camera_offset = camera_offset;
|
||||
}
|
||||
}
|
||||
|
||||
video::SColor encode_light(u16 light, u8 emissive_light)
|
||||
{
|
||||
// Get components
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue