16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Additional moon phase

This commit is contained in:
stele
2020-03-27 23:26:45 +01:00
parent 947859c678
commit 7ffe5c3371
2 changed files with 14 additions and 4 deletions

View File

@@ -305,10 +305,15 @@ void cMoon::irradiance() {
void
cMoon::phase() {
// calculate moon's age in days from new moon
float ip = normalize( ( simulation::Time.julian_day() - 2451550.1f ) / 29.530588853f );
m_phase = ip * 29.53f;
SYSTEMTIME lt;
GetLocalTime(&lt);
if ((lt.wMonth==5)&&(lt.wDay==4)) //May the forth be with you!
m_phase = 50;
else {
// calculate moon's age in days from new moon
float ip = normalize( ( simulation::Time.julian_day() - 2451550.1f ) / 29.530588853f );
m_phase = ip * 29.53f;
}
}
// normalize values to range 0...1

View File

@@ -1636,6 +1636,11 @@ bool opengl33_renderer::Render(world_environment *Environment)
moonv = 1.0f - 0.667f;
moonu = 0.333f;
}
else if (moonphase == 50) //9th slot used for easter egg
{
moonv = 1.0f - 0.667f;
moonu = 0.66f;
}
else
{
moonv = 1.0f - 0.0f;