History

Application: Maintain orientation of eye offset matrix.

Lubosz Sarnecki committed 2 years ago

Commit fff21271 parent 4b9998e1 file · +2 −8Browse files

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

Unified · Split

interface/src/Application_Graphics.cpp+2−8
@@ -551,16 +551,10 @@ void Application::updateRenderArgs(float deltaTime) { · 550 unmodified lines
551551 // only when the display plugin changes (or in non-HMD modes when the user
552552 // changes the FOV manually, which right now I don't think they can.
553553 for_each_eye([&](Eye eye) {
554− // For providing the stereo eye views, the HMD head pose has already been
555− // applied to the avatar, so we need to get the difference between the head
556− // pose applied to the avatar and the per eye pose, and use THAT as
557− // the per-eye stereo matrix adjustment.
558− mat4 eyeToHead = getActiveDisplayPlugin()->getEyeToHeadTransform(eye);
559554 // Grab the translation
560− vec3 eyeOffset = glm::vec3(eyeToHead[3]);
555+ eyeOffsets[eye] = getActiveDisplayPlugin()->getEyeToHeadTransform(eye);
561556 // Apply IPD scaling
562− mat4 eyeOffsetTransform = glm::translate(mat4(), eyeOffset * -1.0f * ipdScale);
563− eyeOffsets[eye] = eyeOffsetTransform;
557+ eyeOffsets[eye][3][0] *= ipdScale;
564558 eyeProjections[eye] = getActiveDisplayPlugin()->getEyeProjection(eye, baseProjection);
565559 });
566560