mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 09:33:51 +00:00
feat(editor): height scale tool for terrain relief control
- Scale Heights: multiply all terrain heights by a factor (0.1x - 5.0x) - >1.0 exaggerates relief (deeper valleys, taller peaks) - <1.0 flattens terrain toward base height - Re-stitches all chunk edges after scaling for seamless results - Workflow: noise → smooth → scale → clamp for precise control
This commit is contained in:
parent
ff33babb1d
commit
9322d37b81
3 changed files with 25 additions and 1 deletions
|
|
@ -652,6 +652,20 @@ void TerrainEditor::smoothEntireTile(int iterations) {
|
|||
dirty_ = true;
|
||||
}
|
||||
|
||||
void TerrainEditor::scaleHeights(float factor) {
|
||||
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] *= factor;
|
||||
dirtyChunks_.push_back(ci);
|
||||
}
|
||||
// Re-stitch all edges after scaling
|
||||
for (int ci = 0; ci < 256; ci++) stitchEdges(ci);
|
||||
dirty_ = true;
|
||||
}
|
||||
|
||||
void TerrainEditor::clampHeights(float minH, float maxH) {
|
||||
if (!terrain_) return;
|
||||
for (int ci = 0; ci < 256; ci++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue