X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fvrinput.cc;h=2a25f537ca09a078f685d4981d20474741020c4a;hp=e488c74d364c144f57c065544391ed6461ed3bd8;hb=c22f7c9b89f295140c523d85829062de21af29a0;hpb=05fbfb6f2570953f8e98d99e58c7c763a0279c21 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; } }