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

Bounds doesn't work with CameraControls when makeDefault is true #1408

Open
dih7 opened this issue Apr 19, 2023 · 3 comments
Open

Bounds doesn't work with CameraControls when makeDefault is true #1408

dih7 opened this issue Apr 19, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@dih7
Copy link

dih7 commented Apr 19, 2023

  • three version: 0.150.1
  • @react-three/fiber version: 8.12.0
  • @react-three/drei version: 9.65.4
  • node version: 16.12.0
  • npm (or yarn) version: Not sure how to see this in CodeSandbox.

Problem description:

As the title says - it seems that Bounds does not work when the makeDefault prop on CameraControls is true.

It works fine using OrbitControls with makeDefault.

Relevant code:

I've created a sandbox based on an existing example: https://codesandbox.io/s/clones-forked-ysh4e7?file=/src/App.js

Suggested solution:

I've done a little digging, but I wasn't able to find a definitive solution. It could be related to the controls.target in Bounds, or a difference between CameraControls and other cameras, such as OrbitControls.

One example of this is in src/core/Bounds.tsx, line 138 (https://github.com/pmndrs/drei/blob/master/src/core/Bounds.tsx#L138) - controls.target is undefined, however controls is not.

@dih7 dih7 added the bug Something isn't working label Apr 19, 2023
@NoodleHJ
Copy link

Does anyone know the workaround with this problem? I need to dynamically change the touches of the control and involve trunk at the same time. Right now, using camera control seems to be the only option. Thank u so much!!

@mishazawa
Copy link

This issue still exists.

@Kavish20
Copy link

This issue still exists. It says that cannot read properties of undefined when doing controls.target.copy()

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

4 participants