Skip to content

Commit

Permalink
Publishing the gaze direction insead of the position
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Nov 15, 2024
1 parent 3099908 commit 01bd69c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/devices/openxrheadset/ExpressionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ void ExpressionsManager::setGaze(const OpenXrInterface::Pose& headPose, const Op
return;
}

Eigen::Vector3f gazeInHead = headPose.rotation.inverse() * (gaze.position - headPose.position);
Eigen::Vector3f gazeDirectionInHead = headPose.rotation.inverse() * gaze.rotation * Eigen::Vector3f::UnitZ();

yarp::sig::Vector& gazeVector = m_gazePort.prepare();
gazeVector.resize(3);
gazeVector[0] = gazeInHead.x();
gazeVector[1] = gazeInHead.y();
gazeVector[2] = gazeInHead.z();
gazeVector[0] = gazeDirectionInHead.x();
gazeVector[1] = gazeDirectionInHead.y();
gazeVector[2] = gazeDirectionInHead.z();
m_gazePort.write();
}

Expand Down

0 comments on commit 01bd69c

Please sign in to comment.