perf(view): Optimize and simplify camera transform update logic#2280
Merged
xezon merged 2 commits intoTheSuperHackers:mainfrom Feb 10, 2026
Merged
perf(view): Optimize and simplify camera transform update logic#2280xezon merged 2 commits intoTheSuperHackers:mainfrom
xezon merged 2 commits intoTheSuperHackers:mainfrom
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h | Adds a member flag (m_recalcCamera) to track whether camera transform needs recomputation; no behavioral issues found. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp | Consolidates camera transform updates behind m_recalcCamera to ensure setCameraTransform() is called at most once per update; constructor/init/reset behavior appears consistent; no regressions found in changed logic. |
Sequence Diagram
sequenceDiagram
participant Frame as Frame loop
participant View as W3DView
participant Cam as m_3DCamera
Frame->>View: stepView()
Note over View: Updates shake offsets only
Frame->>View: update()
View->>View: updateCameraLock/scroll/zoom/waypoints
Note over View: Any camera-affecting change sets m_recalcCamera=true
alt m_recalcCamera || m_isCameraSlaved
View->>View: setCameraTransform()
View->>Cam: Set_Transform(...)
View->>View: m_recalcCamera=false
else no camera change
Note over View: No camera transform recompute this frame
end
Frame->>View: draw() / render passes
View->>Cam: Apply() / used for rendering
Author
xezon
commented
Feb 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 optimizes and simplifies the camera transform update logic.
This ensures that the camera transform is only ever updated once a frame and not multiple times.
The performance saving is negligent.