Scale camera zoom based on distance to target #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This causes the distance between the camera position and the camera target to affect the scale at which geometry is projected through the camera. Zooming was also changed to not affect the position of the view target, which in combination with the scaling removes the need to dynamically change the orthographic camera height.
For all cameras, this scales the effective far and near plane distances. Perspective cameras are otherwise unaffected visually. 2D cameras left at the default position are not affected at all. The default height of orthographic cameras will need to be divided by their initial distance to the target to maintain the same appearance.
This is motivated by a combination perspective/orthographic camera I am developing, which would otherwise require both a FOV and height parameter and be dynamically rescaled similar to what is done for the current orthographic camera.