mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix directional fog color in front view
This commit is contained in:
parent
f2a1900345
commit
c5324015bc
@ -10,6 +10,7 @@
|
|||||||
#include "util/numeric.h" // MYMIN
|
#include "util/numeric.h" // MYMIN
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "camera.h" // CameraModes
|
||||||
|
|
||||||
//! constructor
|
//! constructor
|
||||||
Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player):
|
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_directional_colored_fog) {
|
||||||
if (m_horizon_blend() != 0)
|
if (m_horizon_blend() != 0)
|
||||||
{
|
{
|
||||||
// calculate hemisphere value from yaw
|
// calculate hemisphere value from yaw, (inverted in third person front view)
|
||||||
f32 pointcolor_blend = wrapDegrees_0_360(m_player->getYaw() + 90);
|
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)
|
if (pointcolor_blend > 180)
|
||||||
pointcolor_blend = 360 - pointcolor_blend;
|
pointcolor_blend = 360 - pointcolor_blend;
|
||||||
pointcolor_blend /= 180;
|
pointcolor_blend /= 180;
|
||||||
|
Loading…
Reference in New Issue
Block a user