Positional Near-Wall Offset#186
Merged
themrdemonized merged 5 commits intothemrdemonized:landerfrom Apr 27, 2025
Merged
Conversation
…/ position offsets
- Necessary to prevent scopes etc. clipping into the camera on a per-weapon basis - Default is conservative, calibrated around sniper optics
- Offsetting along HUD item forward for now; per-class specialization to come alongside the g_firepos feature branch - Applied in a new OnFrame implementation (called from CHUDManager) - Necessary to run late, as offsetting causes a feedback loop if witnessed by the ray query, and graphical issues if done in render
46032d6 to
450773b
Compare
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.
Generalizes HUD near-wall behaviour into a scalar, and uses it to drive the existing HUD FOV offset, as well as a new position offset that shifts HUD items along their local Z axis. Also adds the option to disable it entirely.
With a device or weapon in hipfire position, this uses the existing min / max nearwall range values to determine positional offset.
As Z-shifting is liable to cause scope or stock clipping during ADS, a new
nearwall_zoomed_rangeLTX parameter has been added to configure maximum offset on a per-weapon basis. By default, this is set to a conservative value calibrated around vanilla sniper optics, but could be extended to the full vanilla weapon set with sufficient effort, as well as to any reposition mod.Per-item offset behaviour (i.e. less awkward motion for knife, detector, other upwardly-oriented items) will be coming alongside per-item tracing in the big
g_fireposrewrite branch, which I'll start on polishing into a PR now this is ready for eyes-on.It has a hard dependency on this, #183, and #179 / #184, but I'll probably send it over as a free-standing branch for transparency if I finish up before the rest are signed and sealed.