mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Playing around with zooming in while pulling back.
This commit is contained in:
parent
e850faee79
commit
00e2ff93e3
1 changed files with 3 additions and 0 deletions
|
@ -589,6 +589,9 @@ void Application::paintGL() {
|
|||
if (pushback > 0.0f) {
|
||||
_myCamera.setTargetPosition(_myCamera.getTargetPosition() +
|
||||
_myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback));
|
||||
float enlargement = _myCamera.getDistance() / (_myCamera.getDistance() + pushback);
|
||||
_myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf(
|
||||
glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f)))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue