diff options
author | BlockMen <nmuelll@web.de> | 2014-04-25 10:24:15 +0200 |
---|---|---|
committer | BlockMen <nmuelll@web.de> | 2014-04-25 10:35:45 +0200 |
commit | c5324015bc70488c8b6d68d83ca7d963a5e6c62f (patch) | |
tree | 5f354e18c86dd6579e436037783e24b746b98a95 /src | |
parent | f2a1900345098d54b583f813509c5f3ad5a768d4 (diff) | |
download | minetest-c5324015bc70488c8b6d68d83ca7d963a5e6c62f.tar.gz minetest-c5324015bc70488c8b6d68d83ca7d963a5e6c62f.tar.bz2 minetest-c5324015bc70488c8b6d68d83ca7d963a5e6c62f.zip |
Fix directional fog color in front view
Diffstat (limited to 'src')
-rw-r--r-- | src/sky.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sky.cpp b/src/sky.cpp index 04bb3ab42..be7798407 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -10,6 +10,7 @@ #include "util/numeric.h" // MYMIN #include <cmath> #include "settings.h" +#include "camera.h" // CameraModes //! constructor Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player): @@ -577,8 +578,11 @@ void Sky::update(float time_of_day, float time_brightness, if (m_directional_colored_fog) { if (m_horizon_blend() != 0) { - // calculate hemisphere value from yaw - f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw() + 90); + // calculate hemisphere value from yaw, (inverted in third person front view) + s8 dir_factor = 1; + if (m_player->camera_mode > CAMERA_MODE_THIRD) + dir_factor = -1; + f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw()*dir_factor + 90); if (pointcolor_blend > 180) pointcolor_blend = 360 - pointcolor_blend; pointcolor_blend /= 180; |