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
966 // Always use the default eye position, not the actual head eye position.966 // Always use the default eye position, not the actual head eye position.
967 // Using the latter will cause the camera to wobble with idle animations,967 // Using the latter will cause the camera to wobble with idle animations,
968 // or with changes from the face tracker968 // or with changes from the face tracker
969 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());969
970 if (!getActiveDisplayPlugin()->isHmd()) {970 if (!getActiveDisplayPlugin()->isHmd()) {
971 // If not using an HMD, grab the camera orientation directly971 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
972 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());972 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());
973 } else {973 } 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));
975 }977 }
976 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {978 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
977 if (isHMDMode()) {979 if (isHMDMode()) {
@@ -3729,7 +3731,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 2751 unmodified lines
3729 }3731 }
3730 renderArgs->_debugFlags = renderDebugFlags;3732 renderArgs->_debugFlags = renderDebugFlags;
3731 _entities.render(renderArgs);3733 _entities.render(renderArgs);
3732 ViveControllerManager::getInstance().render(renderArgs);3734 ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, pendingChanges);
3733 }3735 }
3734 3736
3735 // render the ambient occlusion effect if enabled3737 // 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