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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternating between two cameras #76

Closed
paulmelnikow opened this issue Feb 5, 2020 · 2 comments
Closed

Alternating between two cameras #76

paulmelnikow opened this issue Feb 5, 2020 · 2 comments

Comments

@paulmelnikow
Copy link
Contributor

Hi! Thanks for this wonderful alternative to OrbitControls 馃槃

I have a view that's being used for scientific visualization, and it's helpful to let the user toggle between orthographic and perspective. As a result, I've created two cameras and two CameraControls instances, and I'm alternating between them. However, this isn't working perfectly.

If I dispose() the first one when adding the second one, when I reattach it, it no longer receives mouse events, and if I recreate it, it seems to have lost some of its internal state.

If I don't dispose() the first when adding the second, the mouse events intended for the second are sent to both.

I could maybe add an undispose() or reattach() method.

Alternatively, I could try to recreate the controls each time the camera changes, though I'm not sure how to correctly transfer the internal state from the old controls.

Do you have a suggestion for this? Thanks!

@yomotsu
Copy link
Owner

yomotsu commented Feb 6, 2020

Thanks for trying the library
I think you could use .enabled = false rather than .dispose() in this case.

@paulmelnikow
Copy link
Contributor Author

Thanks for the fast response! .enabled is working great. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants