So I am trying to implement teleportation in my VR application (not in Unity). I am able to get the pose matrices for each controller from
if (auto error = vr::VRInput()->GetPoseActionDataForNextFrame(hand[eHand].pose_handle, vr::TrackingUniverseStanding, &poseData, sizeof(poseData), vr::k_ulInvalidInputValueHandle) != vr::VRInputError_None
|| !poseData.bActive || !poseData.pose.bPoseIsValid)
{
std::cerr << "pose invalid " << error << std::endl;
}
else
{
hand[eHand].pose = ConvertSteamVRMatrixToMatrix4(poseData.pose.mDeviceToAbsoluteTracking);
}
I then use glm::decompose() to get the position and orientation (orientation must be conjugated). Then I try to get the forward direction from it by multiplying the orientation matrix by vec4(0,0,1,0) but the resultant vector is incorrect. Is there a flaw in my logic?