History

Update camera object's position and orientation with actual Rift values

David Rowe committed 12 years ago

Commit 673afca1 parent 1bffaa22 files · +13 −3Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+9−3
@@ -609,8 +609,11 @@ void Application::paintGL() { · 608 unmodified lines
609609
610610 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
611611 _myCamera.setTightness(0.0f); // In first person, camera follows (untweaked) head exactly without delay
612− _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition());
613− _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
612+ if (!OculusManager::isConnected()) {
613+ _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition());
614+ _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
615+ }
616+ // OculusManager::display() updates camera position and rotation a bit further on.
614617
615618 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
616619 //Note, the camera distance is set in Camera::setMode() so we dont have to do it here.
@@ -640,7 +643,9 @@ void Application::paintGL() { · 23 unmodified lines
640643 }
641644
642645 // Update camera position
643− _myCamera.update( 1.f/_fps );
646+ if (!OculusManager::isConnected()) {
647+ _myCamera.update(1.f / _fps);
648+ }
644649
645650 // Note: whichCamera is used to pick between the normal camera myCamera for our
646651 // main camera, vs, an alternate camera. The alternate camera we support right now
@@ -682,6 +687,7 @@ void Application::paintGL() { · 35 unmodified lines
682687 } else {
683688 OculusManager::display(_myAvatar->getWorldAlignedOrientation(), _myAvatar->getDefaultEyePosition(), *whichCamera);
684689 }
690+ _myCamera.update(1.f / _fps);
685691
686692 } else if (TV3DManager::isConnected()) {
687693

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t