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
2929
3030 #include "OpenVrHelpers.h"
3131
32−extern vr::TrackedDevicePose_t _trackedDevicePose[vr::k_unMaxTrackedDeviceCount];
33−extern mat4 _trackedDevicePoseMat4[vr::k_unMaxTrackedDeviceCount];
34−extern vec3 _trackedDeviceLinearVelocities[vr::k_unMaxTrackedDeviceCount];
35−extern vec3 _trackedDeviceAngularVelocities[vr::k_unMaxTrackedDeviceCount];
32+extern PoseData _nextSimPoseData;
3633
3734 vr::IVRSystem* acquireOpenVrSystem();
3835 void releaseOpenVrSystem();
@@ -48,6 +45,7 @@ static const QString RENDER_CONTROLLERS = "Render Hand Controllers"; · 9 unmodified lines
4845 const QString ViveControllerManager::NAME = "OpenVR";
4946
5047 bool ViveControllerManager::isSupported() const {
48+ return false;
5149 return openVrSupported();
5250 }
5351
@@ -279,12 +277,12 @@ void ViveControllerManager::InputDevice::handleHandController(float deltaTime, u · 225 unmodified lines
279277
280278 if (_system->IsTrackedDeviceConnected(deviceIndex) &&
281279 _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller &&
282− _trackedDevicePose[deviceIndex].bPoseIsValid) {
280+ _nextSimPoseData.vrPoses[deviceIndex].bPoseIsValid) {
283281
284282 // process pose
285− const mat4& mat = _trackedDevicePoseMat4[deviceIndex];
286− const vec3 linearVelocity = _trackedDeviceLinearVelocities[deviceIndex];
287− const vec3 angularVelocity = _trackedDeviceAngularVelocities[deviceIndex];
283+ const mat4& mat = _nextSimPoseData.poses[deviceIndex];
284+ const vec3 linearVelocity = _nextSimPoseData.linearVelocities[deviceIndex];
285+ const vec3 angularVelocity = _nextSimPoseData.angularVelocities[deviceIndex];
288286 handlePoseEvent(deltaTime, inputCalibrationData, mat, linearVelocity, angularVelocity, isLeftHand);
289287
290288 vr::VRControllerState_t controllerState = vr::VRControllerState_t();
@@ -428,7 +426,7 @@ void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool lef · 137 unmodified lines
428426
429427 if (_system->IsTrackedDeviceConnected(deviceIndex) &&
430428 _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller &&
431− _trackedDevicePose[deviceIndex].bPoseIsValid) {
429+ _nextSimPoseData.vrPoses[deviceIndex].bPoseIsValid) {
432430 float strength = leftHand ? _leftHapticStrength : _rightHapticStrength;
433431 float duration = leftHand ? _leftHapticDuration : _rightHapticDuration;
434432