X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fvrinput.cc;fp=src%2Fvrinput.cc;h=e488c74d364c144f57c065544391ed6461ed3bd8;hp=0000000000000000000000000000000000000000;hb=b6285d483c8b55a52b6965271a3d3163b2e2f8fa;hpb=cd4537c88b30339a84435574ae0ce06e343f2bb9 diff --git a/src/vrinput.cc b/src/vrinput.cc new file mode 100644 index 0000000..e488c74 --- /dev/null +++ b/src/vrinput.cc @@ -0,0 +1,41 @@ +#include +#include "vrinput.h" +#include "scene.h" + +VRHand vrhand[2]; + +static Scene *scn; + +bool init_vrhands() +{ + scn = new Scene; + if(!(scn->load("data/vrhands.obj"))) { + return false; + } + return true; +} + +void destroy_vrhands() +{ + delete scn; + scn = 0; +} + +void update_vrhands() +{ + for(int i=0; i<2; i++) { + if(!(vrhand[i].src = goatvr_get_hand_tracker(i))) { + 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; + } +} + +void draw_vrhands() +{ +}