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

Merge pull request #12 from antonisauren/tmj-master

Additional moon phase
This commit is contained in:
tmj-fstate
2020-04-02 01:21:50 +02:00
committed by GitHub
3 changed files with 179 additions and 169 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;