RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_zSight.h
1
2//
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 <Winsvc.h>
31#include <atlbase.h>
32#include <dinput.h>
33#include <windows.h>
34
35class vrpn_Tracker_zSight : public vrpn_Tracker {
36public:
37 // Constructor
38 //
39 // name: VRPN tracker name
40 //
41 // c: VRPN connection to use
42 //
43 vrpn_Tracker_zSight(const char* name, vrpn_Connection* c);
44 ~vrpn_Tracker_zSight();
45
49 virtual void mainloop();
50
51protected:
52 // VRPN tracker functions for generating and sending reports
53 virtual void get_report();
54 virtual void send_report();
55
56 // Initialize the device
57 HRESULT InitDevice();
58
59 // Callbacks for Direct Input
60 static BOOL CALLBACK EnumSensicsCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* selfPtr);
61 static BOOL CALLBACK EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* selfPtr);
62
63 // Handle to the console window
64 HWND hWnd;
65
66 // The Direct Input and device handles
67 CComPtr<IDirectInput8> directInput;
68 CComPtr<IDirectInputDevice8> sensics;
69};
70
71
72#endif
73#endif
virtual void mainloop()=0
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Tracker.h:49