review vr stuff, fix controller-ui ray casting

This commit is contained in:
2019-06-05 16:27:29 +02:00
parent 02b92cf382
commit dc9da77cf8
10 changed files with 96 additions and 47 deletions

View File

@@ -22,7 +22,7 @@ struct QuestController : public VRController
void update_state(double predictedDisplayTime, glm::vec3 head_pos)
{
vrapi_GetInputTrackingState(ovr_context, id, predictedDisplayTime, &tracking);
glm::vec3 c_pos = glm::make_vec3((float*)&tracking.HeadPose.Pose.Position) - head_pos;
glm::vec3 c_pos = glm::make_vec3((float*)&tracking.HeadPose.Pose.Position);
auto c_rot_ovr = ovrMatrix4f_CreateFromQuaternion(&tracking.HeadPose.Pose.Orientation);
auto c_rot_ovr_tp = ovrMatrix4f_Transpose(&c_rot_ovr);
glm::mat4 c_rot = glm::make_mat4((float*)&c_rot_ovr_tp);