From Cory Riddell, "I added an _allowThrow boolean along with a getter and setter to the

spherical manipulator. The default value is true.

This is very similar to the flag in trackball."
This commit is contained in:
Robert Osfield
2009-06-25 09:14:47 +00:00
parent d4b065de53
commit 3aded84015
2 changed files with 8 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ class OSGGA_EXPORT SphericalManipulator : public MatrixManipulator
RotationMode getRotationMode() const {return _rotationMode;}
void setRotationMode(RotationMode mode);
/** Returns true if the camera can be thrown, false otherwise. This defaults to true. */
bool getAllowThrow() const { return _allowThrow; }
/** Set the 'allow throw' flag. Releasing the mouse button while moving the camera results in a throw. */
void setAllowThrow(bool allowThrow) { _allowThrow = allowThrow; }
protected:
virtual ~SphericalManipulator();
@@ -136,6 +141,7 @@ class OSGGA_EXPORT SphericalManipulator : public MatrixManipulator
double _minimumZoomScale;
bool _thrown;
bool _allowThrow;
RotationMode _rotationMode;
osg::Vec3d _center;

View File

@@ -13,6 +13,7 @@ SphericalManipulator::SphericalManipulator()
_modelScale = 0.01;
_minimumZoomScale = 0.1;
_thrown = false;
_allowThrow = true;
_distance=1.0;
_homeDistance=1.0;
@@ -149,7 +150,7 @@ bool SphericalManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us
{
us.requestRedraw();
us.requestContinuousUpdate(true);
_thrown = true;
_thrown = _allowThrow;
}
}
else