aboutsummaryrefslogtreecommitdiff
path: root/src/client/sky.cpp
diff options
context:
space:
mode:
authorsofar <sofar@foo-projects.org>2023-02-25 16:08:33 -0800
committerGitHub <noreply@github.com>2023-02-26 01:08:33 +0100
commit2083252c05ece1e47c1c476fda2b9eda3bf332a0 (patch)
tree3af58a210bad99834110e4aff820ce04ee839b2b /src/client/sky.cpp
parent6e1c70e02b00df94a584bb4247cfa4f4c616c8d5 (diff)
downloadminetest-2083252c05ece1e47c1c476fda2b9eda3bf332a0.tar.xz
Sky: transmit body_orbit_tilt to client. (#13193)
This obsoletes the current client-side setting entirely. The server can transmit the tilt to the client directly and will send 0.0f as default value. Co-authored-by: x2048 <codeforsmile@gmail.com> Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/client/sky.cpp')
-rw-r--r--src/client/sky.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/sky.cpp b/src/client/sky.cpp
index aacc47250..eb7db36d4 100644
--- a/src/client/sky.cpp
+++ b/src/client/sky.cpp
@@ -98,9 +98,6 @@ Sky::Sky(s32 id, RenderingEngine *rendering_engine, ITextureSource *tsrc, IShade
m_directional_colored_fog = g_settings->getBool("directional_colored_fog");
- if (g_settings->getBool("enable_dynamic_shadows"))
- m_sky_body_orbit_tilt = g_settings->getFloat("shadow_sky_body_orbit_tilt", -60.0f, 60.0f);
-
setStarCount(1000);
}
@@ -556,12 +553,12 @@ static v3f getSkyBodyPosition(float horizon_position, float day_position, float
v3f Sky::getSunDirection()
{
- return getSkyBodyPosition(90, getWickedTimeOfDay(m_time_of_day) * 360 - 90, m_sky_body_orbit_tilt);
+ return getSkyBodyPosition(90, getWickedTimeOfDay(m_time_of_day) * 360 - 90, m_sky_params.body_orbit_tilt);
}
v3f Sky::getMoonDirection()
{
- return getSkyBodyPosition(270, getWickedTimeOfDay(m_time_of_day) * 360 - 90, m_sky_body_orbit_tilt);
+ return getSkyBodyPosition(270, getWickedTimeOfDay(m_time_of_day) * 360 - 90, m_sky_params.body_orbit_tilt);
}
void Sky::draw_sun(video::IVideoDriver *driver, const video::SColor &suncolor,
@@ -721,7 +718,7 @@ void Sky::place_sky_body(
* day_position: turn the body around the Z axis, to place it depending of the time of the day
*/
{
- v3f centrum = getSkyBodyPosition(horizon_position, day_position, m_sky_body_orbit_tilt);
+ v3f centrum = getSkyBodyPosition(horizon_position, day_position, m_sky_params.body_orbit_tilt);
v3f untilted_centrum = getSkyBodyPosition(horizon_position, day_position, 0.f);
for (video::S3DVertex &vertex : vertices) {
// Body is directed to -Z (south) by default