diff --git a/src/osgGA/OrbitManipulator.cpp b/src/osgGA/OrbitManipulator.cpp index 1ee5af221..3d2750c6d 100644 --- a/src/osgGA/OrbitManipulator.cpp +++ b/src/osgGA/OrbitManipulator.cpp @@ -379,12 +379,12 @@ void OrbitManipulator::OrbitAnimationData::start( const osg::Vec3d& movement, co Scale parameter is useful, for example, when manipulator is thrown. It scales the amount of rotation based, for example, on the current frame time.*/ void OrbitManipulator::rotateTrackball( const float px0, const float py0, - const float px1, const float py1, const float /*scale*/ ) + const float px1, const float py1, const float scale ) { osg::Vec3d axis; float angle; - trackball( axis, angle, px1, py1, px0, py0 ); + trackball( axis, angle, px0 + (px1-px0)*scale, py0 + (py1-py0)*scale, px0, py0 ); Quat new_rotate; new_rotate.makeRotate( angle, axis ); diff --git a/src/osgGA/StandardManipulator.cpp b/src/osgGA/StandardManipulator.cpp index 105fb8a04..747dd20fd 100644 --- a/src/osgGA/StandardManipulator.cpp +++ b/src/osgGA/StandardManipulator.cpp @@ -154,6 +154,8 @@ bool StandardManipulator::isAnimating() const /// Finishes the animation by performing a step that moves it to its final position. void StandardManipulator::finishAnimation() { + _thrown = false; + if( !isAnimating() ) return; @@ -586,7 +588,12 @@ void StandardManipulator::setAllowThrow( bool allowThrow ) events that started the animation.*/ float StandardManipulator::getThrowScale( const double eventTimeDelta ) const { - if( _thrown ) return float( _delta_frame_time / eventTimeDelta ); + if( _thrown ) + { + if (eventTimeDelta == 0.f) + return 0.f; + return float( _delta_frame_time / eventTimeDelta ); + } else return 1.f; }