为什么可以控制模型运动,而不能用在粒子系统上?????? 错误在哪里,请高手指点 #include <osgDB/ReadFile> #include <osgViewer/Viewer>
osgViewer::Viewer viewer;
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::ref_ptr<osg::Node> tank = new osg::Node;
osg::ref_ptr<osg::Node> qiwu = new osg::Node;
osg::ref_ptr<osg::Node> terrain = new osg::Node;
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform;
tank = osgDB::readNodeFile("cessna.osg");
od.m_VecPosition .set (0,0,7) ;
trans->addChild(od.CreateConduit(root.get()));//这里只能显示粒子系统,不能控制它运动??
root->addChild(trans.get()) ;
trans->addChild(tank.get());
//可以控制模型的运动
root->addChild(trans.get());
viewer.setSceneData(root.get());
viewer.addEventHandler(new UseEventHandler(trans.get()));
}
|