nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
daylight.h
Go to the documentation of this file.
1#ifndef NANOMMO_CLIENT_DAYLIGHT_H_
2#define NANOMMO_CLIENT_DAYLIGHT_H_
3
4#include "client/atmosphere.h"
5#include "protocol/nanommo.pb.h"
6
7namespace nanommo {
8
9/// How dark it is at that time of day, from 0 all day to 1 all night, going
10/// between the two at dawn and dusk.
11float Darkness(float day);
12
13/// Towards the sun at that time of day: up from the east at 0.25, overhead,
14/// though a little to the south, at noon, and down in the west at 0.75.
15std::array<float, 3> SunAt(float day);
16
17/// What turns on and off: the time of day, and the weather.
18struct Showing {
19 bool day_night = true;
20 bool weather = true;
21};
22
23/// The land's atmosphere under the sky the server sent: its day, dawn, dusk
24/// or night, with the sun or the moon where the time puts it, and darker,
25/// greyer and nearer under the weather. A land without days, the Crypt, keeps
26/// its own night, and takes only the weather. Without the time of day, it's
27/// the land's own look.
28Atmosphere AtmosphereUnder(int land, const protocol::Sky& sky,
29 const Showing& showing);
30
31} // namespace nanommo
32
33#endif // NANOMMO_CLIENT_DAYLIGHT_H_
Definition chat.cc:9
float Darkness(float day)
Definition daylight.cc:227
Atmosphere AtmosphereUnder(int land, const protocol::Sky &sky, const Showing &showing)
Definition daylight.cc:237
std::array< float, 3 > SunAt(float day)
Definition daylight.cc:232
The sky and the light, which the shaders read each frame.
Definition atmosphere.h:13
What turns on and off: the time of day, and the weather.
Definition daylight.h:18