|
Revision 2235, 3.1 kB
(checked in by robert, 10 years ago)
|
|
Added new Matrixf and Matrixd implementations.
Made Matrix be a typedef to either Matrixf or Matrixd. Defaults to Matrixf.
Converted the osgGA::MatrixManipulators? and osgProducer::Viewer/OsgCameraGroup
across to using exclusively Matrixd for internal computations and passing betwen
Manipulators, Producer and SceneView?. Note, SceneView? still uses Matrix internally
so will depend on what is set as the default in include/osg/Matrix.
Added the ability to osgProducer::setDone/getDone(), kept done() as the
method that the viewer main loop uses for detecting the exit condition.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | #ifndef OSGGA_TESTMANIPULATOR |
|---|
| 6 | #define OSGGA_TESTMANIPULATOR 1 |
|---|
| 7 | |
|---|
| 8 | #include <osgGA/MatrixManipulator> |
|---|
| 9 | #include <osg/Quat> |
|---|
| 10 | |
|---|
| 11 | class TestManipulator : public osgGA::MatrixManipulator |
|---|
| 12 | { |
|---|
| 13 | public: |
|---|
| 14 | |
|---|
| 15 | TestManipulator(); |
|---|
| 16 | virtual ~TestManipulator(); |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | virtual void setByMatrix(const osg::Matrixd& matrix); |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); } |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | virtual osg::Matrixd getMatrix() const; |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | virtual osg::Matrixd getInverseMatrix() const; |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | virtual void setNode(osg::Node*); |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | virtual const osg::Node* getNode() const; |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | virtual osg::Node* getNode(); |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | virtual void home(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us); |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | virtual void init(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us); |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us); |
|---|
| 52 | |
|---|
| 53 | private: |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | void flushMouseEventStack(); |
|---|
| 57 | |
|---|
| 58 | void addMouseEvent(const osgGA::GUIEventAdapter& ea); |
|---|
| 59 | |
|---|
| 60 | void computePosition(const osg::Vec3& eye,const osg::Vec3& lv,const osg::Vec3& up); |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | bool calcMovement(); |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | bool isMouseMoving(); |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | osg::ref_ptr<const osgGA::GUIEventAdapter> _ga_t1; |
|---|
| 72 | osg::ref_ptr<const osgGA::GUIEventAdapter> _ga_t0; |
|---|
| 73 | |
|---|
| 74 | osg::ref_ptr<osg::Node> _node; |
|---|
| 75 | |
|---|
| 76 | float _modelScale; |
|---|
| 77 | float _minimumZoomScale; |
|---|
| 78 | |
|---|
| 79 | bool _thrown; |
|---|
| 80 | |
|---|
| 81 | osg::Vec3 _center; |
|---|
| 82 | osg::Quat _rotation; |
|---|
| 83 | float _distance; |
|---|
| 84 | |
|---|
| 85 | }; |
|---|
| 86 | |
|---|
| 87 | #endif |
|---|