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

Simplfy Pico no-controller code #3152

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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