Improved the panning support, and added s/getRotationMode(..) to allow

users flip between a trackball rotation style and an azim,elevation style.
This commit is contained in:
Robert Osfield
2004-05-17 15:50:44 +00:00
parent 867a1ae105
commit a62699b015
2 changed files with 112 additions and 24 deletions

View File

@@ -27,6 +27,17 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator
virtual const char* className() const { return "Terrain"; }
enum RotationMode
{
ELEVATION_AZIM_ROLL,
ELEVATION_AZIM,
};
void setRotationMode(RotationMode mode);
RotationMode getRotationMode() const { return _rotationMode; }
/** set the minimum distance (as ratio) the eye point can be zoomed in towards the
center before the center is pushed forward.*/
void setMinimumZoomScale(float minimumZoomScale) { _minimumZoomScale=minimumZoomScale; }
@@ -34,6 +45,7 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator
/** get the minimum distance (as ratio) the eye point can be zoomed in */
float getMinimumZoomScale() const { return _minimumZoomScale; }
/** set the position of the matrix manipulator using a 4x4 Matrix.*/
virtual void setByMatrix(const osg::Matrixd& matrix);
@@ -100,20 +112,26 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator
If speed is below a threshold then return false, otherwise return true.*/
bool isMouseMoving();
void clampOrientation();
// Internal event stack comprising last three mouse events.
osg::ref_ptr<const GUIEventAdapter> _ga_t1;
osg::ref_ptr<const GUIEventAdapter> _ga_t0;
osg::ref_ptr<osg::Node> _node;
osg::ref_ptr<osg::Node> _node;
float _modelScale;
float _minimumZoomScale;
float _modelScale;
bool _thrown;
RotationMode _rotationMode;
float _minimumZoomScale;
bool _thrown;
osg::CoordinateFrame _coordinateFrame;
osg::Quat _rotation;
float _distance;
osg::CoordinateFrame _coordinateFrame;
osg::Quat _rotation;
float _distance;
};