my very old code used osg::AnimationPathCallback
.....
class FindAnimationVisitor : public osg::NodeVisitor
{
public:
FindAnimationVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{
//apc=NULL;
setTraversalMask(0xffffffff);
setNodeMaskOverride(0xffffffff);
}
//найденные анимации
typedef std::vector< osg::ref_ptr<osg::AnimationPathCallback> > NodeList;
NodeList _foundNodes;
//и соответственно объекты, содержащие эти самые анимации
typedef std::vector< osg::ref_ptr<osg::Transform> > TransformList;
TransformList _foundTransforms;
virtual void apply(osg::Transform& node);
virtual void apply(osg::Group& group);
/*
virtual void apply(osg::MatrixTransform& node);
virtual void apply(osg::AnimationPathCallback& node);
*/
private:
//Путь анимации
//osg::ref_ptr<osg::AnimationPathCallback> apc;
};
void FindAnimationVisitor::apply(osg::Transform& node)
{
//apc =
dynamic_cast<osg::AnimationPathCallback*>(node.getUpdateCallback());
osg::ref_ptr<osg::AnimationPathCallback> test =
dynamic_cast<osg::AnimationPathCallback*>(node.getUpdateCallback());
if (test.get())
{
//std::cout << "I find animation!!!!";
//Запоминаем анимацию
_foundNodes.push_back
(dynamic_cast<osg::AnimationPathCallback*>(node.getUpdateCallback()));
//и объект к которому она прикреплена
_foundTransforms.push_back (&node);
}
traverse(node);
}
void FindAnimationVisitor::apply(osg::Group& group)
{
traverse(group);
}
2013-09-30 6:18 GMT+06:00 Maxim Voloshin <[email protected]>:
> Hi, everyone
>
> I am new in OSG and have a problem. I wrote the code that plays animation
> in .fbx models, but I can't play animation in .osgb(.osgt, .ive) models.
> Please see the attached file and help me.
>
> P.S. Sorry for the clumsy English(
>
> Thank you!
>
> Cheers,
> Maxim Voloshin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=56536#56536
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
--
Maxim Gammer
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org