vrpn
07.33
Virtual Reality Peripheral Network
|
Go to the documentation of this file.
24 memset(
d_quat, 0, 4 *
sizeof(
float));
50 vrpn_uint8 * bufptr = buffer + 6;
52 for (
int i = 0; i < 4; i++) {
53 d_quat[i] = (vrpn_unbuffer_from_little_endian<vrpn_uint16>(bufptr) - 32768) / 32768.0;
67 memset(
pos, 0,
sizeof(vrpn_float64) * 3);
72 fprintf(stderr,
"SpacePoint tracker: can't write message: tossing\n");
virtual bool connected() const
Returns true iff the last device I/O succeeded.
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
virtual bool reconnect()
Tries to reconnect to an acceptable device. Call this if you suspect a hotplug event has occurred.
virtual int encode_to(char *buf)
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
struct timeval _timestamp
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
vrpn_Connection * d_connection
Connection that this object talks to.
const unsigned SPACEPOINT_VENDOR
Accepts any device with the given vendor and product IDs.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
Generic connection class not specific to the transport mechanism.
#define vrpn_gettimeofday
const unsigned SPACEPOINT_PRODUCT
virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback.
vrpn_Tracker_SpacePoint(const char *name, vrpn_Connection *trackercon)
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...