Showing the changes to interface/src/Application.cpp (1 of 24 files). Show all
Unified · Split
| @@ -600,10 +600,14 @@ void Application::paintGL() { · 599 unmodified lines | ||
| 600 | 600 | |
| 601 | 601 | if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) { |
| 602 | 602 | if (!OculusManager::isConnected()) { |
| 603 | + // If there isn't an HMD, match exactly to avatar's head | |
| 603 | 604 | _myCamera.setPosition(_myAvatar->getHead()->getEyePosition()); |
| 604 | 605 | _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation()); |
| 606 | + } else { | |
| 607 | + // For an HMD, set the base position and orientation to that of the avatar body | |
| 608 | + _myCamera.setPosition(_myAvatar->getDefaultEyePosition()); | |
| 609 | + _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation()); | |
| 605 | 610 | } |
| 606 | − // OculusManager::display() updates camera position and rotation a bit further on. | |
| 607 | 611 | |
| 608 | 612 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 609 | 613 | static const float THIRD_PERSON_CAMERA_DISTANCE = 1.5f; |
| @@ -659,7 +663,6 @@ void Application::paintGL() { · 49 unmodified lines | ||
| 659 | 663 | |
| 660 | 664 | _viewFrustumOffsetCamera.setRotation(_myCamera.getRotation() * frustumRotation); |
| 661 | 665 | |
| 662 | − _viewFrustumOffsetCamera.initialize(); // force immediate snap to ideal position and orientation | |
| 663 | 666 | _viewFrustumOffsetCamera.update(1.f/_fps); |
| 664 | 667 | whichCamera = &_viewFrustumOffsetCamera; |
| 665 | 668 | } |