Skip to content

Commit

Permalink
Oculus Rift|Client: Applying head position to composited UI and view
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 21, 2014
1 parent a3df8b2 commit 60a4cd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -548,8 +548,9 @@ Matrix4f Rend_GetModelViewMatrix(int consoleNum, bool useAngles)
modelView = Matrix4f::rotate(roll, Vector3f(0, 0, 1)) *
Matrix4f::rotate(pitch, Vector3f(1, 0, 0)) *
Matrix4f::rotate(yaw, Vector3f(0, 1, 0)) *
Matrix4f::translate(Matrix4f::rotate(radianToDegree(bodyAngle), Vector3f(0, 1, 0)) *
(ovr.headPosition() * vrCfg().mapUnitsPerMeter()));
Matrix4f::translate(swizzle(Matrix4f::rotate(bodyAngle, Vector3f(0, 1, 0)) *
(ovr.headPosition() * vrCfg().mapUnitsPerMeter()),
AxisNegX, AxisNegY, AxisZ));
}

return (modelView *
Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -648,7 +648,8 @@ DENG2_PIMPL(ClientWindow)
* Matrix4f::rotate(radianToDegree(pry[1]), Vector3f(0, 0, -1))
* Matrix4f::rotate(radianToDegree(pry[0]), Vector3f(1, 0, 0))
* Matrix4f::rotate(radianToDegree(pry[2]), Vector3f(0, 1, 0))
* Matrix4f::translate(swizzle(vrCfg().oculusRift().headOrientation(),
* Matrix4f::translate(swizzle(vrCfg().oculusRift().headPosition() *
vrCfg().mapUnitsPerMeter(),
AxisNegX, AxisNegY, AxisZ))
* Matrix4f::scale(Vector3f(uiSize, -uiSize / vrCfg().oculusRift().aspect(), 1.f))
* Matrix4f::translate(Vector3f(-.5f, -.5f, uiDistance)));
Expand Down

0 comments on commit 60a4cd2

Please sign in to comment.