TerraForge3D  2.3.1
3D Terrain And Landscape Generator
ApplicationState.h
1#pragma once
2
3#include "Base/Base.h"
4
5#include "Data/ProjectData.h"
6#include "Modules/ModuleManager.h"
7#include "Sea/SeaManager.h"
8#include "Lighting/LightManager.h"
9#include "Data/Serializer.h"
10#include "Menu/MainMenu.h"
11#include "Generators/MeshGeneratorManager.h"
12#include "TextureStore/TextureStore.h"
13#include "Misc/SupportersTribute.h"
14#include "Filters/FiltersManager.h"
15#include "Foliage/FoliagePlacement.h"
16#include "Sky/SkySettings.h"
17#include "Misc/OSLiscences.h"
18#include "Shading/ShadingManager.h"
19#include "Exporters/TextureBaker.h"
20
21#include "json/json.hpp"
22
24{
25 Model *coreTerrain;
26 Model *grid; // For future use
27 Model *screenQuad;
28
29 Model *customBase;
30 Model *customBaseCopy;
31
34};
35
37{
38 FrameBuffer *reflection = nullptr;
39 FrameBuffer *postProcess = nullptr;
40 FrameBuffer *main = nullptr;
41};
42
44{
45 Shader *terrain = nullptr;
46 Shader *wireframe = nullptr;
47 Shader *foliage = nullptr;
48 Shader *postProcess = nullptr;
49
50 // For future use
51 Shader *meshNormals = nullptr;
52};
53
55{
56 Camera main;
57 Camera postPorcess;
58
59 nlohmann::json Save();
60 void Load(nlohmann::json data);
61};
62
64{
65 double deltatime = 1;
66 double frameRate = 1;
67 double meshGenerationTime = 0;
68 int triangles = 0;
69 int vertexCount = 0;
70};
71
73{
74 bool styleEditor = false;
75 bool statsWindow = false;
76 bool shaderEditorWindow = false;
77 bool texturEditorWindow = false;
78 bool seaEditor = false;
79 bool textureStore = false;
80 bool osLisc = false;
81 bool filtersManager = false;
82 bool foliageManager = false;
83 bool supportersTribute = false;
84 bool skySettings = false;
85 bool modulesManager = false;
86 bool lightControls = true;
87 bool cameraControls = true;
88 bool shadingManager = false;
89 bool textureBaker = false;
90
91 nlohmann::json Save();
92 void Load(nlohmann::json data);
93};
94
96{
97 ModuleManager *manager;
98};
99
101{
102 bool usingBase = true;
103 bool skyboxEnabled = false;
104 bool vSync = true;
105 bool autoUpdate = false;
106 bool mouseButton1, mouseButton2, mouseButton3;
107 bool wireFrameMode = false;
108 bool reqTexRfrsh = false;
109 bool autoSave = false;
110 bool exploreMode = false;
111 bool iExploreMode = false;
112 bool showFoliage = true;
113 bool textureBake = false;
114 bool useGPUForNormals = false;
115 bool postProcess = false;
116 bool autoAspectCalcRatio = true;
117 std::atomic<bool> ruinning = true;
118 std::atomic<bool> remeshing = false;
119
120 nlohmann::json Save();
121 void Load(nlohmann::json data);
122};
123
125{
126 Texture2D *grid;
127};
128
130{
131 float mouseSpeed = 25;
132 float scrollSpeed = 0.5f;
133 float mouseScrollAmount = 0;
134 float viewportMousePosX = 0;
135 float viewportMousePosY = 0;
136 float scale = 1.0f;
137 float offset[3];
138
139
140 int resolution = 256;
141 int numberOfNoiseTypes = 3;
142 int secondCounter = 0;
143 int textureBakeMode = 0;
144 int texBakeRes = 1024;
145
146 nlohmann::json appData;
147
148 std::string currentOpenFilePath = "";
149 std::string currentBaseModelPath = "";
150 std::string kernelsIncludeDir = "";
151
152 float viewportSize[4];
153 float hMapC[4];
154
155 nlohmann::json Save();
156 void Load(nlohmann::json data);
157};
158
160{
161 glm::vec3 UP = glm::vec3(0.0f, 1.0f, 0.0f);
162 glm::vec3 DOWN = glm::vec3(0.0f, -1.0f, 0.0f);
163 glm::vec3 FRONT = glm::vec3(0.0f, 0.0f, -1.0f);
164 glm::vec3 BACK = glm::vec3(0.0f, 1.0f, 1.0f);
165
166 std::string executableDir = "";
167 std::string dataDir = "";
168 std::string cacheDir = "";
169 std::string texturesDir = "";
170 std::string projectsDir = "";
171 std::string tempDir = "";
172 std::string shadersDir = "";
173 std::string kernelsDir = "";
174 std::string fontsDir = "";
175 std::string liscensesDir = "";
176 std::string skyboxDir = "";
177 std::string modulesDir = "";
178 std::string modelsDir = "";
179 std::string configsDir = "";
180 std::string logsDir = "";
181
182};
183
184enum ApplicationMode
185{
186 TERRAIN = 0,
187 CUSTOM_BASE,
188 CUBE_MARCHED
189};
190
192{
193 Application *mainApp;
194
196 ApplicationStateFrameBuffers frameBuffers;
206
207 SeaManager *seaManager = nullptr;
208 LightManager *lightManager = nullptr;
209 Serializer *serailizer = nullptr;
210 MeshGeneratorManager *meshGenerator = nullptr;
211 MainMenu *mainMenu = nullptr;
212 TextureStore *textureStore = nullptr;
213 SupportersTribute *supportersTribute = nullptr;
214 FiltersManager *filtersManager = nullptr;
215 SkyManager *skyManager = nullptr;
216 OSLiscences *osLiscences = nullptr;
217 ProjectManager *projectManager = nullptr;
218 FoliageManager *foliageManager = nullptr;
219 ShadingManager *shadingManager = nullptr;
220 TextureBaker* textureBaker = nullptr;
221
222 ApplicationMode mode = ApplicationMode::TERRAIN;
223
224
226
228};
Definition: Camera.h:9
Definition: Model.h:9
Definition: Shader.h:7
a class to store JSON values
Definition: json.hpp:17860