Showing the changes to plugins/openvr/src/ViveControllerManager.cpp (1 of 30 files). Show all
Unified · Split
| @@ -29,10 +29,7 @@ · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | #include "OpenVrHelpers.h" | 30 | #include "OpenVrHelpers.h" |
| 31 | 31 | ||
| 32 | extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount]; | 32 | extern PoseData _nextSimPoseData; |
| 33 | extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount]; | ||
| 34 | extern vec3 _trackedDeviceLinearVelocities[vr::k_unMaxTrackedDeviceCount]; | ||
| 35 | extern vec3 _trackedDeviceAngularVelocities[vr::k_unMaxTrackedDeviceCount]; | ||
| 36 | 33 | ||
| 37 | vr::IVRSystem* acquireOpenVrSystem(); | 34 | vr::IVRSystem* acquireOpenVrSystem(); |
| 38 | void releaseOpenVrSystem(); | 35 | void releaseOpenVrSystem(); |
| @@ -48,6 +45,7 @@ static const QString RENDER_CONTROLLERS = "Render Hand Controllers"; · 9 unmodified lines | |||
| 48 | const QString ViveControllerManager::NAME = "OpenVR"; | 45 | const QString ViveControllerManager::NAME = "OpenVR"; |
| 49 | 46 | ||
| 50 | bool ViveControllerManager::isSupported() const { | 47 | bool ViveControllerManager::isSupported() const { |
| 48 | return false; | ||
| 51 | return openVrSupported(); | 49 | return openVrSupported(); |
| 52 | } | 50 | } |
| 53 | 51 | ||
| @@ -279,12 +277,12 @@ void ViveControllerManager::InputDevice::handleHandController(float deltaTime, u · 225 unmodified lines | |||
| 279 | 277 | ||
| 280 | if (_system->IsTrackedDeviceConnected(deviceIndex) && | 278 | if (_system->IsTrackedDeviceConnected(deviceIndex) && |
| 281 | _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && | 279 | _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && |
| 282 | _trackedDevicePose[deviceIndex].bPoseIsValid) { | 280 | _nextSimPoseData.vrPoses[deviceIndex].bPoseIsValid) { |
| 283 | 281 | ||
| 284 | // process pose | 282 | // process pose |
| 285 | const mat4& mat = _trackedDevicePoseMat4[deviceIndex]; | 283 | const mat4& mat = _nextSimPoseData.poses[deviceIndex]; |
| 286 | const vec3 linearVelocity = _trackedDeviceLinearVelocities[deviceIndex]; | 284 | const vec3 linearVelocity = _nextSimPoseData.linearVelocities[deviceIndex]; |
| 287 | const vec3 angularVelocity = _trackedDeviceAngularVelocities[deviceIndex]; | 285 | const vec3 angularVelocity = _nextSimPoseData.angularVelocities[deviceIndex]; |
| 288 | handlePoseEvent(deltaTime, inputCalibrationData, mat, linearVelocity, angularVelocity, isLeftHand); | 286 | handlePoseEvent(deltaTime, inputCalibrationData, mat, linearVelocity, angularVelocity, isLeftHand); |
| 289 | 287 | ||
| 290 | vr::VRControllerState_t controllerState = vr::VRControllerState_t(); | 288 | vr::VRControllerState_t controllerState = vr::VRControllerState_t(); |
| @@ -428,7 +426,7 @@ void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool lef · 137 unmodified lines | |||
| 428 | 426 | ||
| 429 | if (_system->IsTrackedDeviceConnected(deviceIndex) && | 427 | if (_system->IsTrackedDeviceConnected(deviceIndex) && |
| 430 | _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && | 428 | _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && |
| 431 | _trackedDevicePose[deviceIndex].bPoseIsValid) { | 429 | _nextSimPoseData.vrPoses[deviceIndex].bPoseIsValid) { |
| 432 | float strength = leftHand ? _leftHapticStrength : _rightHapticStrength; | 430 | float strength = leftHand ? _leftHapticStrength : _rightHapticStrength; |
| 433 | float duration = leftHand ? _leftHapticDuration : _rightHapticDuration; | 431 | float duration = leftHand ? _leftHapticDuration : _rightHapticDuration; |
| 434 | 432 | ||