Skip to content

Commit

Permalink
VR|UI: Adjusting size of the Oculus Rift composited UI
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 21, 2014
1 parent b705a38 commit 9b89dcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -637,8 +637,8 @@ DENG2_PIMPL(ClientWindow)

if(vrCfg().mode() == VRConfig::OculusRift)
{
float uiDistance = 50;
float uiSize = 75;
float uiDistance = 45;
float uiSize = 67.5f;

Vector3f const pry = vrCfg().oculusRift().headOrientation();

Expand All @@ -651,7 +651,7 @@ DENG2_PIMPL(ClientWindow)
* Matrix4f::translate(swizzle(vrCfg().oculusRift().headPosition() *
vrCfg().mapUnitsPerMeter(),
AxisNegX, AxisNegY, AxisZ))
* Matrix4f::scale(Vector3f(uiSize, -uiSize / vrCfg().oculusRift().aspect(), 1.f))
* Matrix4f::scale(Vector3f(uiSize, -uiSize, 1.f))
* Matrix4f::translate(Vector3f(-.5f, -.5f, uiDistance)));
}
else
Expand Down
4 changes: 3 additions & 1 deletion doomsday/libappfw/src/vrwindowtransform.cpp
Expand Up @@ -21,6 +21,7 @@
#include "de/VRConfig"
#include "de/BaseGuiApp"
#include "de/BaseWindow"
#include "de/GuiWidget"

#include <de/Drawable>
#include <de/GLFramebuffer>
Expand Down Expand Up @@ -301,7 +302,8 @@ Vector2ui VRWindowTransform::logicalRootSize(Vector2ui const &physicalCanvasSize
case VRConfig::OculusRift:
// Adjust effective UI size for stereoscopic rendering.
size.x = size.y * d->vrCfg.oculusRift().aspect();
size *= 1.0f; // Use a large font in taskbar
//size.y *= d->vrCfg.oculusRift().aspect();
size *= GuiWidget::toDevicePixels(1) * .75f;
break;

// Allow UI to squish in top/bottom and SBS mode: 3D hardware will unsquish them
Expand Down

0 comments on commit 9b89dcd

Please sign in to comment.