fix(editor): terrain raycast on rough terrain, keyboard shortcuts, context menu

- Raycast AABB now uses actual min/max vertex heights per chunk
  instead of fixed ±200 padding (fixes misses on sculpted terrain)
- Right-click context menu opens correctly (deferred popup via flag
  since ImGui::OpenPopup must be called within ImGui frame)
- Keyboard shortcuts: G=Move, R=Rotate, T=Scale, X/Y=axis lock,
  Escape=deselect, Delete works in any mode for objects/NPCs
- Delete key now removes selected NPC in NPC mode too
This commit is contained in:
Kelsi 2026-05-05 03:55:53 -07:00
parent f38884856f
commit ace6173401
4 changed files with 40 additions and 7 deletions

View file

@ -62,6 +62,8 @@ public:
void startGizmoMode(TransformMode mode);
void setGizmoAxis(TransformAxis axis);
TransformGizmo& getGizmo() { return viewport_.getGizmo(); }
bool shouldOpenContextMenu() const { return openContextMenu_; }
void clearContextMenuFlag() { openContextMenu_ = false; }
float getWaterHeight() const { return waterHeight_; }
void setWaterHeight(float h) { waterHeight_ = h; }
@ -92,6 +94,7 @@ private:
bool imguiInitialized_ = false;
bool painting_ = false;
bool objectsDirty_ = false;
bool openContextMenu_ = false;
size_t lastObjectCount_ = 0;
EditorMode mode_ = EditorMode::Sculpt;
float waterHeight_ = 100.0f;