From 22ec86114d591179031f2978e46e583812310128 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Jun 2004 07:32:08 +0000 Subject: [PATCH] Updates to the terrain manipulator. --- include/osgGA/TerrainManipulator | 8 +++----- src/osgGA/FlightManipulator.cpp | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/osgGA/TerrainManipulator b/include/osgGA/TerrainManipulator index 7de61b9ff..19b131b48 100644 --- a/include/osgGA/TerrainManipulator +++ b/include/osgGA/TerrainManipulator @@ -40,10 +40,10 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator /** 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; } + void setMinimumDistance(float minimumDistance) { _minimumDistance=minimumDistance; } /** get the minimum distance (as ratio) the eye point can be zoomed in */ - float getMinimumZoomScale() const { return _minimumZoomScale; } + float getMminimumDistance() const { return _minimumDistance; } /** set the position of the matrix manipulator using a 4x4 Matrix.*/ @@ -122,10 +122,8 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator osg::ref_ptr _node; - double _modelScale; - RotationMode _rotationMode; - double _minimumZoomScale; + double _minimumDistance; bool _thrown; diff --git a/src/osgGA/FlightManipulator.cpp b/src/osgGA/FlightManipulator.cpp index d76d917ae..910ff5867 100644 --- a/src/osgGA/FlightManipulator.cpp +++ b/src/osgGA/FlightManipulator.cpp @@ -7,6 +7,7 @@ using namespace osgGA; FlightManipulator::FlightManipulator() { _modelScale = 0.01f; + _acceleration = 100.0f; _velocity = 0.0f; _yawMode = YAW_AUTOMATICALLY_WHEN_BANKED; @@ -237,7 +238,7 @@ bool FlightManipulator::calcMovement() { // pan model. - _velocity += dt*_modelScale*0.02f; + _velocity += dt*(_acceleration+_velocity); } else if (buttonMask==GUIEventAdapter::MIDDLE_MOUSE_BUTTON || @@ -250,7 +251,7 @@ bool FlightManipulator::calcMovement() else if (buttonMask==GUIEventAdapter::RIGHT_MOUSE_BUTTON) { - _velocity -= dt*_modelScale*0.02f; + _velocity -= dt*(_acceleration+_velocity); }