mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
Additional moon phase
This commit is contained in:
13
moon.cpp
13
moon.cpp
@@ -305,10 +305,15 @@ void cMoon::irradiance() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
cMoon::phase() {
|
cMoon::phase() {
|
||||||
|
SYSTEMTIME lt;
|
||||||
// calculate moon's age in days from new moon
|
GetLocalTime(<);
|
||||||
float ip = normalize( ( simulation::Time.julian_day() - 2451550.1f ) / 29.530588853f );
|
if ((lt.wMonth==5)&&(lt.wDay==4)) //May the forth be with you!
|
||||||
m_phase = ip * 29.53f;
|
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
|
// normalize values to range 0...1
|
||||||
|
|||||||
@@ -1636,6 +1636,11 @@ bool opengl33_renderer::Render(world_environment *Environment)
|
|||||||
moonv = 1.0f - 0.667f;
|
moonv = 1.0f - 0.667f;
|
||||||
moonu = 0.333f;
|
moonu = 0.333f;
|
||||||
}
|
}
|
||||||
|
else if (moonphase == 50) //9th slot used for easter egg
|
||||||
|
{
|
||||||
|
moonv = 1.0f - 0.667f;
|
||||||
|
moonu = 0.66f;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
moonv = 1.0f - 0.0f;
|
moonv = 1.0f - 0.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user