From: mfranz Date: Sun, 24 Jun 2007 07:52:50 +0000 (+0000) Subject: Tim MOORE: addCamera() method (needed by og_gauge) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=848d850328ae6e2c001bcf28b2cd7d65e06bb6f5;p=flightgear.git Tim MOORE: addCamera() method (needed by og_gauge) --- diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index b4dcbc9e7..87e8932c1 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -1048,7 +1048,14 @@ FGRenderer::pick( unsigned x, unsigned y, } } -bool fgDumpSceneGraphToFile(const char* filename) +void +FGRenderer::addCamera(osg::Camera* camera, bool useSceneData) +{ + mRealRoot->addChild(camera); +} + +bool +fgDumpSceneGraphToFile(const char* filename) { return osgDB::writeNodeFile(*mRealRoot.get(), filename); } diff --git a/src/Main/renderer.hxx b/src/Main/renderer.hxx index ea14d3534..3fb7e0f83 100644 --- a/src/Main/renderer.hxx +++ b/src/Main/renderer.hxx @@ -6,6 +6,7 @@ #include #include +#include #include #include "FGManipulator.hxx" @@ -66,10 +67,14 @@ public: */ FGManipulator* getManipulator() { return manipulator.get(); } const FGManipulator* getManipulator() const { return manipulator.get(); } - void setManipulator(FGManipulator* manipulator) - { - this->manipulator = manipulator; - } + void setManipulator(FGManipulator* manipulator) { + this->manipulator = manipulator; + } + + /** Add a top level camera. + */ + void addCamera(osg::Camera* camera, bool useSceneData); + protected: osg::ref_ptr viewer; osg::ref_ptr manipulator;