|
楼主 |
发表于 2011-7-11 11:18:05
|
显示全部楼层
我想不会有这个问题,可能是您自己的某些代码有问题
array 发表于 2011-7-11 08:29
锐哥,这是我参考osganimationviewer,写的一些代码。我的想法是让两个人物play各自的动作。
但是,运行后只有一个人物在运动。还请您指教:
- osg::Group * walkInSitMale = dynamic_cast<osg::Group*>(osgDB::readNodeFile("f:\\fbxmodels\\m_fight.fbx"));
- root->addChild(setModleWorldPosition(walkInSitMale,16.5,1.7,0.2,0.01,90.0,0.0,-135.0));
- osg::Group * danceFemale = dynamic_cast<osg::Group*>(osgDB::readNodeFile("f:\\fbxmodels\\w_dance.fbx"));
- root->addChild(setModleWorldPosition(danceFemale,10.0,1.5,0.2,0.01,90.0,0.0,0.0));
- AnimationManagerFinder finder,finder1;
- walkInSitMale->accept(finder);
- danceFemale->accept(finder1);
- if (finder._am.valid()) {
- walkInSitMale->setUpdateCallback(finder._am.get());
- //AnimtkViewerModelController::setModel(finder._am.get());
- AnimtkViewerModelController &controller1 = AnimtkViewerModelController::instance();
- controller1.setModel(finder._am.get());
- controller1.play();
- }
- if (finder1._am.valid())
- {
- danceFemale->setUpdateCallback(finder1._am.get());
- AnimtkViewerModelController &controller2 = AnimtkViewerModelController::instance();
- controller2.setModel(finder1._am.get());
- controller2.play();
- }
复制代码 |
|