Skip to content

feat(xr): add smooth turn mode to XrNavigation#8771

Merged
mvaligursky merged 1 commit into
mainfrom
mv-xr-smooth-turn
May 22, 2026
Merged

feat(xr): add smooth turn mode to XrNavigation#8771
mvaligursky merged 1 commit into
mainfrom
mv-xr-smooth-turn

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

Adds a continuous-turn option to XrNavigation alongside the existing snap turn, and updates the vr-lod example to use it.

Changes:

  • New turnMode attribute on XrNavigation selects how the right thumbstick rotates the view: 'snap' (default — existing behaviour), 'smooth' (continuous angular rate), or 'none'.
  • New smoothTurnSpeed (default 90 °/s) and smoothTurnThreshold (default 0.15 deadzone) 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 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.

API Changes:

  • New attribute XrNavigation#turnMode: 'snap' | 'smooth' | 'none' (default 'snap').
  • New attribute XrNavigation#smoothTurnSpeed: number (default 90).
  • New attribute XrNavigation#smoothTurnThreshold: number (default 0.15).
  • New method XrNavigation#handleSmoothTurning(inputSource, dt).

Examples:

  • vr-lod: switched to XrNavigation with turnMode: 'smooth'.
  • vr-lod: initial splat budget lowered from 1.5M to 1M.
  • vr-lod: 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.

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.
@mvaligursky mvaligursky self-assigned this May 22, 2026
@mvaligursky mvaligursky merged commit 38f9ab7 into main May 22, 2026
13 of 14 checks passed
@mvaligursky mvaligursky deleted the mv-xr-smooth-turn branch May 22, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant