feat(xr): add smooth turn mode to XrNavigation#8771
Merged
Conversation
Adds a continuous-turn option to XrNavigation alongside the existing snap turn, and updates the vr-lod example to use it. - New turnMode attribute on XrNavigation: 'snap' (default — existing behaviour), 'smooth' (continuous angular rate), or 'none'. - New smoothTurnSpeed (default 90 deg/s) and smoothTurnThreshold (default 0.15 deadzone) attributes drive the smooth path. - handleSmoothTurning rotates the rig around the camera's local position so the view pivots in place (same math as handleSnapTurning, just continuous). - Backward compatible: default turnMode 'snap' keeps every existing caller on the current path. rotateSpeed / rotateThreshold / rotateResetThreshold are unchanged and remain snap-specific. vr-lod example: - Uses XrNavigation with turnMode: 'smooth'. - Initial splat budget dropped from 1.5M to 1M. - Switched the VR reference space from XRSPACE_LOCAL to XRSPACE_LOCALFLOOR so the viewer starts at proper standing height instead of with the head at floor level.
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.
Adds a continuous-turn option to
XrNavigationalongside the existing snap turn, and updates thevr-lodexample to use it.Changes:
turnModeattribute onXrNavigationselects how the right thumbstick rotates the view:'snap'(default — existing behaviour),'smooth'(continuous angular rate), or'none'.smoothTurnSpeed(default90°/s) andsmoothTurnThreshold(default0.15deadzone) attributes drive the smooth path.handleSmoothTurning(inputSource, dt)rotates the rig around the camera's local position so the view pivots in place rather than orbiting the rig origin (same math ashandleSnapTurning, just continuous).turnMode = 'snap'keeps every existing caller on the current path.rotateSpeed/rotateThreshold/rotateResetThresholdare unchanged and remain snap-specific.API Changes:
XrNavigation#turnMode: 'snap' | 'smooth' | 'none'(default'snap').XrNavigation#smoothTurnSpeed: number(default90).XrNavigation#smoothTurnThreshold: number(default0.15).XrNavigation#handleSmoothTurning(inputSource, dt).Examples:
vr-lod: switched toXrNavigationwithturnMode: 'smooth'.vr-lod: initial splat budget lowered from 1.5M to 1M.vr-lod: switched the VR reference space fromXRSPACE_LOCALtoXRSPACE_LOCALFLOORso the viewer starts at proper standing height instead of with the head at floor level.