fix(editor): normal recalculation after sculpt, mode switch cleanup

- Terrain normals recalculated after height changes (smooth lighting
  on sculpted terrain instead of flat-shaded appearance)
- Ghost preview and brush indicator cleared when switching modes
  (prevents stale model instances or circles persisting)
- File > Clear All resets undo history and selections
- Normal computation uses finite differences from neighbor heights,
  handles both outer (9x9) and inner (8x8) vertex grid positions
This commit is contained in:
Kelsi 2026-05-05 04:24:20 -07:00
parent 5daa359e74
commit ba96de7138
5 changed files with 70 additions and 1 deletions

View file

@ -58,7 +58,13 @@ public:
core::Window* getWindow() { return window_.get(); }
EditorMode getMode() const { return mode_; }
void setMode(EditorMode m) { mode_ = m; }
void setMode(EditorMode m) {
if (m != mode_) {
viewport_.clearGhostPreview();
viewport_.setBrushIndicator({}, 0, false);
}
mode_ = m;
}
void markObjectsDirty() { objectsDirty_ = true; }
void startGizmoMode(TransformMode mode);