You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xezon
added
Bug
Something is not working right, typically is user facing
Major
Severity: Minor < Major < Critical < Blocker
ThisProject
The issue was introduced by this project, or this task is specific to this project
labels
Apr 12, 2026
This PR fixes malformed camera area constraints during cutscenes via two complementary changes: skipping updateCameraAreaConstraints() during scripted camera movements, and clamping the computed offset to at most half the map extent in each dimension to prevent inverted constraint regions.
The calcCameraAreaOffset refactor also moves the isLookingDown computation inside the function (deriving it from the pick ray rather than the camera-forward vector) and adds an early-return guard for near-horizontal camera angles that would previously produce near-infinite offsets.
Confidence Score: 5/5
This PR is safe to merge; the fix is targeted and correctly addresses the cutscene constraint bug on all identified paths.
No P0 or P1 issues found. The !didScriptedMovement guard cleanly prevents constraint clamping during cutscenes. The std::min clamping to half-map-extent is a robust guard against inverted regions. The isLookingDown refactor is logically equivalent to the old approach. All remaining findings are P2 or non-issues.
Core fix: updateCameraAreaConstraints() gated on !didScriptedMovement; offset clamped to half map size; horizon guard added in calcCameraAreaOffset; isLookingDown correctly derived from pick ray inside function. No issues found.
Declaration updated to remove the Bool isLookingDown parameter from calcCameraAreaOffset, matching the implementation change.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[W3DView::update] --> B{didScriptedMovement?}
B -- Yes --> C[Skip updateCameraAreaConstraints\ncutscene/scripted camera free to move]
B -- No --> D[updateCameraAreaConstraints]
D --> E{m_cameraAreaConstraintsValid?}
E -- No --> F[calcCameraAreaConstraints]
F --> G{TheTerrainLogic?}
G -- No --> H[return — constraints remain invalid]
G -- Yes --> I[Set camera transform\nCall calcCameraAreaOffset]
I --> J{ray Z delta < 1.0f?\nnear-horizontal}
J -- Yes --> K[return 1e+6f]
J -- No --> L[Compute offset from pick rays]
K --> M[std::min offset to half map X]
L --> M
M --> N[std::min offset to half map Y]
N --> O[Apply constraints lo/hi\nSet m_cameraAreaConstraintsValid = true]
E -- Yes --> P{isWithinCameraAreaConstraints?}
O --> P
P -- No --> Q[clipCameraIntoAreaConstraints]
P -- Yes --> R[Done]
Q --> R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BugSomething is not working right, typically is user facingMajorSeverity: Minor < Major < Critical < BlockerThisProjectThe issue was introduced by this project, or this task is specific to this project
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes malformed camera area constraints during cutscenes.