Closed a3ng7n closed 1 month ago
@a3ng7n is attempting to deploy a commit to the Poimandres Team on Vercel.
A member of the Team first needs to authorize it.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Thanks.
:tada: This PR is included in version 9.111.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
When using camera-controls sets target via the getTarget method, and updates the control position via the setPosition method.
Why
Allows GizmoHelper to be used alongside CameraControls/camera-controls. resolves #1399
What
Fixes two issues:
CameraControls
doesn't expose atarget
property directly - so whenfocusPoint
is set at animation start, get the target viaCameraControls
getTarget
instead.CameraControls
doesn't seem to like having its camera moved directly, and will continuously attempt to reset themainCamera
's position - the fix is to callCameraControls
setPosition
method after themainCamera
's position is updated, and before it has a chance to revert it.Checklist
I did create a storybook entry that's just a duplicate of the GizmoHelper story below but using CameraControls to test the fix out - but I didn't think it was really value added / worthy of another tutorial entry https://github.com/pmndrs/drei/blob/f4f910f76f48e16ef73c52f2d69bd5bbf96a138e/.storybook/stories/GizmoHelper.stories.tsx#L51-L86 lmk if you think otherwise and I'll update this PR with it