]> git.mxchange.org Git - flightgear.git/commitdiff
Remove unused switch node.
authorfrohlich <frohlich>
Wed, 18 Mar 2009 07:10:49 +0000 (07:10 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 1 Apr 2009 07:23:53 +0000 (09:23 +0200)
Modified Files:
src/Model/acmodel.cxx src/Model/acmodel.hxx

src/Model/acmodel.cxx
src/Model/acmodel.hxx

index 1f9b15a7e692c8b87607603adccaa71f1bb51f89..9dc98c8e182489906d13bcafae36ca7a6d41c6e3 100644 (file)
@@ -34,7 +34,6 @@
 
 FGAircraftModel::FGAircraftModel ()
   : _aircraft(0),
-    _selector(new osg::Switch),
     _nearplane(0.10f),
     _farplane(1000.0f)
 {
@@ -42,9 +41,10 @@ FGAircraftModel::FGAircraftModel ()
 
 FGAircraftModel::~FGAircraftModel ()
 {
+  osg::Node* node = _aircraft->getSceneGraph();
+  globals->get_scenery()->get_aircraft_branch()->removeChild(node);
+
   delete _aircraft;
-                               // SSG will delete it
-  globals->get_scenery()->get_aircraft_branch()->removeChild(_selector.get());
 }
 
 void 
@@ -63,10 +63,10 @@ FGAircraftModel::init ()
                                            globals->get_props());
     _aircraft->init( model );
   }
-  _selector->addChild(_aircraft->getSceneGraph(), true);
+  osg::Node* node = _aircraft->getSceneGraph();
   // Do not do altitude computations with that model
-  _selector->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
-  globals->get_scenery()->get_aircraft_branch()->addChild(_selector.get());
+  node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
+  globals->get_scenery()->get_aircraft_branch()->addChild(node);
 }
 
 void
index 1ef1f1b9927a2b1e411e65b8767c633e3aab2b4f..ec30be8e8876e9dfdc6c6e5c887cc77e663eebab 100644 (file)
@@ -39,12 +39,10 @@ public:
   virtual void unbind ();
   virtual void update (double dt);
   virtual SGModelPlacement * get3DModel() { return _aircraft; }
-  void select( bool s ) { _selector->setValue( 0, s ); }
 
 private:
 
   SGModelPlacement * _aircraft;
-  osg::ref_ptr<osg::Switch> _selector;
   float _nearplane;
   float _farplane;