RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Freespace.h
1
19#ifndef VRPN_FREESPACE_H
20#define VRPN_FREESPACE_H
21
22#include "vrpn_Configure.h" // IWYU pragma: keep
23
24#ifdef VRPN_USE_FREESPACE
25
26#include <freespace/freespace.h>
27
28#include "vrpn_Button.h"
29#include "vrpn_Dial.h"
30#include "vrpn_Tracker.h"
31
32
33class VRPN_API vrpn_Freespace :
34 public vrpn_Tracker_Server, // for the positional data
35 public vrpn_Button_Filter, // for the actual buttons
36 public vrpn_Dial // for the scroll wheel
37{
38public:
47 // Freespace devices may report User frames (position and orientation in a quaternion),
48 // Body frames (angular velocity and linear acceleration), Mouse reports (delta X, delta Y)
49 // or some combination of them. You will probably want at least body or user frame
50 // messages.
51 // Another thing to note is that for some devices, enabling multiple reports diminishes
52 // the effective rate of data since the device can only send so many bits per second.
53 // This could fairly easily get added as a configuration setting.
54
55 static vrpn_Freespace* create(const char *name,
56 vrpn_Connection *conn,
57 int device_index = 0,
58 bool send_body_frames = false,
59 bool send_user_frames = true);
60 virtual ~vrpn_Freespace(void);
66 virtual void mainloop(void);
67
68private:
69 static bool _freespace_initialized;
70 static void freespaceInit();
74 vrpn_Freespace(FreespaceDeviceId freespaceId,
75 struct FreespaceDeviceInfo* deviceInfo,
76 const char *name,
78
79 void handleUserFrame(const struct freespace_UserFrame&);
80 void handleBodyFrame(const struct freespace_BodyFrame&);
81 void handleLinkStatus(const struct freespace_LinkStatus&);
82
83 void deviceSetConfiguration(bool send_body_frames, bool send_user_frames);
84 void deviceConfigure();
85 void deviceUnconfigure();
86
87 bool _sendBodyFrames;
88 bool _sendUserFrames;
89 struct timeval _timestamp;
90
91protected:
92 FreespaceDeviceId _freespaceDevice;
93 FreespaceDeviceInfo _deviceInfo;
94 vrpn_float64 _lastBodyFrameTime;
95};
96#endif //VRPN_USE_FREESPACE
97
98#endif // VRPN_FREESPACE_H
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Dial.h:21
定义 vrpn_Tracker.h:273
virtual void mainloop()
This function should be called each time through app mainloop.