mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat(editor): reset-to-flat button for terrain, consolidation
- "Reset to Flat" button in Noise Generator section: zeroes all heights across entire tile for starting over without creating a new terrain - Useful workflow: reset → noise → smooth → scale → clamp → auto-paint
This commit is contained in:
parent
3ac40d27ad
commit
f593606251
3 changed files with 20 additions and 1 deletions
|
|
@ -652,6 +652,18 @@ void TerrainEditor::smoothEntireTile(int iterations) {
|
|||
dirty_ = true;
|
||||
}
|
||||
|
||||
void TerrainEditor::resetToFlat() {
|
||||
if (!terrain_) return;
|
||||
for (int ci = 0; ci < 256; ci++) {
|
||||
auto& chunk = terrain_->chunks[ci];
|
||||
if (!chunk.hasHeightMap()) continue;
|
||||
chunk.heightMap.heights.fill(0.0f);
|
||||
dirtyChunks_.push_back(ci);
|
||||
}
|
||||
for (int ci = 0; ci < 256; ci++) stitchEdges(ci);
|
||||
dirty_ = true;
|
||||
}
|
||||
|
||||
void TerrainEditor::scaleHeights(float factor) {
|
||||
if (!terrain_) return;
|
||||
for (int ci = 0; ci < 256; ci++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue