From 4b97e30d22d4667a884efefede2b828d253b1b6d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 15 Jan 2007 11:44:38 +0000 Subject: [PATCH] Added terrain manipulator. --- applications/osgviewer/osgviewer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 4a75d3918..beb9c7932 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -138,6 +138,7 @@ int main_osgProducer(osg::ArgumentParser& arguments) #include #include #include +#include class ThreadingHandler : public osgGA::GUIEventHandler { @@ -243,17 +244,19 @@ int main_osgViewer(osg::ArgumentParser& arguments) keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); + keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); std::string pathfile; - osg::ref_ptr apm = 0; + char keyForAnimationPath = '5'; while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); if (apm || !apm->valid()) { unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); - keyswitchManipulator->addMatrixManipulator( '4', "Path", apm ); + keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); keyswitchManipulator->selectMatrixManipulator(num); + ++keyForAnimationPath; } }