vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Tracker_zSight.h
Go to the documentation of this file.
1 //
3 // Name: vrpn_Tracker_zSight.h
4 //
5 // Authors: David Borland
6 // Josep Maria Tomas Sanahuja
7 //
8 // EventLab at the University of Barcelona
9 //
10 // Description: VRPN tracker class for Sensics zSight HMD with built-in tracker. The tracker
11 // reports only orientation information, no position. It is interfaced to as
12 // a DirectX joystick, so VRPN_USE_DIRECTINPUT must be defined in
13 // vrpn_Configure.h to use it.
14 //
16 
17 #ifndef VRPN_TRACKER_ZSIGHT
18 #define VRPN_TRACKER_ZSIGHT
19 
20 // Make sure Direct Input is being used and atlbase is available for CComPtr.
21 #include "vrpn_Configure.h" // IWYU pragma: keep
22 
23 #if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) && defined(VRPN_HAVE_ATLBASE)
24 
25 #include "vrpn_Tracker.h"
26 
27 #ifndef DIRECTINPUT_VERSION
28 #define DIRECTINPUT_VERSION 0x0800
29 #endif
30 #include <atlbase.h>
31 #include <dinput.h>
32 #include <windows.h>
33 
34 class vrpn_Tracker_zSight : public vrpn_Tracker {
35 public:
36  // Constructor
37  //
38  // name: VRPN tracker name
39  //
40  // c: VRPN connection to use
41  //
42  vrpn_Tracker_zSight(const char* name, vrpn_Connection* c);
43  ~vrpn_Tracker_zSight();
44 
48  virtual void mainloop();
49 
50 protected:
51  // VRPN tracker functions for generating and sending reports
52  virtual void get_report();
53  virtual void send_report();
54 
55  // Initialize the device
56  HRESULT InitDevice();
57 
58  // Callbacks for Direct Input
59  static BOOL CALLBACK EnumSensicsCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* selfPtr);
60  static BOOL CALLBACK EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* selfPtr);
61 
62  // Handle to the console window
63  HWND hWnd;
64 
65  // The Direct Input and device handles
66  CComPtr<IDirectInput8> directInput;
67  CComPtr<IDirectInputDevice8> sensics;
68 };
69 
70 
71 #endif
72 #endif
vrpn_Tracker.h
vrpn_Tracker
Definition: vrpn_Tracker.h:49
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
vrpn_Configure.h