day-night loop, dynamic skybox, clock on debug panel

This commit is contained in:
MihailRis
2023-11-28 11:01:22 +03:00
parent 4a9a4ddd14
commit c08c31b0ad
24 changed files with 599 additions and 48 deletions
+14
View File
@@ -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;
}