mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 09:15:01 +01:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user