Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GizmoHelper + CameraControls, undefined defaultControls.target in GizmoHelper.js #1831

Open
saumac opened this issue Feb 16, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@saumac
Copy link

saumac commented Feb 16, 2024

  • three version: ^0.161.0
  • @react-three/fiber version: ^9.73.3
  • @react-three/drei version: ^8.15.16
  • node version: v18.18.0
  • npm (or yarn) version: 4.1.0

Problem description:

Not sure if im doing something wrong but I cant get the two components to work together (I have set the makeDefault prop in CameraControls). The GizmoHelper is complaining about the defaultControls.target being undefined when I click on either side of the GizmoViewCube. Any ideas about what could be the issue?

@saumac saumac added the bug Something isn't working label Feb 16, 2024
@CodyJasonBennett
Copy link
Member

CameraControls has _target instead of target. We can do a check like const target = '_target' in controls ? controls._target : controls.target and gracefully fail if either are undefined.

@saumac
Copy link
Author

saumac commented Feb 17, 2024

I tried that but it made the camera "flicker" in a strange way. Not sure if the tween logic needs some update too. I'll give it a one more go.

If it works you or if you find another solution, let me know 🙏🏼

@CodyJasonBennett
Copy link
Member

The issue is that controls' spherical orientation is not updated, so when the gizmo is done animating, the controls reverts back to its stored state.

@saumac
Copy link
Author

saumac commented Feb 19, 2024

@CodyJasonBennett
Any ideas where an update should be made to the controls orientation? I have been testing out some changes but nothing seems to really fix it...

@Mathys-Gasnier
Copy link

Any news or potential fixes for this issue ? It's quite a pain that the CameraControls can't work with the GizmoHelper...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants