00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #include "Matrix4.h"
00023 #include "P_Tracker.h"
00024 #include "P_FreeVRTracker.h"
00025 #include <freevr.h>
00026 
00027 void FreeVRTracker::update() {
00028   
00029   #define WAND_SENSOR     1
00030 
00031   vrPoint wand_location;
00032   vrPointGetRWFrom6sensor(&wand_location, WAND_SENSOR);
00033   pos[0] = wand_location.v[0];
00034   pos[1] = wand_location.v[1];
00035   pos[2] = wand_location.v[2];
00036 
00037   
00038   vrEuler wand_orientation;
00039   vrEulerGetRWFrom6sensor(&wand_orientation, WAND_SENSOR);
00040 
00041   orient->identity();
00042   orient->rot(wand_orientation.r[0],'x');
00043   orient->rot(wand_orientation.r[1],'y');
00044   orient->rot(wand_orientation.r[2],'z');
00045   orient->rot(90,'y'); 
00046 }
00047 
00048 int FreeVRTracker::do_start(const SensorConfig *config) {
00049   
00050   if (!config->require_freevr_name()) return 0;
00051   if (!config->have_one_sensor()) return 0;
00052   return 1;
00053 }