with vive head-puck, isHeadController is true, even when HMD isn't mounted

This commit is contained in:
Seth Alves 2017-06-01 16:37:04 -07:00
parent 48ee546545
commit 27664756de
2 changed files with 4 additions and 0 deletions

View file

@ -165,6 +165,9 @@ void ViveControllerManager::deactivate() {
}
bool ViveControllerManager::isHeadController() const {
if (_inputDevice && _inputDevice->isHeadController()) {
return true;
}
vr::EDeviceActivityLevel activityLevel = _system->GetTrackedDeviceActivityLevel(vr::k_unTrackedDeviceIndex_Hmd);
return activityLevel == vr::k_EDeviceActivityLevel_UserInteraction;
}

View file

@ -55,6 +55,7 @@ private:
class InputDevice : public controller::InputDevice {
public:
InputDevice(vr::IVRSystem*& system);
bool isHeadController() const { return _overrideHead; }
private:
// Device functions
controller::Input::NamedVector getAvailableInputs() const override;