From Jan Peciva, additional comments, and standarisation of throw and handling of mouse wheel.

This commit is contained in:
Robert Osfield
2010-06-14 15:20:47 +00:00
parent 7f7cc83f3f
commit da60a3c615
9 changed files with 207 additions and 59 deletions

View File

@@ -50,6 +50,11 @@ class OSGGA_EXPORT OrbitManipulator : public StandardManipulator
virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const;
virtual void getTransformation( osg::Vec3d& center, osg::Vec3d& eye, osg::Vec3d& up ) const;
void setHeading( double azimuth );
double getHeading() const;
void setElevation( double elevation );
double getElevation() const;
virtual void setCenter( const osg::Vec3d& center );
const osg::Vec3d& getCenter() const;
virtual void setRotation( const osg::Quat& rotation );

View File

@@ -39,7 +39,7 @@ class OSGGA_EXPORT StandardManipulator : public CameraManipulator
UPDATE_MODEL_SIZE = 0x01,
COMPUTE_HOME_USING_BBOX = 0x02,
PROCESS_MOUSE_WHEEL = 0x04,
SET_CENTER_ON_WHEEL_UP = 0x08,
SET_CENTER_ON_WHEEL_FORWARD_MOVEMENT = 0x08,
DEFAULT_SETTINGS = UPDATE_MODEL_SIZE | COMPUTE_HOME_USING_BBOX | PROCESS_MOUSE_WHEEL
};
@@ -62,6 +62,8 @@ class OSGGA_EXPORT StandardManipulator : public CameraManipulator
virtual void setVerticalAxisFixed( bool value );
inline bool getVerticalAxisFixed() const;
inline bool getAllowThrow() const;
virtual void setAllowThrow( bool allowThrow );
virtual void setAnimationTime( const double t );
double getAnimationTime() const;
@@ -113,6 +115,7 @@ class OSGGA_EXPORT StandardManipulator : public CameraManipulator
// mouse state
bool _thrown;
bool _allowThrow;
float _mouseCenterX, _mouseCenterY;
// internal event stack comprising last two mouse events.
@@ -181,6 +184,12 @@ inline bool StandardManipulator::getVerticalAxisFixed() const
return _verticalAxisFixed;
}
/// Returns true if the camera can be thrown, false otherwise. It defaults to true.
inline bool StandardManipulator::getAllowThrow() const
{
return _allowThrow;
}
}