From c3b7f6debefafb934c3c73ca3a1a459a9fa4a34e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 1 Feb 2012 17:10:48 +0000 Subject: [PATCH] Added example usage of teh new DraggerTransforCallback's HandleCommandMask which is tied to the TabPlaneDragger example. --- examples/osgmanipulator/osgmanipulator.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/osgmanipulator/osgmanipulator.cpp b/examples/osgmanipulator/osgmanipulator.cpp index 20f2b7ff0..a1fe4d21a 100644 --- a/examples/osgmanipulator/osgmanipulator.cpp +++ b/examples/osgmanipulator/osgmanipulator.cpp @@ -49,34 +49,36 @@ public: virtual bool constrain(osgManipulator::TranslateInLineCommand& command) const { - OSG_NOTICE<<"TranslateInLineCommand "<setMatrix(osg::Matrix::scale(scale, scale, scale) * osg::Matrix::translate(scene->getBound().center())); - dragger->addTransformUpdating(selection); + if (dynamic_cast(dragger)) + { + dragger->addTransformUpdating(selection, osgManipulator::DraggerTransformCallback::HANDLE_TRANSLATE_IN_LINE); + } + else + { + dragger->addTransformUpdating(selection); + } // we want the dragger to handle it's own events automatically dragger->setHandleEvents(true);