From 848d850328ae6e2c001bcf28b2cd7d65e06bb6f5 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 24 Jun 2007 07:52:50 +0000 Subject: [PATCH] Tim MOORE: addCamera() method (needed by og_gauge) --- src/Main/renderer.cxx | 9 ++++++++- src/Main/renderer.hxx | 13 +++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) 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; -- 2.39.5