mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-22 10:19:52 +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))
|
if (m_streamer.active() && terrain_cursor(World))
|
||||||
return true;
|
return true;
|
||||||
// no terrain under the ray: the depth read back under the cursor, as before
|
// no terrain under the ray: the depth read back under the cursor, as before, where it hit anything
|
||||||
glm::dvec3 const offset = GfxRenderer->Mouse_Position();
|
if (false == GfxRenderer->Mouse_Hit())
|
||||||
if (glm::length(offset) <= 1e-3)
|
|
||||||
return false;
|
return false;
|
||||||
World = Camera.Pos + offset;
|
World = Camera.Pos + GfxRenderer->Mouse_Position();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user