Fix mesh picking and rotation gizmo configuration#592
Fix mesh picking and rotation gizmo configuration#592tracygardner wants to merge 1 commit intomainfrom
Conversation
Two bugs: 1. Rotate gizmo: PR #583 added updateToMatchAttachedMesh: true to fix quaternion/Euler sync, but Babylon.js refuses to use local-space rotation on non-uniformly scaled meshes, logging a warning and breaking the gizmo after any resize. The quaternion-to-Euler conversion in rotDragEnd was the real fix for #582; revert the local-space option to restore rotation on all meshes. 2. Scale gizmo: pickMeshFromScene schedules startCanvasKeyboardMode in a setTimeout(0). If the user picks a mesh before that timer fires (e.g. via the GizmoManager's own pointer handler), the callback still runs, resetting the cursor to crosshair and re-enabling keyboard-pick mode on an already-selected mesh. Guard the callback with hasPicked so it is a no-op once picking has completed. https://claude.ai/code/session_01L3gkDE8aVzntgRGx76Ewwk
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanges to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary
This PR addresses two issues in the gizmo interaction system: preventing duplicate mesh picking operations and correcting the rotation gizmo configuration.
Key Changes
pickMeshFromScene()to prevent starting keyboard mode if a mesh has already been picked, avoiding redundant picking operationsupdateToMatchAttachedMesh: trueoption fromconfigureRotationGizmo()call to use the default configuration behaviorImplementation Details
The mesh picking fix uses the existing
hasPickedflag to short-circuit the keyboard mode initialization within the setTimeout callback, ensuring that only one picking operation occurs per user interaction. The rotation gizmo change simplifies the configuration by relying on default behavior rather than explicitly forcing mesh attachment updates.https://claude.ai/code/session_01L3gkDE8aVzntgRGx76Ewwk