Skip to content

bugfix(heightmap): Fix ray casting in BaseHeightMapRenderObjClass::Cast_Ray (2)#2869

Open
xezon wants to merge 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-cast-ray
Open

bugfix(heightmap): Fix ray casting in BaseHeightMapRenderObjClass::Cast_Ray (2)#2869
xezon wants to merge 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-cast-ray

Conversation

@xezon

@xezon xezon commented Jul 12, 2026

Copy link
Copy Markdown

This change is follow up for #2836 and applies more fixing in the Cast_Ray function.

Before this change the ray cast was failing if the camera was positioned below the max terrain height. The logical consequence was that no unit could be ordered to move anywhere on close zoom.

With the fixed logic the initial terrain hit box is assembled in a way that the ray cast has a chance to hit it before moving forward with the narrowing search.

@xezon xezon added Bug Something is not working right, typically is user facing Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour ThisProject The issue was introduced by this project, or this task is specific to this project Input labels Jul 12, 2026
@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates terrain ray casting to build and refine a ray-aligned search box.

  • Limits the initial height range to the ray span.
  • Refines terrain bounds before testing triangles.
  • Tracks repeated box intersections during narrowing.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp Updates Cast_Ray to construct a bounded initial terrain box and refine its ray intersections.

Reviews (2): Last reviewed commit: "Fix ray height margin" | Re-trigger Greptile

Comment thread Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Input Major Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant