25 #ifndef WGESWITCHCALLBACK_H
26 #define WGESWITCHCALLBACK_H
35 template <
typename PropType >
57 virtual void operator()( osg::Node* node, osg::NodeVisitor* nv );
67 template <
typename PropType >
74 template <
typename PropType >
80 template <
typename PropType >
84 osg::Switch* s = node->asSwitch();
92 s->setAllChildrenOff();
93 s->setSingleChildOn( m_prop->get() );
This callback is able to switch a osg::Switch node using a property.
virtual ~WGESwitchCallback()
Destructor.
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
This operator gets called by OSG every update cycle.
WGESwitchCallback(PropType prop)
Creates new instance.
PropType m_prop
The prop controlling the node switch.