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

@@ -19,8 +19,6 @@
#include <osg/RefNodePath>
#include <osg/PositionAttitudeTransform>
#include <osgUtil/TransformCallback>
#include <osg/CameraNode>
#include <osg/TexGenNode>
@@ -36,13 +34,13 @@ ref_ptr<Group> _create_scene()
ref_ptr<Geode> geode_2 = new Geode;
ref_ptr<MatrixTransform> transform_2 = new MatrixTransform;
transform_2->addChild(geode_2.get());
transform_2->setUpdateCallback(new osgUtil::TransformCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(45.0f)));
transform_2->setUpdateCallback(new osg::AnimationPathCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(45.0f)));
scene->addChild(transform_2.get());
ref_ptr<Geode> geode_3 = new Geode;
ref_ptr<MatrixTransform> transform_3 = new MatrixTransform;
transform_3->addChild(geode_3.get());
transform_3->setUpdateCallback(new osgUtil::TransformCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(-22.5f)));
transform_3->setUpdateCallback(new osg::AnimationPathCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(-22.5f)));
scene->addChild(transform_3.get());
const float radius = 0.8f;