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:
13
moon.cpp
13
moon.cpp
@@ -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(<);
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user