Added supported for setting animation path on MatrixTransform's.

This commit is contained in:
Robert Osfield
2002-12-16 09:55:30 +00:00
parent 22ada7ee6b
commit c6b6e200a4
7 changed files with 291 additions and 3 deletions

View File

@@ -68,6 +68,22 @@ bool MatrixTransform_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
if (fr[0].matchWord("AnimationPath"))
{
static osg::ref_ptr<osg::AnimationPath> prototype = new osg::AnimationPath;
osg::ref_ptr<osg::Object> object = fr.readObjectOfType(*prototype);
osg::AnimationPath* path = dynamic_cast<osg::AnimationPath*>(object.get());
if (path)
{
transform.setAnimationPath(path);
}
else
{
osg::Node* node = dynamic_cast<osg::Node*>(object.get());
if (node) transform.addChild(node);
}
}
return iteratorAdvanced;
}
@@ -78,5 +94,10 @@ bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
fw.writeObject(transform.getMatrix());
if (transform.getAnimationPath())
{
fw.writeObject(*transform.getAnimationPath());
}
return true;
}