terrible branch.
This commit is contained in:
@@ -80,6 +80,7 @@ public:
|
||||
|
||||
// Update simulation objects like the Star
|
||||
sim.updateStar(deltaTime);
|
||||
sim.updateWeatherAndPhysics(deltaTime);
|
||||
|
||||
ImGui::Begin("WorldBox Simulation");
|
||||
if (ImGui::BeginTable("MainLayout", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter)) {
|
||||
@@ -140,6 +141,34 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Weather & Physics", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::Checkbox("Enable Gravity (Terrain)", &sim.config.enableGravity);
|
||||
ImGui::DragFloat3("Gravity", sim.config.gravity.data());
|
||||
ImGui::DragFloat3("Wind", sim.config.wind.data());
|
||||
ImGui::DragFloat("Physics Step (sec)", &sim.config.physicsStep, 0.01f, 0.01f, 1.0f);
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::Text("Clouds & Rain");
|
||||
ImGui::DragInt("Cloud Count", &sim.config.cloudCount, 1, 0, 100);
|
||||
ImGui::DragFloat("Cloud Height", &sim.config.cloudHeight, 5.0f, 10.0f, 1000.0f);
|
||||
ImGui::DragFloat("Rain Spawn Rate", &sim.config.rainSpawnRate, 0.1f, 0.0f, 50.0f);
|
||||
ImGui::ColorEdit3("Cloud Color", sim.config.cloudColor.data());
|
||||
ImGui::ColorEdit3("Rain Color", sim.config.rainColor.data());
|
||||
|
||||
if (ImGui::Button("Generate Clouds", ImVec2(-1, 40))) {
|
||||
sim.generateClouds();
|
||||
applyDebugColorMode();
|
||||
statsNeedUpdate = true;
|
||||
}
|
||||
if (ImGui::Button("Clear Weather", ImVec2(-1, 30))) {
|
||||
for (auto& c : sim.clouds) sim.grid.remove(c.pos);
|
||||
for (auto& r : sim.rainDrops) sim.grid.remove(r.pos);
|
||||
sim.clouds.clear();
|
||||
sim.rainDrops.clear();
|
||||
statsNeedUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Environment & Celestial", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::Text("Star Settings");
|
||||
ImGui::Checkbox("Enable Star Rotation", &sim.config.enableStarRotation);
|
||||
@@ -246,10 +275,21 @@ public:
|
||||
}
|
||||
case DebugColorMode::BASE:
|
||||
default:
|
||||
if (p->data.type == 1) color = sim.config.baseRockColor;
|
||||
else if (p->data.type == 2) color = sim.config.grassColorBase;
|
||||
else if (p->data.type == 3) color = sim.config.starColor;
|
||||
else color = sim.config.baseDirtColor;
|
||||
if (p->data.type == 0) {
|
||||
v3 darkDirt = sim.config.baseDirtColor * 0.4f;
|
||||
color = sim.config.baseDirtColor * (1.0f - p->data.moisture) + darkDirt * p->data.moisture;
|
||||
} else if (p->data.type == 1) {
|
||||
color = sim.config.baseRockColor;
|
||||
} else if (p->data.type == 2) {
|
||||
v3 lushGrass = sim.config.grassColorBase * 1.5f;
|
||||
color = sim.config.grassColorBase * (1.0f - p->data.moisture) + lushGrass * p->data.moisture;
|
||||
} else if (p->data.type == 3) {
|
||||
color = sim.config.starColor;
|
||||
} else if (p->data.type == 4) {
|
||||
color = sim.config.cloudColor;
|
||||
} else if (p->data.type == 5) {
|
||||
color = sim.config.rainColor;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user