Changeset 10406

Show
Ignore:
Timestamp:
06/25/09 11:14:47 (5 years ago)
Author:
robert
Message:

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."

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgGA/SphericalManipulator

    r10254 r10406  
    110110        void setRotationMode(RotationMode mode); 
    111111 
     112         /** Returns true if the camera can be thrown, false otherwise. This defaults to true. */ 
     113        bool getAllowThrow() const { return _allowThrow; } 
     114        /** Set the 'allow throw' flag. Releasing the mouse button while moving the camera results in a throw. */ 
     115        void setAllowThrow(bool allowThrow) { _allowThrow = allowThrow; } 
     116 
    112117    protected: 
    113118 
     
    137142 
    138143        bool _thrown; 
     144        bool _allowThrow; 
    139145 
    140146        RotationMode    _rotationMode; 
  • OpenSceneGraph/trunk/src/osgGA/SphericalManipulator.cpp

    r10286 r10406  
    1414    _minimumZoomScale = 0.1; 
    1515    _thrown = false; 
     16    _allowThrow = true; 
    1617 
    1718    _distance=1.0; 
     
    150151                        us.requestRedraw(); 
    151152                        us.requestContinuousUpdate(true); 
    152                         _thrown = true; 
     153                        _thrown = _allowThrow; 
    153154                    } 
    154155                }