The code you send seems to be correct, you just apply the visitor on
GROUP and NODE typed OSG objects. But as I know animation paths can
only be attached to
osg::PositionAttitudeTransform
and
osg::MatrixTransform
so you have to apply the visitor on these type of objects..
Indeed AnimationPath's only make sense for Transform nodes, so just override the NodeVisitor::apply(osg::Transform&)
class MyAnimationVisitor : public osg::NodeVisitor
{
public:
MyAnimationVisitor ():osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{
}
virtual void apply(osg::Transfrom& node)
{
osg::AimationPathcallback* apc = dynamic_cast<osg::AimationPathcallback*>(node.getUpdateCallback());
if (apc)
{
osg::AnimationPath* path = apc->getAnimationPath();
// have an path now up to you what to do with it.
}
traverse(node);
}
};
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
