assume that oculus will only be from APPLE machines

This commit is contained in:
Stephen Birarda 2013-05-10 15:27:02 -07:00
parent d43510c5bc
commit 4c2b729047
3 changed files with 5 additions and 3 deletions

View file

@ -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 ()

View file

@ -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)

View file

@ -16,6 +16,7 @@ Ptr<SensorDevice> OculusManager::_sensorDevice;
SensorFusion OculusManager::_sensorFusion;
void OculusManager::connect() {
#ifdef __APPLE__
System::Init();
_deviceManager = *DeviceManager::Create();
_hmdDevice = *_deviceManager->EnumerateDevices<HMDDevice>().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<Axis_Y, Axis_X, Axis_Z, Rotate_CW, Handed_R>(&yaw, &pitch, &roll);
// convert each angle to degrees
yaw = glm::degrees(yaw);
pitch = glm::degrees(pitch);
roll = glm::degrees(roll);
#endif
}