RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_NovintFalcon.h
1// -*- c++ -*-
2// This file provides an interface to a Novint Falcon.
3// http://home.novint.com/products/novint_falcon.php
4// It uses libnifalcon to communicate with the device.
5// http://libnifalcon.nonpolynomial.org/
6//
7// file: vrpn_Tracker_NovintFalcon.h
8// author: Axel Kohlmeyer akohlmey@gmail.com 2010-04-14
9// copyright: (C) 2010 Axel Kohlmeyer
10// license: Released to the Public Domain.
11// depends: libnifalcon-1.0.1, libusb-1.0, VRPN 07_26
12// tested on: Linux x86_64 w/ gcc 4.4.1
13
14#ifndef __TRACKER_NOVINTFALCON_H
15#define __TRACKER_NOVINTFALCON_H
16
17#include "vrpn_Configure.h" // IWYU pragma: keep
18
19#if defined(VRPN_USE_LIBNIFALCON)
20
21#include "vrpn_Tracker.h"
22#include "vrpn_Button.h"
23#include "vrpn_ForceDevice.h"
24
25// Forward declaration for proxy class that wraps
26// the device management of the falcon.
27class vrpn_NovintFalcon_Device;
28
29// Forward declaration for proxy class that maintains
30// the list of objects that contribute to the force.
31class vrpn_NovintFalcon_ForceObjects;
32
33class VRPN_API vrpn_Tracker_NovintFalcon
34 : public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_ForceDevice {
35
36public:
37 /// custom constructor
38 vrpn_Tracker_NovintFalcon(const char *name,
39 vrpn_Connection *c = NULL,
40 const int devidx = 0,
41 const char *grip = NULL,
42 const char *kine = NULL,
43 const char *damp = NULL);
44
45 /// destructor
46 ~vrpn_Tracker_NovintFalcon();
47
48 /// Called once through each main loop iteration to handle updates.
49 virtual void mainloop();
50
51protected: // methods for tracker and button functionality
52 virtual void reset();
53 virtual int get_report(void);
54 virtual void send_report(void);
55 virtual void clear_values(void);
56
57protected: // methods for force feedback functionality
58 /// apply forces from known objects
59 virtual void handle_forces(void);
60public:
61 /// apply received information about force field effects.
62 virtual int update_forcefield_effect(vrpn_HANDLERPARAM p);
63protected:
64 int m_devflags; //< device configuration flags
65 vrpn_float64 m_update_rate; //< update rate of device
66 vrpn_float64 m_damp; //< damping factor for force updates
67 struct timeval m_timestamp; //< last update of device status
68 vrpn_NovintFalcon_Device *m_dev; //< device handle
69 vrpn_NovintFalcon_ForceObjects *m_obj; //< handle to force generating objects
70};
71
72#endif /* defined(VRPN_USE_LIBNIFALCON) */
73#endif
virtual void mainloop()=0
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_ForceDevice.h:39
定义 vrpn_Tracker.h:49
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41