|
制作漫游路径时设置了循环模式为animationPath->setLoopMode(osg::AnimationPath::NO_LOOPING);
按键R实现播放路径漫游
if (ea.getKey()=='r')
{
osg::ref_ptr<osg::AnimationPath> animationPath=new osg::AnimationPath();
animationPath=createAnimationPath(BSpline2Point,BSpline2Point->getNumElements());
animationPath->setLoopMode(osg::AnimationPath::NO_LOOPING);
std::string fileName("F:\\test\\testOsg_Xiamen\\201212\\Res\\animation_xq.path");
std:fstream out(fileName.c_str());
animationPath->write(out);
osg::ref_ptr<osgGA::AnimationPathManipulator> apm = new osgGA::AnimationPathManipulator("F:\\test\\testOsg_Xiamen\\201212\\Res\\animation_xq.path");
//viewer->setCameraManipulator(apm.get());
keyswitchManipulator->addMatrixManipulator('2',"amp",apm);
}
但是,路径漫游依旧循环播放,这是为什么? |
|