diff options
author | Novatux <nathanael.courant@laposte.net> | 2014-01-26 11:40:21 +0100 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2014-03-04 20:12:10 +0100 |
commit | 062de11b4cff30861dd4e9eb56f131d821f34b51 (patch) | |
tree | 37bdcbacb355abfe1f8091307222e430e58b78d8 /src/content_cao.cpp | |
parent | 8e15179e7d896851c6f5814fc6524c86b26ce2e3 (diff) | |
download | minetest-062de11b4cff30861dd4e9eb56f131d821f34b51.tar.gz minetest-062de11b4cff30861dd4e9eb56f131d821f34b51.tar.bz2 minetest-062de11b4cff30861dd4e9eb56f131d821f34b51.zip |
Fix rendering glitches when far from the center of the map
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 840103cc7..84ec3e143 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1058,23 +1058,24 @@ public: if(getParent() != NULL) return; + v3s16 camera_offset = m_env->getCameraOffset(); if(m_meshnode){ - m_meshnode->setPosition(pos_translator.vect_show); + m_meshnode->setPosition(pos_translator.vect_show-intToFloat(camera_offset, BS)); v3f rot = m_meshnode->getRotation(); rot.Y = -m_yaw; m_meshnode->setRotation(rot); } if(m_animated_meshnode){ - m_animated_meshnode->setPosition(pos_translator.vect_show); + m_animated_meshnode->setPosition(pos_translator.vect_show-intToFloat(camera_offset, BS)); v3f rot = m_animated_meshnode->getRotation(); rot.Y = -m_yaw; m_animated_meshnode->setRotation(rot); } if(m_spritenode){ - m_spritenode->setPosition(pos_translator.vect_show); + m_spritenode->setPosition(pos_translator.vect_show-intToFloat(camera_offset, BS)); } } - + void step(float dtime, ClientEnvironment *env) { if(m_visuals_expired && m_smgr && m_irr){ |