mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Merge pull request #11886 from druiz17/fix-vive-head-pose
Register the Vive inputDevice if no controllers are available
This commit is contained in:
commit
ce68b720c2
1 changed files with 5 additions and 5 deletions
|
@ -337,6 +337,7 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle
|
|||
_poseStateMap.clear();
|
||||
_buttonPressedMap.clear();
|
||||
_validTrackedObjects.clear();
|
||||
_trackedControllers = 0;
|
||||
|
||||
// While the keyboard is open, we defer strictly to the keyboard values
|
||||
if (isOpenVrKeyboardShown()) {
|
||||
|
@ -369,14 +370,12 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle
|
|||
}
|
||||
}
|
||||
|
||||
int numTrackedControllers = 0;
|
||||
if (leftHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) {
|
||||
numTrackedControllers++;
|
||||
_trackedControllers++;
|
||||
}
|
||||
if (rightHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) {
|
||||
numTrackedControllers++;
|
||||
_trackedControllers++;
|
||||
}
|
||||
_trackedControllers = numTrackedControllers;
|
||||
|
||||
calibrateFromHandController(inputCalibrationData);
|
||||
calibrateFromUI(inputCalibrationData);
|
||||
|
@ -527,6 +526,7 @@ void ViveControllerManager::InputDevice::handleTrackedObject(uint32_t deviceInde
|
|||
|
||||
// but _validTrackedObjects remain in sensor frame
|
||||
_validTrackedObjects.push_back(std::make_pair(poseIndex, pose));
|
||||
_trackedControllers++;
|
||||
} else {
|
||||
controller::Pose invalidPose;
|
||||
_poseStateMap[poseIndex] = invalidPose;
|
||||
|
@ -758,9 +758,9 @@ void ViveControllerManager::InputDevice::handleHmd(uint32_t deviceIndex, const c
|
|||
} else {
|
||||
const mat4& mat = mat4();
|
||||
const vec3 zero = vec3();
|
||||
|
||||
handleHeadPoseEvent(inputCalibrationData, mat, zero, zero);
|
||||
}
|
||||
_trackedControllers++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue