载入中...
搜索中...
未找到
SkyTimeline.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include <array>
5#include "common/Result.h"
6#include "common/Time.h"
7
8namespace eve::daynight {
10struct SkyWeather {
11 double cloudCoverage = 0; // UDS range [0,10].
12 double fog = 0;
13 double rain = 0;
14 double snow = 0;
15 std::array<double, 2> windXZ{0, 0};
16};
17
19struct SkyClock {
20 double initialHour = 12;
21 double hoursPerSecond = 1.0 / 3600.0;
22};
23
25struct SkyFrame {
26 double elapsedSeconds = 0;
27 double hour = 12;
29 std::array<double, 2> cloudTravelXZ{0, 0};
30};
31
43public:
46 [[nodiscard]] static Result<SkyTimeline> create(const SkyClock& clock, const SkyWeather& weather);
49 [[nodiscard]] Result<void> advance(Duration duration);
54 [[nodiscard]] Result<void> transitionTo(const SkyWeather& target, Duration duration);
56 [[nodiscard]] SkyFrame frame() const noexcept;
57
58private:
59 SkyTimeline(const SkyClock& clock, const SkyWeather& weather);
60 SkyClock clock_;
61 SkyWeather from_, to_;
62 Duration elapsed_;
63 Duration transitionStart_;
64 Duration transitionDuration_;
65 std::array<double, 2> travelOrigin_{0, 0};
66};
67} // namespace eve::daynight
LogicalId target
float duration
#define EVENGINE_API_WORLD
Definition Export.h:109
Move-only, checked operation results for the common layer.
Common time values and an injectable deterministic simulation clock.
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Owns one independent sky clock, weather transition and integrated cloud travel.
Definition SkyTimeline.h:42
Runtime clock configuration, independent of the legacy DayNight module.
Definition SkyTimeline.h:19
Copied sky simulation state shared by main-view and reflection consumers.
Definition SkyTimeline.h:25
std::array< double, 2 > cloudTravelXZ
Definition SkyTimeline.h:29
Independent sky weather values; distances are metres and wind is metres/second.
Definition SkyTimeline.h:10
std::array< double, 2 > windXZ
Definition SkyTimeline.h:15