History

Working on reprojection

Brad Davis committed 10 years ago

Commit 7e937471 parent 66cc91330 files · +868 −260Browse files

Showing the changes to plugins/openvr/src/ViveControllerManager.cpp (1 of 30 files). Show all

Unified · Split

plugins/openvr/src/ViveControllerManager.cpp+7−9
@@ -29,10 +29,7 @@ · 28 unmodified lines
29 29
30#include "OpenVrHelpers.h"30#include "OpenVrHelpers.h"
31 31
32extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount];32extern PoseData _nextSimPoseData;
33extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount];
34extern vec3 _trackedDeviceLinearVelocities[vr::k_unMaxTrackedDeviceCount];
35extern vec3 _trackedDeviceAngularVelocities[vr::k_unMaxTrackedDeviceCount];
36 33
37vr::IVRSystem* acquireOpenVrSystem();34vr::IVRSystem* acquireOpenVrSystem();
38void releaseOpenVrSystem();35void releaseOpenVrSystem();
@@ -48,6 +45,7 @@ static const QString RENDER_CONTROLLERS = "Render Hand Controllers"; · 9 unmodified lines
48const QString ViveControllerManager::NAME = "OpenVR";45const QString ViveControllerManager::NAME = "OpenVR";
49 46
50bool ViveControllerManager::isSupported() const {47bool 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 pose282 // 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