day-night loop, dynamic skybox, clock on debug panel
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include "timeutil.h"
|
||||
|
||||
float timeutil::time_value(float hour, float minute, float second) {
|
||||
return (hour + (minute + second / 60.0f) / 60.0f) / 24.0f;
|
||||
}
|
||||
|
||||
void timeutil::from_value(float value, int& hour, int& minute, int& second) {
|
||||
value *= 24;
|
||||
hour = value;
|
||||
value *= 60;
|
||||
minute = int(value) % 60;
|
||||
value *= 60;
|
||||
second = int(value) % 60;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef UTIL_TIMEUTIL_H_
|
||||
#define UTIL_TIMEUTIL_H_
|
||||
|
||||
namespace timeutil {
|
||||
float time_value(float hour, float minute, float second);
|
||||
void from_value(float value, int& hour, int& minute, int& second);
|
||||
}
|
||||
|
||||
#endif // UTIL_TIMEUTIL_H_
|
||||
Reference in New Issue
Block a user