History

Fix for camera matrix position when in Vive HMD.

Anthony J. Thibault committed 11 years ago

Commit 9363ca21 parent aa666911 file · +6 −4Browse files

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

Unified · Split

interface/src/Application.cpp+6−4
@@ -966,12 +966,14 @@ void Application::paintGL() { · 965 unmodified lines
966966 // Always use the default eye position, not the actual head eye position.
967967 // Using the latter will cause the camera to wobble with idle animations,
968968 // or with changes from the face tracker
969− _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
969+
970970 if (!getActiveDisplayPlugin()->isHmd()) {
971− // If not using an HMD, grab the camera orientation directly
971+ _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
972972 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());
973973 } else {
974− _myCamera.setRotation(glm::quat_cast(_myAvatar->getSensorToWorldMatrix() * getHMDSensorPose()));
974+ auto camMat = _myAvatar->getSensorToWorldMatrix() * getHMDSensorPose();
975+ _myCamera.setPosition(extractTranslation(camMat));
976+ _myCamera.setRotation(glm::quat_cast(camMat));
975977 }
976978 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
977979 if (isHMDMode()) {
@@ -3729,7 +3731,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 2751 unmodified lines
37293731 }
37303732 renderArgs->_debugFlags = renderDebugFlags;
37313733 _entities.render(renderArgs);
3732− ViveControllerManager::getInstance().render(renderArgs);
3734+ ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, pendingChanges);
37333735 }
37343736
37353737 // render the ambient occlusion effect if enabled

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