vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AvatarInHand.h
Go to the documentation of this file.
1 #include <vrecko/Ability.h>
2 #include <vrecko/Scene.h>
3 #ifndef WIN32
4 #include <sys/time.h>
5 #endif
6 #include <time.h>
7 
9 #include <vrecko/World.h>
10 
11 using namespace vrecko;
12 
13 namespace navigation {
14 class AvatarInHand: public Ability {
15  public:
16  AvatarInHand();
18 
19  // ------ BaseClass functions ------------------------
20  void postInitialize(void);
21 
23 // void receiveEvent(const std::string &input_name, void *value);
24  void processEvent(const std::string &input_name, VreckoMessage *message);
25 
26  // ---------------------------------------------------
27 
28  void initialize(void);
29  void update(void);
30  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode);
31  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *saveXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
32 
33 
34  std::string getAcceptableMessages(void) {return "";}
35  protected:
37  osg::Vec3 _actual_position, _last_position;
39  osg::Vec3 avatar_position;
40  osg::Vec3 avatar_look_at;
41  osg::Vec3 avatar_up_vector;
42  osg::Vec3 _actual_left_hand_position, _actual_right_hand_position, _actual_head_position;
43  osg::Quat _actual_left_hand_orientation, _actual_right_hand_orientation, _actual_head_orientation;
44  osg::Vec3 grab_position;
45 
46  osg::Quat* qc;
47  osg::Quat* qc_old; // Quaternion of control
48  osg::Quat* qd_old2;
49  osg::Quat* qd;
50  osg::Quat* qd_old; // Quat of display
51  osg::Quat* qd_init;
52  osg::Quat q;
53 
54 
55  double angle;
56  bool absolut;
57  bool pom;
58  bool fly;
59  bool start;
60  osg::Vec3 av_pos;
61  string mesg;
62  bool immersive;
63  float const_d;
64 
65  DECLARE_OUTPUT(Position, MessageVec3);
66  DECLARE_OUTPUT(Orientation, MessageQuat);
67 };
68 }