OpenCOVER
coVR3DRotInteractor.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_ROT_INTERACTOR_H
9#define _CO_VR_3D_ROT_INTERACTOR_H
10
12
13namespace opencover
14{
15// selectable cone which can be positioned in 3D
16// the cone is modeled in the origin (along z axis)
17// the interactor rotates around the rotation point
18//
19// |---|
20// laser sword | x | interactor center
21// hand ----------------------o___|-------->
22// hitPoint
23//
24// d: distance hand-hitPoint
25// diff: Vector hitPoint_0-interactorcenter
26// laserSword Direction.xformVec(yaxis, handMat)
27// laserSwordDirection_o.xformVec(laserSwordDirection, cover->getInvBase)
28// new interactor center = handPos +laserSwordDirection_o * d + diff
29
30class PLUGIN_UTILEXPORT coVR3DRotInteractor : public coVRIntersectionInteractor
31{
32private:
33 osg::Vec3 _interPos; // position in object coordinates
34 osg::Vec3 _rotationPoint; // position in object coordinates
35 float _d;
36 osg::Vec3 _diff;
37 osg::Matrix _oldHandMat;
38 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 coVR3DRotInteractor(osg::Vec3 rotationPoint, osg::Vec3 position, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority = Medium);
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, osg::Vec3 rotationPoint);
58
59 // set the rotation point
60 void updateRotationPoint(osg::Vec3 rotPoint);
61
62 // return the current position
63 osg::Vec3 getPos()
64 {
65 return _interPos;
66 }
67
68 // return the current rotation point
69 osg::Vec3 getRotationPoint()
70 {
71 return _rotationPoint;
72 }
73};
74}
75#endif
Definition: ARToolKit.h:33
Definition: coVRIntersectionInteractor.h:56
Definition: coVR3DRotInteractor.h:31
osg::Vec3 getPos()
Definition: coVR3DRotInteractor.h:63
void updateRotationPoint(osg::Vec3 rotPoint)
coVR3DRotInteractor(osg::Vec3 rotationPoint, osg::Vec3 position, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority=Medium)
void updateTransform(osg::Vec3 pos, osg::Vec3 rotationPoint)
osg::Vec3 getRotationPoint()
Definition: coVR3DRotInteractor.h:69