vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CameraMovementFilter.h
Go to the documentation of this file.
1 #ifndef CAMERAMOVEMENT_FILTER_H
2 #define CAMERAMOVEMENT_FILTER_H
3 
5 
6 #ifdef COMPILE_PHANTOM_DEVICE
7 
8 #include "FadeFilter.h"
9 
10 namespace vreckoDP_PHANToM {
11 
12 /* PHANToM filter to move camera by pressing the button on the Phantom device and moving with it */
13 class CameraMovementForceFilter : public FadeForceFilter {
14 public:
15  CameraMovementForceFilter();
16 
17  virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters);
18 
19  virtual void apply(PHANToMSTATE &pState, osg::Vec3 &force, osg::Vec3 &torque);
20 
21 protected:
22  osg::Vec3f origAvatarPos;
23  osg::Quat origAvatarRot;
24 
25  osg::Vec3f origToolPos;
26  osg::Quat origToolRot;
27 
28  bool bMovementStarted;
29 
30  void startCameraMovement(PHANToMSTATE &pState);
31  void endCameraMovement();
32 
33 // void phantomToOSG(osg::Vec3f &pos, osg::Quat &rot);
34  // Transforms coordinate axes from Phantom coordinate system to the OSG (OpenGL) one
35 };
36 
37 }
38 
39 #endif
40 
41 
42 #endif