OpenCOVER
trackingbody.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/*
9 * trackingbody.h
10 *
11 * Created on: Dec 5, 2014
12 * Author: svnvlad
13 */
14
15#ifndef __TRACKINGBODY_H_
16#define __TRACKINGBODY_H_
17
18#include <osg/Matrix>
19#include <util/coExport.h>
20#include <iostream>
21#include "inputsource.h"
22
23namespace opencover
24{
25
26class InputDevice;
27
28class COVEREXPORT TrackingBody: public InputSource
29{
30 friend class Input;
31 friend class coMousePointer;
32
33public:
34 const osg::Matrix &getMat() const;
35 const osg::Matrix &getOffsetMat() const;
36 void setOffsetMat(const osg::Matrix &m);
37 bool isVarying() const;
38 bool is6Dof() const;
39
40private:
41 TrackingBody(const std::string &name);
42
43 void update();
44 void updateRelative();
45 void setMat(const osg::Matrix &mat);
46 void setVarying(bool isVar);
47 void set6Dof(bool is6Dof);
48
49 TrackingBody *m_baseBody = nullptr;
50 size_t m_idx = 0;
51 osg::Matrix m_mat, m_oldMat;
52 osg::Matrix m_deviceOffsetMat;
53 bool m_varying = true, m_6dof = false;
54
55 struct Assemble
56 {
57 InputDevice *device = nullptr;
58 int valuator = -1;
59 double scale = 1.;
60 double shift = 0.;
61 };
62
63 bool m_assemble = false;
64 bool m_assembleWithRotationAxis = false; // assemble from 3 valuators desrcibing a rotation axis, angle is proportional to axis length
65 Assemble m_valuator[9];
66};
67}
68#endif /* TRACKINGBODY_H_ */
Definition: ARToolKit.h:33
Definition: coMousePointer.h:48
The Input class.
Definition: input.h:40
The InputDevice class interacts with input hardware.
Definition: inputdevice.h:38
Definition: inputsource.h:28
Definition: trackingbody.h:29
void setOffsetMat(const osg::Matrix &m)
const osg::Matrix & getMat() const
const osg::Matrix & getOffsetMat() const