mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
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:
parent
d50e4b3f78
commit
5f9bf5c924
3 changed files with 22 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue