Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Simplfy Pico no-controller code (#3152)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin authored Apr 14, 2020
1 parent 207f86b commit fbf03db
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions app/src/picovr/cpp/DeviceDelegatePicoVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,13 @@ struct DeviceDelegatePicoVR::State {
}

vrb::Matrix transform = controller.transform;
if (renderMode == device::RenderMode::StandAlone) {
if (isInGazeMode) {
if (i == gazeIndex) {
vrb::Matrix head = vrb::Matrix::Rotation(orientation);
head.PreMultiplyInPlace(vrb::Matrix::Position(headOffset));
controller.transform = head;
transform = controller.transform;
}
if ((renderMode == device::RenderMode::StandAlone) && (i != gazeIndex)) {
if (type == k6DofHeadSet) {
transform.TranslateInPlace(headOffset);
} else {
if (type == k6DofHeadSet) {
transform.TranslateInPlace(headOffset);
} else {
vrb::Matrix head = vrb::Matrix::Rotation(orientation);
head.PreMultiplyInPlace(vrb::Matrix::Position(headOffset));
transform = elbow->GetTransform(controller.hand, head, transform);
}
vrb::Matrix head = vrb::Matrix::Rotation(orientation);
head.PreMultiplyInPlace(vrb::Matrix::Position(headOffset));
transform = elbow->GetTransform(controller.hand, head, transform);
}
}

Expand Down Expand Up @@ -421,7 +412,7 @@ DeviceDelegatePicoVR::StartFrame(const FramePrediction aPrediction) {

if (m.isInGazeMode) {
m.controllers[m.gazeIndex].enabled = m.isInGazeMode;
m.controllers[m.gazeIndex].transform = GetHeadTransform();
m.controllers[m.gazeIndex].transform = head;
}

m.UpdateControllers();
Expand Down

0 comments on commit fbf03db

Please sign in to comment.