From b0869a6f6023689c26685661c31386091b00cf7b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 18 Nov 2005 15:00:34 +0000 Subject: [PATCH] Added s/getCenter and s/getRotation methods, and updated wrapper. --- include/osgGA/TrackballManipulator | 19 +++++++++++++++---- .../osgGA/TrackballManipulator.cpp | 11 +++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/osgGA/TrackballManipulator b/include/osgGA/TrackballManipulator index e52054de2..baedeefb3 100644 --- a/include/osgGA/TrackballManipulator +++ b/include/osgGA/TrackballManipulator @@ -78,11 +78,17 @@ class OSGGA_EXPORT TrackballManipulator : public MatrixManipulator /** 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); + /** Set the center of the trackball. */ + void setCenter(const osg::Vec3d& center) { _center = center; } - /** Get the size of the trackball. */ - float getTrackballSize() const { return _trackballSize; } + /** Get the center of the trackball. */ + const osg::Vec3d& getCenter() const { return _center; } + + /** Set the rotation of the trackball. */ + void setRotation(const osg::Quat& rotation) { _rotation = rotation; } + + /** Get the rotation of the trackball. */ + const osg::Quat& getRotation() const { return _rotation; } /** Set the distance of the trackball. */ void setDistance(double distance) { _distance = distance; } @@ -90,6 +96,11 @@ class OSGGA_EXPORT TrackballManipulator : public MatrixManipulator /** Get the distance of the trackball. */ double getDistance() const { return _distance; } + /** Set the size of the trackball. */ + void setTrackballSize(float size); + + /** Get the size of the trackball. */ + float getTrackballSize() const { return _trackballSize; } protected: virtual ~TrackballManipulator(); diff --git a/src/osgWrappers/osgGA/TrackballManipulator.cpp b/src/osgWrappers/osgGA/TrackballManipulator.cpp index 0a6d2fd1c..62774283b 100644 --- a/src/osgWrappers/osgGA/TrackballManipulator.cpp +++ b/src/osgWrappers/osgGA/TrackballManipulator.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -45,16 +47,25 @@ BEGIN_OBJECT_REFLECTOR(osgGA::TrackballManipulator) I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage); I_Method1(void, setMinimumZoomScale, IN, double, minimumZoomScale); I_Method0(double, getMinimumZoomScale); + I_Method1(void, setCenter, IN, const osg::Vec3d &, center); + I_Method0(const osg::Vec3d &, getCenter); + I_Method1(void, setRotation, IN, const osg::Quat &, rotation); + I_Method0(const osg::Quat &, getRotation); + I_Method1(void, setDistance, IN, double, distance); + I_Method0(double, getDistance); I_Method1(void, setTrackballSize, IN, float, size); I_Method0(float, getTrackballSize); I_WriteOnlyProperty(const osg::Matrixd &, ByInverseMatrix); I_WriteOnlyProperty(const osg::Matrixd &, ByMatrix); + I_Property(const osg::Vec3d &, Center); + I_Property(double, Distance); I_ReadOnlyProperty(osgUtil::SceneView::FusionDistanceMode, FusionDistanceMode); I_ReadOnlyProperty(float, FusionDistanceValue); I_ReadOnlyProperty(osg::Matrixd, InverseMatrix); I_ReadOnlyProperty(osg::Matrixd, Matrix); I_Property(double, MinimumZoomScale); I_Property(osg::Node *, Node); + I_Property(const osg::Quat &, Rotation); I_Property(float, TrackballSize); END_REFLECTOR