feat(editor): height offset tool for shifting entire terrain up/down

- Offset Heights: shifts all terrain heights by a constant amount
  (-100 to +100 range with Apply button)
- Useful for raising terrain above water level or sinking below
- Slider + Apply button in the Noise Generator section
This commit is contained in:
Kelsi 2026-05-05 07:53:01 -07:00
parent d50e4b3f78
commit 5f9bf5c924
3 changed files with 22 additions and 0 deletions

View file

@ -860,6 +860,18 @@ void TerrainEditor::createHill(const glm::vec3& center, float radius, float heig
dirty_ = true;
}
void TerrainEditor::offsetHeights(float amount) {
if (!terrain_) return;
for (int ci = 0; ci < 256; ci++) {
auto& chunk = terrain_->chunks[ci];
if (!chunk.hasHeightMap()) continue;
for (int v = 0; v < 145; v++)
chunk.heightMap.heights[v] += amount;
dirtyChunks_.push_back(ci);
}
dirty_ = true;
}
void TerrainEditor::invertHeights() {
if (!terrain_) return;
// Find midpoint