Fix camera target Y position fallback in flock transform#529
Fix camera target Y position fallback in flock transform#529tracygardner merged 1 commit intomainfrom
Conversation
For ArcRotateCamera, getAbsolutePosition() returns the camera's world position (orbit centre + orbital offset), not the orbit centre itself. Using that Y value as the new setTarget() height displaced the orbit centre upward by the full orbital offset, making the camera tilt down instead of staying level. Fix: use mesh1.target?.y (the actual orbit-centre Y for ArcRotateCamera, and the current look-at Y for FreeCamera) so that only the X/Z of the orbit centre changes, giving a pure horizontal yaw with no pitch change. https://claude.ai/code/session_012ASzHmpUWv39A2j5hiFzyc
Deploying flockxr with
|
| Latest commit: |
b71940f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://29f13809.flockxr.pages.dev |
| Branch Preview URL: | https://claude-fix-look-object-y-axi.flockxr.pages.dev |
|
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)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Updated the camera target Y position logic in the flock transform to use the existing mesh target's Y coordinate as the primary fallback before defaulting to the camera position.
Key Changes
tgtPosto checkmesh1.target?.yfirst before falling back tocamPos.yImplementation Details
The change improves the behavior when
useYis false by maintaining consistency with any previously established target Y values, providing a more predictable camera positioning experience during flock transformations.https://claude.ai/code/session_012ASzHmpUWv39A2j5hiFzyc
Summary by CodeRabbit