Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Commit

Permalink
Fix handedness.
Browse files Browse the repository at this point in the history
  • Loading branch information
polygraphene committed May 24, 2019
1 parent ecd1e6c commit 6e603bf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions alvr_server/RecenterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,15 @@ class RecenterManager
auto data = m_freePIE->GetData();
bool enableControllerButton = data.flags & FreePIE::ALVR_FREEPIE_FLAG_OVERRIDE_BUTTONS;
m_controllerDetected = data.controllers;
bool defaultHand = (info.controller[0].flags & TrackingInfo::Controller::FLAG_CONTROLLER_LEFTHAND) != 0;

// Add controller as specified.
for (int i = 0; i < m_controllerDetected; i++) {
if (m_remoteController[i]) {
// Already enabled.
continue;
}
// false: right hand, true: left hand
bool handed = (info.controller[i].flags & TrackingInfo::Controller::FLAG_CONTROLLER_LEFTHAND) != 0;
if (i == 1) {
handed = !handed;
}
bool handed = i == 0 ? defaultHand : !defaultHand;
m_remoteController[i] = std::make_shared<RemoteControllerServerDriver>(handed, i);

bool ret = vr::VRServerDriverHost()->TrackedDeviceAdded(
Expand Down

0 comments on commit 6e603bf

Please sign in to comment.