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

@@ -18,7 +18,6 @@
#include <osg/MatrixTransform>
#include <osgUtil/SmoothingVisitor>
#include <osgUtil/TransformCallback>
class PBufferTexture2D : public osg::Texture2D
@@ -239,7 +238,7 @@ osg::ref_ptr<osg::Node> buildSceneGraphAndSetCameraViews(osg::Node *loadedModel,
osg::ref_ptr<osg::MatrixTransform> loadedModelTransform = new osg::MatrixTransform;
loadedModelTransform->addChild(loadedModel);
osg::ref_ptr<osg::NodeCallback> nc = new osgUtil::TransformCallback(
osg::ref_ptr<osg::NodeCallback> nc = new osg::AnimationPathCallback(
loadedModelTransform->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f));
loadedModelTransform->setUpdateCallback(nc.get());
@@ -269,7 +268,7 @@ osg::ref_ptr<osg::Node> buildSceneGraph(osg::Node *loadedModel, Producer::Render
osg::ref_ptr<osg::MatrixTransform> loadedModelTransform = new osg::MatrixTransform;
loadedModelTransform->addChild(loadedModel);
osg::ref_ptr<osg::NodeCallback> nc = new osgUtil::TransformCallback(
osg::ref_ptr<osg::NodeCallback> nc = new osg::AnimationPathCallback(
loadedModelTransform->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f));
loadedModelTransform->setUpdateCallback(nc.get());