00001
00008
00009 #ifdef USE_TRACKD
00010
00011 #ifndef TRACKDCLIENT_H
00012 #define TRACKDCLIENT_H
00013
00014 #include <G3D/G3DAll.h>
00015 #include "InputDevice.H"
00016
00017 namespace VRG3D {
00020 class TrackDClient : public InputDevice
00021 {
00022 public:
00023
00024 TrackDClient(
00025 int trackerShMemKey,
00026 int wandShMemKey,
00027 const Array<std::string> &trackerEventsToGenerate,
00028 const double &trackerUnitsToRoomUnitsScale,
00029 const CoordinateFrame &deviceToRoom,
00030 const Array<CoordinateFrame> &propToTracker,
00031 const Array<CoordinateFrame> &finalOffset,
00032 const Array<std::string> &buttonEventsToGenerate,
00033 const Array<std::string> &valuatorEventsToGenerate
00034 );
00035
00036 virtual ~TrackDClient();
00037
00038 std::string getTrackerName(int trackerNumber);
00039 std::string getButtonName(int buttonNumber);
00040 std::string getValuatorName(int valuatorNumber);
00041
00042 void pollForInput(Array<EventRef> &events);
00043
00044 private:
00045 Array<std::string> _tEventNames;
00046 double _trackerUnitsToRoomUnitsScale;
00047 CoordinateFrame _deviceToRoom;
00048 Array<CoordinateFrame> _propToTracker;
00049 Array<CoordinateFrame> _finalOffset;
00050
00051 Array<std::string> _bEventNames;
00052 Array<int> _buttonStates;
00053
00054 Array<std::string> _vEventNames;
00055 Array<double> _valuatorStates;
00056
00057 void *_trackerMemory;
00058 void *_wandMemory;
00059 int _numSensors;
00060 int _numButtons;
00061 int _numValuators;
00062 };
00063
00064 }
00065
00066 #endif
00067
00068
00069 #endif // USE_TRACKD
00070