diff --git a/include/osgGA/DriveManipulator b/include/osgGA/DriveManipulator index bc4f04961..ea08da520 100644 --- a/include/osgGA/DriveManipulator +++ b/include/osgGA/DriveManipulator @@ -63,6 +63,15 @@ class OSGGA_EXPORT DriveManipulator : public MatrixManipulator /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage& usage) const; + void setModelScale( double in_ms ) { _modelScale = in_ms; } + double getModelScale() const { return _modelScale; } + + void setVelocity( double in_vel ) { _velocity = in_vel; } + double getVelocity() const { return _velocity; } + + void setHeight( double in_h ) { _height = in_h; } + double getHeight() const { return _height; } + protected: virtual ~DriveManipulator(); diff --git a/include/osgGA/FlightManipulator b/include/osgGA/FlightManipulator index 744537505..836e63297 100644 --- a/include/osgGA/FlightManipulator +++ b/include/osgGA/FlightManipulator @@ -67,9 +67,18 @@ class OSGGA_EXPORT FlightManipulator : public MatrixManipulator NO_AUTOMATIC_YAW }; - /** Configure the Yaw control for the flight model. */ + /** Configure the Yaw control for the flight model. */ void setYawControlMode(YawControlMode ycm) { _yawMode = ycm; } + void setModelScale(double in_ms) { _modelScale = in_ms; } + double getModelScale() const { return _modelScale; } + + void setAcceleration(double in_acc) { _acceleration = in_acc; } + double getAcceleration() const { return _acceleration; } + + void setVelocity(double in_vel) { _velocity = in_vel; } + double getVelocity() const { return _velocity; } + protected: virtual ~FlightManipulator(); diff --git a/include/osgGA/TrackballManipulator b/include/osgGA/TrackballManipulator index dfe6d1327..df1e11fc0 100644 --- a/include/osgGA/TrackballManipulator +++ b/include/osgGA/TrackballManipulator @@ -22,18 +22,10 @@ namespace osgGA{ class OSGGA_EXPORT TrackballManipulator : public MatrixManipulator { public: - TrackballManipulator(); virtual const char* className() const { return "Trackball"; } - /** set the minimum distance (as ratio) the eye point can be zoomed in towards the - center before the center is pushed forward.*/ - void setMinimumZoomScale(float minimumZoomScale) { _minimumZoomScale=minimumZoomScale; } - - /** get the minimum distance (as ratio) the eye point can be zoomed in */ - float getMinimumZoomScale() const { return _minimumZoomScale; } - /** set the position of the matrix manipulator using a 4x4 Matrix.*/ virtual void setByMatrix(const osg::Matrixd& matrix); @@ -78,6 +70,14 @@ class OSGGA_EXPORT TrackballManipulator : public MatrixManipulator /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage& usage) const; + + /** set the minimum distance (as ratio) the eye point can be zoomed in towards the + center before the center is pushed forward.*/ + void setMinimumZoomScale(double minimumZoomScale) { _minimumZoomScale=minimumZoomScale; } + + /** get the minimum distance (as ratio) the eye point can be zoomed in */ + double getMinimumZoomScale() const { return _minimumZoomScale; } + /** Set the size of the trackball. */ void setTrackballSize(float size); diff --git a/include/osgGA/UFOManipulator b/include/osgGA/UFOManipulator index 9881ef053..da9230e60 100644 --- a/include/osgGA/UFOManipulator +++ b/include/osgGA/UFOManipulator @@ -111,9 +111,24 @@ class OSGGA_EXPORT UFOManipulator : public osgGA::MatrixManipulator /** Report the current position as LookAt vectors */ void getCurrentPositionAsLookAt( osg::Vec3 &eye, osg::Vec3 ¢er, osg::Vec3 &up ); - protected: - private: + void setMinHeight( double in_min_height ) { _minHeightAboveGround = in_min_height; } + double getMinHeight() const { return _minHeightAboveGround; } + + void setMinDistance( double in_min_dist ) { _minDistanceInFront = in_min_dist; } + double getMinDistance() const { return _minDistanceInFront; } + + void setForwardSpeed( double in_fs ) { _forwardSpeed = in_fs; } + double getForwardSpeed() const { return _forwardSpeed; } + + void setSideSpeed( double in_ss ) { _sideSpeed = in_ss; } + double getSideSpeed() const { return _sideSpeed; } + + void setRotationSpeed( double in_rot_speed ) { _directionRotationRate = in_rot_speed; } + double getRotationSpeed() const { return _directionRotationRate; } + + + protected: osg::ref_ptr _node; float _viewAngle; osg::Matrixd _matrix; diff --git a/src/osg/Matrix_implementation.cpp b/src/osg/Matrix_implementation.cpp index a2cb54508..3a81f1e4c 100644 --- a/src/osg/Matrix_implementation.cpp +++ b/src/osg/Matrix_implementation.cpp @@ -74,7 +74,7 @@ void Matrix_implementation::set(const Quat& q_in) // Source: Gamasutra, Rotating Objects Using Quaternions // - //http://www.gamasutra.com/features/programming/19980703/quaternions_01.htm + //http://www.gamasutra.com/features/19980703/quaternions_01.htm double wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; diff --git a/src/osgGA/DriveManipulator.cpp b/src/osgGA/DriveManipulator.cpp index 924c2ea82..fb1b5cfd1 100644 --- a/src/osgGA/DriveManipulator.cpp +++ b/src/osgGA/DriveManipulator.cpp @@ -341,7 +341,7 @@ bool DriveManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) case(GUIEventAdapter::KEYDOWN): { - if (ea.getKey()==' ') + if (ea.getKey()==GUIEventAdapter::KEY_Space) { flushMouseEventStack(); home(ea,us); diff --git a/src/osgGA/FlightManipulator.cpp b/src/osgGA/FlightManipulator.cpp index 56e83de1e..5c1407ef1 100644 --- a/src/osgGA/FlightManipulator.cpp +++ b/src/osgGA/FlightManipulator.cpp @@ -131,7 +131,8 @@ bool FlightManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) } case(GUIEventAdapter::KEYDOWN): - if (ea.getKey()==' ') + { + if (ea.getKey()==GUIEventAdapter::KEY_Space) { flushMouseEventStack(); home(ea,us); @@ -150,7 +151,7 @@ bool FlightManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) return true; } return false; - + } case(GUIEventAdapter::FRAME): addMouseEvent(ea); if (calcMovement()) us.requestRedraw(); diff --git a/src/osgGA/TerrainManipulator.cpp b/src/osgGA/TerrainManipulator.cpp index 33fba1b5b..8c8d21ac4 100644 --- a/src/osgGA/TerrainManipulator.cpp +++ b/src/osgGA/TerrainManipulator.cpp @@ -158,7 +158,7 @@ bool TerrainManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) } case(GUIEventAdapter::KEYDOWN): - if (ea.getKey()==' ') + if (ea.getKey()== GUIEventAdapter::KEY_Space) { flushMouseEventStack(); _thrown = false; diff --git a/src/osgGA/TrackballManipulator.cpp b/src/osgGA/TrackballManipulator.cpp index c1e03b96f..db8f4c84d 100644 --- a/src/osgGA/TrackballManipulator.cpp +++ b/src/osgGA/TrackballManipulator.cpp @@ -136,7 +136,7 @@ bool TrackballManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us } case(GUIEventAdapter::KEYDOWN): - if (ea.getKey()==' ') + if (ea.getKey()== GUIEventAdapter::KEY_Space) { flushMouseEventStack(); _thrown = false;