-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProceduralGalaxyLabWindow.h
More file actions
63 lines (47 loc) · 1.67 KB
/
ProceduralGalaxyLabWindow.h
File metadata and controls
63 lines (47 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include "stellar/core/Types.h"
#include "stellar/math/Vec3.h"
#include "stellar/proc/GalaxyGenerator.h"
#include "stellar/proc/GalaxyRegions.h"
#include "stellar/proc/Hyperlanes.h"
#include "stellar/sim/Celestial.h"
#include "stellar/sim/Faction.h"
#include <functional>
#include <string>
#include <vector>
namespace stellar::game {
struct ProceduralGalaxyLabWindowState {
bool open{false};
core::u64 seed{1337ull};
int factionCount{8};
proc::GalaxyParams params{};
// View / preview controls (top-down XY projection).
math::Vec3d centerLy{0.0, 0.0, 0.0};
double viewRadiusLy{250.0};
double zHalfLy{200.0};
std::size_t maxStubs{20000};
bool autoRegenerate{true};
bool colorByFaction{false};
bool colorByRegion{false};
bool showArmGuides{true};
bool showLegend{true};
// Hyperlane overlay (procedural sparse navigation/trade corridor graph).
bool showHyperlanes{false};
proc::HyperlaneParams hyperlaneParams{};
// Galaxy regions (Worley/Voronoi). Used for visualization only.
double regionCellSizeLy{900.0};
// Cached preview data.
bool dirty{true};
std::vector<sim::Faction> factions{};
std::vector<sim::SystemStub> stubs{};
// Cached per-stub region kind/id for preview rendering.
std::vector<proc::GalaxyRegionKind> stubRegionKind{};
std::vector<core::u64> stubRegionId{};
// Cached hyperlane overlay.
std::vector<proc::HyperlaneEdge> hyperlanes{};
double lastLaneMs{0.0};
double lastGenMs{0.0};
};
using ToastFn = std::function<void(const std::string& msg, double ttlSec)>;
void drawProceduralGalaxyLabWindow(ProceduralGalaxyLabWindowState& state, float timeSec, const ToastFn& toast);
} // namespace stellar::game