Day night cycle: Difference between revisions
m (→CGameTime) |
mNo edit summary |
||
Line 12: | Line 12: | ||
The return value is a floating point that ranges from 0.0 to 1.0, measuring the distance the current server time is from midnight. 0.0 represents the time just after midnight, 0.5 represents midday, and 1.0 represents the time just before midnight. | The return value is a floating point that ranges from 0.0 to 1.0, measuring the distance the current server time is from midnight. 0.0 represents the time just after midnight, 0.5 represents midday, and 1.0 represents the time just before midnight. | ||
== DayNight == | |||
=== DayNight::InterpTable === | |||
Given an interpolation factor and a table, this function returns a value interpolated out of the table. The function is commonly used in various DayNight update functions. | |||
==== Tables ==== | |||
Tables that are fed into DayNight::InterpTable include: | |||
* DayNight::s_sidnTable | |||
* DayNight::DNSky::s_darkTable | |||
* DayNight::DNSky::s_fadeTable | |||
* DayNight::DNStars::s_fadeTable | |||
* DayNight::DNClouds::s_bumpFadeTable | |||
* DayNight::CDayNightObjectInt::SetDirection(void)::phiTable | |||
* DayNight::CDayNightObjectInt::SetDirection(void)::thetaTable | |||
==== Logic ==== | |||
WIP |
Revision as of 17:28, 16 September 2016
Summary
WIP
CGameTime
CGameTime contains the logic and values necessary to determine things like: time of day progression, adjustments necessary to transform local time in to server time, etc.
CGameTime::GameTimeGetDayProgression
The GameTimeGetDayProgression function in CGameTime is frequently used in the various DayNight calculations. This function calculates the minutes since midnight in server time, and divides by the total number of minutes in a day.
The return value is a floating point that ranges from 0.0 to 1.0, measuring the distance the current server time is from midnight. 0.0 represents the time just after midnight, 0.5 represents midday, and 1.0 represents the time just before midnight.
DayNight
DayNight::InterpTable
Given an interpolation factor and a table, this function returns a value interpolated out of the table. The function is commonly used in various DayNight update functions.
Tables
Tables that are fed into DayNight::InterpTable include:
- DayNight::s_sidnTable
- DayNight::DNSky::s_darkTable
- DayNight::DNSky::s_fadeTable
- DayNight::DNStars::s_fadeTable
- DayNight::DNClouds::s_bumpFadeTable
- DayNight::CDayNightObjectInt::SetDirection(void)::phiTable
- DayNight::CDayNightObjectInt::SetDirection(void)::thetaTable
Logic
WIP