From fb4c1d38eb48ee41cab9f5976a93f57b6849a582 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 4 Nov 2014 19:04:31 -0800 Subject: [PATCH] Set Oculus camera fov/aspect ratio. --- interface/src/devices/OculusManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index 23cd52d946..7e43de9dda 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -126,6 +126,7 @@ void OculusManager::connect() { if (!_camera) { _camera = new Camera; + configureCamera(*_camera, 0, 0); // no need to use screen dimensions; they're ignored } if (!_programInitialized) { @@ -420,7 +421,7 @@ void OculusManager::endFrameTiming() { //Sets the camera FoV and aspect ratio void OculusManager::configureCamera(Camera& camera, int screenWidth, int screenHeight) { #ifdef HAVE_LIBOVR - camera.setAspectRatio((float)_renderTargetSize.w / _renderTargetSize.h); + camera.setAspectRatio(_renderTargetSize.w * 0.5f / _renderTargetSize.h); camera.setFieldOfView(atan(_eyeFov[0].UpTan) * DEGREES_PER_RADIAN * 2.0f); #endif }