mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #287 from birarda/master
conditionals in OculusManager for APPLE
This commit is contained in:
commit
fd8e37ef21
3 changed files with 5 additions and 3 deletions
|
@ -20,8 +20,6 @@ else (LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIRS)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/MacOS/libovr.a)
|
set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/MacOS/libovr.a)
|
||||||
else (UNIX)
|
|
||||||
set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/x64/libovr64.lib)
|
|
||||||
else (WIN32)
|
else (WIN32)
|
||||||
set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/Win32/libovr.lib)
|
set(LIBOVR_LIBRARY ${LIBOVR_ROOT_DIR}/Lib/Win32/libovr.lib)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -87,7 +87,6 @@ include_directories(
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} ${QT_LIBRARIES})
|
target_link_libraries(${TARGET_NAME} ${QT_LIBRARIES})
|
||||||
target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARY})
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# link in required OS X frameworks and include the right GL headers
|
# link in required OS X frameworks and include the right GL headers
|
||||||
|
@ -110,6 +109,7 @@ if (APPLE)
|
||||||
${GLUT}
|
${GLUT}
|
||||||
${OpenGL}
|
${OpenGL}
|
||||||
${IOKit}
|
${IOKit}
|
||||||
|
${LIBOVR_LIBRARY}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
|
@ -16,6 +16,7 @@ Ptr<SensorDevice> OculusManager::_sensorDevice;
|
||||||
SensorFusion OculusManager::_sensorFusion;
|
SensorFusion OculusManager::_sensorFusion;
|
||||||
|
|
||||||
void OculusManager::connect() {
|
void OculusManager::connect() {
|
||||||
|
#ifdef __APPLE__
|
||||||
System::Init();
|
System::Init();
|
||||||
_deviceManager = *DeviceManager::Create();
|
_deviceManager = *DeviceManager::Create();
|
||||||
_hmdDevice = *_deviceManager->EnumerateDevices<HMDDevice>().CreateDevice();
|
_hmdDevice = *_deviceManager->EnumerateDevices<HMDDevice>().CreateDevice();
|
||||||
|
@ -29,14 +30,17 @@ void OculusManager::connect() {
|
||||||
// default the yaw to the current orientation
|
// default the yaw to the current orientation
|
||||||
_sensorFusion.SetMagReference();
|
_sensorFusion.SetMagReference();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) {
|
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);
|
_sensorFusion.GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CW, Handed_R>(&yaw, &pitch, &roll);
|
||||||
|
|
||||||
// convert each angle to degrees
|
// convert each angle to degrees
|
||||||
yaw = glm::degrees(yaw);
|
yaw = glm::degrees(yaw);
|
||||||
pitch = glm::degrees(pitch);
|
pitch = glm::degrees(pitch);
|
||||||
roll = glm::degrees(roll);
|
roll = glm::degrees(roll);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue