-
osg::AnimationPath * animationPath = new osg::AnimationPath;
// 设置循环,还可设成摇摆:SWING 或仅动作1次:NO_LOOPING
animationPath -> setLoopMode(osg::AnimationPath::LOOP);
// 插入时间,和对应的位置和角度
animationPath -> insert(time,osg::AnimationPath::ControlPoint(position,rotation));
// 设置回调,第二个参数是延迟时间,第三个参数是和时间相乘,可加快和减缓速度
xform -> setUpdateCallback( new osg::AnimationPathCallback(animationPath, 0.0 , 1.0 ));
- osg::AnimationPathCallback用法(Examples osgclip)
osg::AnimationPathCallback::AnimationPathCallback ( const osg::Vec3d & pivot,
const osg::Vec3d & axis,
float angularVelocity
)
osg::MatrixTransform * transform = new osg::MatrixTransform;
osg::NodeCallback * nc = new osg::AnimationPathCallback(subgraph -> getBound().center(),osg::Vec3( 0.0f , 0.0f , 1.0f ),osg::inDegrees( 45.0f ));
transform -> setUpdateCallback(nc);
transform -> addChild(clipnode);
osg::AnimationPath osg::AnimationPath::ControlPoint osg::AnimationPathCallback
最新推荐文章于 2023-11-23 18:50:05 发布