Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 21, 2025

Description

This PR improves the panning logic in MapControls to ensure the point under the mouse cursor remains exactly under the cursor during panning ("sticky" panning). Previously, the panning used an approximation that could cause drift, especially when panning far from the center.

Before After
Screen.Recording.2025-11-21.at.5.08.07.PM.mov
Screen.Recording.2025-11-21.at.5.08.24.PM.mov

Changes

  • Implemented raycasting-based panning to calculate precise world-space deltas.

Test

  • Verified that the point under the cursor stays fixed relative to the cursor while dragging.
  • Verified that damping works as expected (smooth catch-up).
  • Verified that enabling screenSpacePanning restores the original screen-space panning behavior.

(Made using https://antigravity.google/ with Gemini 3.0)

@mrdoob mrdoob added this to the r182 milestone Nov 21, 2025
@mrdoob mrdoob changed the title MapControls: Improve panning accuracy and add damping support. MapControls: Improve panning accuracy Nov 21, 2025
@mrdoob mrdoob merged commit aee0fd4 into dev Nov 21, 2025
9 checks passed
@mrdoob mrdoob deleted the mapcontrols branch November 21, 2025 12:07
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.

3 participants