Updates to the terrain manipulator.

This commit is contained in:
Robert Osfield
2004-06-08 07:32:08 +00:00
parent eec378a885
commit 22ec86114d
2 changed files with 6 additions and 7 deletions

View File

@@ -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<osg::Node> _node;
double _modelScale;
RotationMode _rotationMode;
double _minimumZoomScale;
double _minimumDistance;
bool _thrown;

View File

@@ -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);
}