From c22f7c9b89f295140c523d85829062de21af29a0 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sat, 16 Sep 2017 09:55:24 +0300 Subject: [PATCH] need to untangle the vrhands mess --- src/vrinput.cc | 13 ++++++------- src/vrinput.h | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/vrinput.cc b/src/vrinput.cc index e488c74..2a25f53 100644 --- a/src/vrinput.cc +++ b/src/vrinput.cc @@ -1,4 +1,5 @@ #include +#include #include "vrinput.h" #include "scene.h" @@ -24,15 +25,13 @@ void destroy_vrhands() void update_vrhands() { for(int i=0; i<2; i++) { - if(!(vrhand[i].src = goatvr_get_hand_tracker(i))) { + if(goatvr_hand_active(i)) { + goatvr_hand_position(i, &vrhand[i].pos.x); + goatvr_hand_orientation(i, &vrhand[i].rot.x); + vrhand[i].valid = true; + } else { vrhand[i].valid = false; - continue; } - goatvr_source_position(vrhand[i].src, &vrhand[i].pos.x); - goatvr_source_orientation(vrhand[i].src, &vrhand[i].rot.x); - float *mat = goatvr_source_matrix(vrhand[i].src); - memcpy(vrhand[i].xform[0], mat, 16 * sizeof(float)); - vrhand[i].valid = true; } } diff --git a/src/vrinput.h b/src/vrinput.h index 1ab89a1..48ac1e3 100644 --- a/src/vrinput.h +++ b/src/vrinput.h @@ -9,7 +9,6 @@ struct VRHand { Vec3 pos; Quat rot; Mat4 xform; /* combination of the above */ - goatvr_source *src; }; extern VRHand vrhand[2]; -- 1.7.10.4