vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Avatar.h
Go to the documentation of this file.
1 #ifndef AVATAR_H
2 #define ABATAR_H
3 
4 #include <vrecko/Ability.h>
5 
7 #include <vrecko/World.h>
8 
9 
10 using namespace vrecko;
11 
12 namespace base {
13 
14 class Avatar: public Ability {
15  public:
16  Avatar();
17  ~Avatar();
18 
19  // ------ BaseClass functions ------------------------
21 // void processEvent(const std::string &input_name, void *value);
22  // ---------------------------------------------------
23 
24  void preInitialize(void);
25  void postInitialize(void);
26  void update(void);
27 
28  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
29  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *saveXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
30 
31  protected:
33  osg::Quat orientation; // [orientation] and [avatar_view] should be kept in sync
34 
39 
40  long int headEO_ID, leftHandEO_ID, rightHandEO_ID, freeMoveEO_ID;
41 
42 // osg::Vec3 eye_position, up_vector;
43 // osg::Vec3 direction_and_shift; // look direction and the GLOVES SHIFT !!! (0, 0, -24) typically
44 
45  osg::Vec3 cursor_shift; // must be in the form (0, 0, X)
46 
49  osg::Vec3 reference_point;
50 
51  //void applyPosChange(const std::string &input_name, osg::Vec3 posChange);
52 
54  void setOrientationKeepUp(osg::Quat *newOrientation);
55 
56  void updatePosRot(bool bUpdatePos, bool bUpdateRot, osg::Vec3 *position, osg::Quat *orientation);
57 
58  DECLARE_INPUT(FreeMovement, MessageBool);
60  DECLARE_INPUT(MoveLocal, MessageVec3);
61  DECLARE_INPUT(Rotation, MessageQuat);
62  DECLARE_INPUT(RotationKeepUp, MessageQuat);
63  DECLARE_INPUT(Position, MessageVec3);
64  DECLARE_INPUT(Orientation, MessageQuat);
65  DECLARE_INPUT(OrientationKeepUp, MessageQuat);
66 
67  DECLARE_INPUT(DebugOutputViewPosition, MessageVoid);
68 };
69 
70 }
71 
72 #endif