Remove unused switch node.
Modified Files: src/Model/acmodel.cxx src/Model/acmodel.hxx
This commit is contained in:
parent
3cdd8fedf6
commit
5af98c0063
2 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue