From 4c2b729047f210264f8e2b39eecbdf1ea25d9738 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 10 May 2013 15:27:02 -0700 Subject: [PATCH] assume that oculus will only be from APPLE machines --- cmake/modules/FindLibOVR.cmake | 2 -- interface/CMakeLists.txt | 2 +- interface/src/OculusManager.cpp | 4 ++++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 02af69fd43..cad962732c 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -20,8 +20,6 @@ else (LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIRS) if (APPLE) set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/MacOS/libovr.a) - else (UNIX) - set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/x64/libovr64.lib) else (WIN32) set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/Win32/libovr.lib) endif () diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 2b2fedda4a..156e5d8a7c 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -87,7 +87,6 @@ include_directories( ) target_link_libraries(${TARGET_NAME} ${QT_LIBRARIES}) -target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARY}) if (APPLE) # link in required OS X frameworks and include the right GL headers @@ -110,6 +109,7 @@ if (APPLE) ${GLUT} ${OpenGL} ${IOKit} + ${LIBOVR_LIBRARY} ) else (APPLE) find_package(OpenGL REQUIRED) diff --git a/interface/src/OculusManager.cpp b/interface/src/OculusManager.cpp index 1d9db72d8b..8bd2ff4e42 100644 --- a/interface/src/OculusManager.cpp +++ b/interface/src/OculusManager.cpp @@ -16,6 +16,7 @@ Ptr OculusManager::_sensorDevice; SensorFusion OculusManager::_sensorFusion; void OculusManager::connect() { +#ifdef __APPLE__ System::Init(); _deviceManager = *DeviceManager::Create(); _hmdDevice = *_deviceManager->EnumerateDevices().CreateDevice(); @@ -29,14 +30,17 @@ void OculusManager::connect() { // default the yaw to the current orientation _sensorFusion.SetMagReference(); } +#endif } void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { +#ifdef __APPLE__ _sensorFusion.GetOrientation().GetEulerAngles(&yaw, &pitch, &roll); // convert each angle to degrees yaw = glm::degrees(yaw); pitch = glm::degrees(pitch); roll = glm::degrees(roll); +#endif }