Skip to content

Commit

Permalink
PR comments updates
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Mar 17, 2020
1 parent 36a6519 commit 4539cbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/main/cpp/BrowserWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ struct BrowserWorld::State {
std::unordered_map<vrb::Node*, std::pair<Widget*, float>> depthSorting;
std::function<void(device::Eye)> drawHandler;
std::function<void()> frameEndHandler;
bool wasInGazeMode;
bool wasInGazeMode = false;

State() : paused(true), glInitialized(false), modelsLoaded(false), env(nullptr), cylinderDensity(0.0f), nearClip(0.1f),
farClip(300.0f), activity(nullptr), windowsInitialized(false), exitImmersiveRequested(false), loaderDelay(0) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/cpp/ExternalVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<
immersiveController.numButtons = controller.numButtons;
immersiveController.buttonPressed = controller.immersivePressedState;
immersiveController.buttonTouched = controller.immersiveTouchedState;
for (int j = 0; j< controller.numButtons; ++j) {
for (int j = 0; j < controller.numButtons; ++j) {
immersiveController.triggerValue[j] = controller.immersiveTriggerValues[j];
}
immersiveController.numAxes = controller.numAxes;
for (int j = 0; j< controller.numAxes; ++j) {
for (int j = 0; j < controller.numAxes; ++j) {
immersiveController.axisValue[j] = controller.immersiveAxes[j];
}
immersiveController.numHaptics = controller.numHaptics;
Expand Down
13 changes: 5 additions & 8 deletions app/src/picovr/cpp/DeviceDelegatePicoVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ struct DeviceDelegatePicoVR::State {
} else {
controllers[index].hand = ElbowModel::HandEnum::Left;
}
if (index != gazeIndex) {
controllers[index].is6DoF = true;
}
controllers[index].is6DoF = true;
}

elbow = ElbowModel::Create();
Expand Down Expand Up @@ -406,15 +404,14 @@ DeviceDelegatePicoVR::StartFrame() {
// Update te gaze mode state based on controllers availability
m.isInGazeMode = true;
for (int32_t i = 0; i < m.controllers.size(); ++i) {
if (i != m.gazeIndex) {
m.isInGazeMode &= !m.controllers[i].enabled;
if (i != m.gazeIndex && m.controllers[i].enabled) {
m.isInGazeMode = false;
break;
}
}

if (m.isInGazeMode) {
for (int i=0; i<m.controllers.size(); i++) {
m.controllers[i].enabled = (i == m.gazeIndex);
}
m.controllers[m.gazeIndex].enabled = m.isInGazeMode;
m.controllers[m.gazeIndex].transform = GetHeadTransform();
}

Expand Down

0 comments on commit 4539cbf

Please sign in to comment.