#include <string.h>
+#include <goatvr.h>
#include "vrinput.h"
#include "scene.h"
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;
}
}