Added a AnimationPathCallback which can update both a MatrixTransform and a
PositionAttitudeTransform, removed the equivialnt callbacks once found in these transform classes. Changed the NodeCallback class so its derived from osg::Object instead of osg::Referenced to allow it to be saved out in the .osg format. Added support for Update and Cull callbacks into the .osg file format. Added support for AnimationPathCallback into the .osg file format.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "osg/MatrixTransform"
|
||||
#include <osg/MatrixTransform>
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
@@ -68,22 +68,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -94,10 +78,5 @@ bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
fw.writeObject(transform.getMatrix());
|
||||
|
||||
if (transform.getAnimationPath())
|
||||
{
|
||||
fw.writeObject(*transform.getAnimationPath());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user