Added the support in AnimationPathCallback for taking a pivot, axis and rotation rate

paramters in its constructor to allow it to be used to create rotations around a point.
This provides the same interface and functionality as osgUtil::TransformCallback but
has the advantage and AnimationPathCallback is fully supported by the .osg and .ive file formats.
This commit is contained in:
Robert Osfield
2005-11-09 15:11:22 +00:00
parent ac0a6a6ac5
commit 83d492162e
13 changed files with 48 additions and 23 deletions

View File

@@ -15,7 +15,6 @@
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgUtil/TransformCallback>
#include <osgUtil/SmoothingVisitor>
#include <osgDB/Registry>
@@ -450,7 +449,7 @@ int main( int argc, char **argv )
osg::MatrixTransform* loadedModelTransform = new osg::MatrixTransform;
loadedModelTransform->addChild(loadedModel);
osg::NodeCallback* nc = new osgUtil::TransformCallback(loadedModelTransform->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f));
osg::NodeCallback* nc = new osg::AnimationPathCallback(loadedModelTransform->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f));
loadedModelTransform->setUpdateCallback(nc);
osg::Group* rootNode = new osg::Group();