vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Drag.h
Go to the documentation of this file.
1 #ifndef VF_DRAG
2 #define VF_DRAG
3 
4 #include <vrecko/Ability.h>
5 #include <vreckoDP/base/PHANToM.h>
6 
7 #include "mvect++.h"
8 
9 #include <string>
10 
11 using namespace vrecko;
12 using namespace vreckoDP_base;
13 using namespace mv;
14 
15 namespace VirtualFixture{
16 
17 class Drag: public PHANToMFilter {
18  public:
19  Drag();
20  ~Drag() {};
21 
23  void apply(PHANToM *pPHANToM, osg::Vec3 &force);
24  void processEvent(const std::string &input_name, void *value);
25  void dispatchEvent(const std::string &pInputName, void *pValue);
26  void dispatchMessage(Message* pMessage);
27 
28  void preInitialize(void);
29  void postInitialize(void);
30  void update(void);
31 
32  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
33  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
34 
35  void displayAllGestures(void);
36 
37  protected:
38  PHANToM *PHANToMDevice;
39  bool all_on;
40  bool active; //VF switcher
41  bool force; //switch in mvect++ lib (if force is returned or position)
42  osg::Vec3 position; //position of starting point
43 // float nullradius; //radius close to centre, where attractive field is NOT applied
44 // float stiffness; //stiffness of attractive field = how strong it would be for every meter of space
45 
46  CPlayer *player; //pointer to instance of player (is only one in system)
47 };
48 
49 };
50 #endif