-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
OrbitControls: add getDistance() #22126
Conversation
I do not think these internals should be exposed, but at a minimum, methods must return the correct answer. In this case, that includes orthographic camera. |
This PR does not produce the correct answer for orthographic camera. Why not compute the distance to the target and return the result? |
@WestLangley I treated |
@marcofugaro No, I would just focus on this PR. If you compute the actual distance, the returned value will be correct. I personally prefer no method to one that can return the incorrect answer. |
@WestLangley done, how does it look now? |
All done! |
Thanks! |
Related issue: remake of #21162
Description
Add
OrbitControls.getDistance()
which exposesspherical.radius
.This is useful for example if you want to enable zooming in but disable zooming out from the start position: