Showing the changes to libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp (1 of 8 files). Show all
Unified · Split
| @@ -17,14 +17,16 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <gpu/Batch.h> |
| 18 | 18 | #include <gpu/Context.h> |
| 19 | 19 | #include <DeferredLightingEffect.h> |
| 20 | −#include <display-plugins\openvr\OpenVrHelpers.h> | |
| 20 | +#include <display-plugins/openvr/OpenVrHelpers.h> | |
| 21 | 21 | #include "NumericalConstants.h" |
| 22 | 22 | #include "UserActivityLogger.h" |
| 23 | 23 | |
| 24 | +#ifndef Q_OS_MAC | |
| 24 | 25 | extern vr::IVRSystem* _hmd; |
| 25 | 26 | extern int hmdRefCount; |
| 26 | 27 | extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount]; |
| 27 | 28 | extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount]; |
| 29 | +#endif | |
| 28 | 30 | |
| 29 | 31 | const unsigned int LEFT_MASK = 0U; |
| 30 | 32 | const unsigned int RIGHT_MASK = 1U; |
| @@ -55,10 +57,15 @@ ViveControllerManager::ViveControllerManager() : · 24 unmodified lines | ||
| 55 | 57 | } |
| 56 | 58 | |
| 57 | 59 | bool ViveControllerManager::isSupported() const { |
| 60 | +#ifndef Q_OS_MAC | |
| 58 | 61 | return vr::VR_IsHmdPresent(); |
| 62 | +#else | |
| 63 | + return false; | |
| 64 | +#endif | |
| 59 | 65 | } |
| 60 | 66 | |
| 61 | 67 | void ViveControllerManager::activate(PluginContainer* container) { |
| 68 | +#ifndef Q_OS_MAC | |
| 62 | 69 | hmdRefCount++; |
| 63 | 70 | if (!_hmd) { |
| 64 | 71 | vr::HmdError eError = vr::HmdError_None; |
| @@ -112,9 +119,11 @@ void ViveControllerManager::activate(PluginContainer* container) { · 47 unmodified lines | ||
| 112 | 119 | |
| 113 | 120 | _modelLoaded = true; |
| 114 | 121 | } |
| 122 | +#endif | |
| 115 | 123 | } |
| 116 | 124 | |
| 117 | 125 | void ViveControllerManager::deactivate() { |
| 126 | +#ifndef Q_OS_MAC | |
| 118 | 127 | hmdRefCount--; |
| 119 | 128 | |
| 120 | 129 | if (hmdRefCount == 0 && _hmd) { |
| @@ -122,6 +131,7 @@ void ViveControllerManager::deactivate() { · 1 unmodified line | ||
| 122 | 131 | _hmd = nullptr; |
| 123 | 132 | } |
| 124 | 133 | _poseStateMap.clear(); |
| 134 | +#endif | |
| 125 | 135 | } |
| 126 | 136 | |
| 127 | 137 | void ViveControllerManager::updateRendering(RenderArgs* args, render::ScenePointer scene, render::PendingChanges pendingChanges) { |
| @@ -187,12 +197,14 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat · 59 unmodified lines | ||
| 187 | 197 | } |
| 188 | 198 | |
| 189 | 199 | void ViveControllerManager::update(float deltaTime, bool jointsCaptured) { |
| 200 | +#ifndef Q_OS_MAC | |
| 190 | 201 | _poseStateMap.clear(); |
| 191 | 202 | // TODO: This shouldn't be necessary |
| 192 | 203 | if (!_hmd) { |
| 193 | 204 | return; |
| 194 | 205 | } |
| 195 | − | |
| 206 | + return; | |
| 207 | + | |
| 196 | 208 | _buttonPressedMap.clear(); |
| 197 | 209 | |
| 198 | 210 | PerformanceTimer perfTimer("ViveControllerManager::update"); |
| @@ -252,6 +264,7 @@ void ViveControllerManager::update(float deltaTime, bool jointsCaptured) { · 53 unmodified lines | ||
| 252 | 264 | } |
| 253 | 265 | |
| 254 | 266 | _trackedControllers = numTrackedControllers; |
| 267 | +#endif | |
| 255 | 268 | } |
| 256 | 269 | |
| 257 | 270 | void ViveControllerManager::focusOutEvent() { |