Fixed numerical accuracy problem in Trackball manipulator.

This commit is contained in:
Robert Osfield
2002-08-29 16:38:51 +00:00
parent 3835a82052
commit 44beefa9a5
2 changed files with 60 additions and 23 deletions

View File

@@ -49,6 +49,10 @@ class OSGGA_EXPORT TrackballManipulator : public CameraManipulator
/** For the give mouse movement calculate the movement of the camera.
Return true is camera has moved and a redraw is required.*/
bool calcMovement();
void computeLocalDataFromCamera();
void computeCameraFromLocalData();
void trackball(osg::Vec3& axis,float& angle, float p1x, float p1y, float p2x, float p2y);
float tb_project_to_sphere(float r, float x, float y);
@@ -68,6 +72,10 @@ class OSGGA_EXPORT TrackballManipulator : public CameraManipulator
float _minimumZoomScale;
bool _thrown;
osg::Vec3 _center;
osg::Quat _rotation;
float _distance;
};