OpenCOVER
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
13namespace 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
29class PLUGIN_UTILEXPORT coVR3DTransInteractor : public coVRIntersectionInteractor
30{
31private:
32 osg::Vec3 _interPos; // position in object coordinates
33 float _d;
34 osg::Vec3 _diff;
35 osg::Matrix _oldHandMat;
36
37protected:
38 virtual void createGeometry();
39
40public:
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
48
50
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: ARToolKit.h:33
Definition: coVRIntersectionInteractor.h:56
Definition: coVR3DTransInteractor.h:30
void updateTransform(osg::Vec3 pos)
osg::Vec3 getPos()
Definition: coVR3DTransInteractor.h:63
coVR3DTransInteractor(osg::Vec3 pos, float size, vrui::coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority)
InteractionType
Definition: coInteraction.h:45