OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coVR3DTransInteractor.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _CO_VR_3D_TRANS_INTERACTOR_H
9 #define _CO_VR_3D_TRANS_INTERACTOR_H
10 
12 
13 namespace opencover
14 {
15 // selectable sphere which can be positioned in 3D
16 // the sphere is modeled in the origin
17 //
18 // |---|
19 // laser sword | x | interactor center
20 // hand ----------------------o___|-------->
21 // hitPoint
22 //
23 // d: distance hand-hitPoint
24 // diff: Vector hitPoint_0-interactorcenter
25 // laserSword Direction.xformVec(yaxis, handMat)
26 // laserSwordDirection_o.xformVec(laserSwordDirection, cover->getInvBase)
27 // new interactor center = handPos +laserSwordDirection_o * d + diff
28 
29 class PLUGIN_UTILEXPORT coVR3DTransInteractor : public coVRIntersectionInteractor
30 {
31 private:
32  osg::Vec3 _interPos; // position in object coordinates
33  float _d;
34  osg::Vec3 _diff;
35  osg::Matrix _oldHandMat;
36 
37 protected:
38  virtual void createGeometry();
39 
40 public:
41  // pos: position in object coordinates
42  // (it is intended for positioning COVISE module parameters like the
43  // startpoints for tracers and these parameters are always in object
44  // coordinates
45  coVR3DTransInteractor(osg::Vec3 pos, float size, vrui::coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority);
46 
47  virtual ~coVR3DTransInteractor();
48 
49  void startInteraction();
50 
51  void doInteraction();
52 
53  // stop the interaction
54  // implemented in base class void stopInteraction();
55 
56  // set a new position
57  void updateTransform(osg::Vec3 pos);
58 
59  // set a new position
60  void setPos();
61 
62  // return the current position
63  osg::Vec3 getPos()
64  {
65  return _interPos;
66  };
67 };
68 }
69 #endif
Definition: coVR3DTransInteractor.h:29
osg::Vec3 getPos()
Definition: coVR3DTransInteractor.h:63
Definition: coVRIntersectionInteractor.h:55
InteractionType
Definition: coInteraction.h:44