From 4ef4a30ef941485e589b33aec8f3fe702fbf7732 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 22:29:04 +0100 Subject: [PATCH] fix(editor): the cursor off the terrain on the ground only where the depth read hit something (Mouse_Hit), not where its offset isn't zero Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ --- application/editormode.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/editormode.cpp b/application/editormode.cpp index d7424c19e..9cf75ce34 100644 --- a/application/editormode.cpp +++ b/application/editormode.cpp @@ -3591,11 +3591,10 @@ bool editor_mode::cursor_on_ground(glm::dvec3 &World) { if (m_streamer.active() && terrain_cursor(World)) return true; - // no terrain under the ray: the depth read back under the cursor, as before - glm::dvec3 const offset = GfxRenderer->Mouse_Position(); - if (glm::length(offset) <= 1e-3) + // no terrain under the ray: the depth read back under the cursor, as before, where it hit anything + if (false == GfxRenderer->Mouse_Hit()) return false; - World = Camera.Pos + offset; + World = Camera.Pos + GfxRenderer->Mouse_Position(); return true; }