diff --git a/simgear/scene/model/SGPickAnimation.cxx b/simgear/scene/model/SGPickAnimation.cxx index fdec3316..7b4c4d35 100644 --- a/simgear/scene/model/SGPickAnimation.cxx +++ b/simgear/scene/model/SGPickAnimation.cxx @@ -371,12 +371,12 @@ osg::StateSet* sharedHighlightStateSet() } void -SGPickAnimation::apply(simgear::SGTransientModelData &modelData) +SGPickAnimation::apply(osg::Group& group) { if (_objectNames.empty() && _proxyNames.empty()) { return; } - osg::Group& group = *modelData.getNode()->asGroup(); + group.traverse(*this); // iterate over all group children diff --git a/simgear/scene/model/SGPickAnimation.hxx b/simgear/scene/model/SGPickAnimation.hxx index ab2ae770..580f02a7 100644 --- a/simgear/scene/model/SGPickAnimation.hxx +++ b/simgear/scene/model/SGPickAnimation.hxx @@ -38,8 +38,8 @@ public: SGPickAnimation(simgear::SGTransientModelData &modelData); // override so we can treat object-name specially - virtual void apply(simgear::SGTransientModelData &modelData); - + virtual void apply(osg::Group& group); + void apply(osg::Node* node); protected: diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 7f5cf327..e91bf329 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -490,13 +490,13 @@ SGAnimation::animate(simgear::SGTransientModelData &modelData) anim.apply(modelData); } else if (type == "pick") { SGPickAnimation anim(modelData); - anim.apply(modelData); + anim.apply(modelData.getNode()); } else if (type == "knob") { SGKnobAnimation anim(modelData); - anim.apply(modelData); + anim.apply(modelData.getNode()); } else if (type == "slider") { SGSliderAnimation anim(modelData); - anim.apply(modelData); + anim.apply(modelData.getNode()); } else if (type == "range") { SGRangeAnimation anim(modelData); anim.apply(modelData);