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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user