|
楼主 |
发表于 2010-6-17 10:04:23
|
显示全部楼层
2# aya_daxiang
谢谢!这个例子我已看过,现在DOF节点我已能实现运动控制,主要是想在xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0,1.0));这一句中替换回调即
xform->setUpdateCallback(new MoveObjectForward(animationPath,0.0,1.0)
class MoveObjectForward:public osg::AnimationPathCallback
{
public:
MoveObjectForward::MoveObjectForward(osg::ref_ptr<osg::AnimationPath> animationPath,double timeoffset=0.0, double timeMultiplier=1.0)
{
t1=0;
this->setAnimationPath(animationPath.get());
this->setTimeOffset(timeoffset);
this->setTimeMultiplier(timeMultiplier);
}
}
这样车子就无法运动了,即不沿预定路径移动了。这是为什么呢?谢谢! |
|