void operator()(osg::Node* node, osg::NodeVisitor* nv) { if(!_motion.valid()) return; osg::MatrixTransform* mt = dynamic_cast<osg::MatrixTransform*>(node); if(!mt) return; double t = nv->getFrameStamp()->getSimulationTime(); // This avoids a little glitch when the animation doesn't start right away // when the application is launched. if(_previous == 0.0f) _previous = t; _motion->update(t - _previous); _previous = t; mt->setMatrix(osg::Matrix::translate(_pos * _motion->getValue())); }