vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HeadManipulator.h
Go to the documentation of this file.
1 #include <vrecko/Ability.h>
2 
3 #include <osg/Quat>
4 #include <osg/Matrix>
5 
6 using namespace vrecko;
7 
8 namespace behindO {
9 
10 class HeadManipulator: public Ability {
11  public:
14 
15  // ------ BaseClass functions ------------------------
17  void processEvent(const std::string &input_name, void *value);
18  // ---------------------------------------------------
19 
20  void preInitialize(void);
21  void update(void);
22 
23  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode);
24  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *saveXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
25 
26  protected:
27  //osg::Vec3 initial_sensor_pos;
28  //float scale_eye_distance_factor;
29  //osg::Vec3 head_center, eye_position;
30 
31  osg::Vec3 sensor_relative_pos, initial_sensor_pos, last_sensor_pos;
32  osg::Quat initial_sensor_orientation, last_sensor_orientation;
34  //osg::Vec3 head_center, eye_position, up_vector;
35  float left_border, right_border, top_border, bottom_border, near_border, far_border;
36 // osg::Vec3 avatar_grab_pos;
37 // osg::Matrix avatar_grab_rot, avatar_grab_transf;
38 
39  osg::Vec3 head_center, eye_position, up_vector, look_at_center, to_center;
40 
41  osg::Vec3 avatar_grab_pos;
42  osg::Matrix avatar_grab_transform, avatar_grab_inverse_transform, avatar_grab_rotation, avatar_grab_inverse_rotation;
43 
45  bool active;
46 
47  osg::Vec3 difference_sensor_pos, initial_sensor_x_orientation;
48  osg::Quat difference_sensor_orientation[2];
49 
50  float x_sensitivity, y_sensitivity, x_sensitivity_delta, delta_z;
52 
53  // mode : 0 - standard, 1 - dynamic change of sensitivity, 2 - Stretch HM, 3 - Stretch HM (controled with orientation x, y + z_pos)
54  int mode;
55 };
56 
57 }
58 
59 //$Id: HeadManipulator.h 1 2010-10-27 12:01:29Z xbezdeka $