Showing the changes to interface/src/OculusManager.cpp (1 of 3 files). Show all
Unified · Split
| @@ -16,6 +16,7 @@ Ptr<SensorDevice> OculusManager::_sensorDevice; · 15 unmodified lines | |||
| 16 | SensorFusion OculusManager::_sensorFusion; | 16 | SensorFusion OculusManager::_sensorFusion; |
| 17 | 17 | ||
| 18 | void OculusManager::connect() { | 18 | void OculusManager::connect() { |
| 19 | #ifdef __APPLE__ | ||
| 19 | System::Init(); | 20 | System::Init(); |
| 20 | _deviceManager = *DeviceManager::Create(); | 21 | _deviceManager = *DeviceManager::Create(); |
| 21 | _hmdDevice = *_deviceManager->EnumerateDevices<HMDDevice>().CreateDevice(); | 22 | _hmdDevice = *_deviceManager->EnumerateDevices<HMDDevice>().CreateDevice(); |
| @@ -29,14 +30,17 @@ void OculusManager::connect() { · 7 unmodified lines | |||
| 29 | // default the yaw to the current orientation | 30 | // default the yaw to the current orientation |
| 30 | _sensorFusion.SetMagReference(); | 31 | _sensorFusion.SetMagReference(); |
| 31 | } | 32 | } |
| 33 | #endif | ||
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { | 36 | void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { |
| 37 | #ifdef __APPLE__ | ||
| 35 | _sensorFusion.GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CW, Handed_R>(&yaw, &pitch, &roll); | 38 | _sensorFusion.GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CW, Handed_R>(&yaw, &pitch, &roll); |
| 36 | 39 | ||
| 37 | // convert each angle to degrees | 40 | // convert each angle to degrees |
| 38 | yaw = glm::degrees(yaw); | 41 | yaw = glm::degrees(yaw); |
| 39 | pitch = glm::degrees(pitch); | 42 | pitch = glm::degrees(pitch); |
| 40 | roll = glm::degrees(roll); | 43 | roll = glm::degrees(roll); |
| 44 | #endif | ||
| 41 | } | 45 | } |
| 42 | 46 | ||