vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_Freespace.h
Go to the documentation of this file.
1
18
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
33
class
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
{
38
public
:
46
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
68
private
:
69
static
bool
_freespace_initialized;
70
static
void
freespaceInit();
74
vrpn_Freespace(FreespaceDeviceId freespaceId,
75
struct
FreespaceDeviceInfo* deviceInfo,
76
const
char
*name,
77
vrpn_Connection
*c);
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
91
protected
:
92
FreespaceDeviceId
_freespaceDevice
;
93
FreespaceDeviceInfo
_deviceInfo
;
94
vrpn_float64
_lastBodyFrameTime
;
95
};
96
#endif
//VRPN_USE_FREESPACE
97
98
#endif
// VRPN_FREESPACE_H
vrpn_Button_Filter::vrpn_Button_Filter
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Definition
vrpn_Button.C:129
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition
vrpn_Connection.h:561
vrpn_Dial::vrpn_Dial
vrpn_Dial(const char *name, vrpn_Connection *c=NULL)
Definition
vrpn_Dial.C:8
vrpn_Freespace::create
static vrpn_Freespace * create(const char *name, vrpn_Connection *conn, int device_index=0, bool send_body_frames=false, bool send_user_frames=true)
Create a freespace server using the given FreespaceDeviceId.
Definition
vrpn_Freespace.C:124
vrpn_Freespace::_freespaceDevice
FreespaceDeviceId _freespaceDevice
Definition
vrpn_Freespace.h:92
vrpn_Freespace::_deviceInfo
FreespaceDeviceInfo _deviceInfo
Definition
vrpn_Freespace.h:93
vrpn_Freespace::_lastBodyFrameTime
vrpn_float64 _lastBodyFrameTime
Definition
vrpn_Freespace.h:94
vrpn_Tracker_Server::mainloop
virtual void mainloop()
This function should be called each time through app mainloop.
Definition
vrpn_Tracker.C:841
vrpn_Tracker_Server::vrpn_Tracker_Server
vrpn_Tracker_Server(const char *name, vrpn_Connection *c, vrpn_int32 sensors=1)
Definition
vrpn_Tracker.C:832
vrpn_Button.h
vrpn_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_Dial.h
vrpn_Tracker.h
vrpn_Freespace.h
Generated by
1.17.0