|
我在osgocean中添加了一个悬浮菜单如下图所示
,点击上面的ishelicopter,在海洋上空显示直升机,但是点击菜单后,不执行加载直升机的那条语句,请各位大侠帮我看看是怎么回事?
我在FFToceansurface中添加了如下代码:
osg::ref_ptr<osg::Group>gHelicopterNode;
void FFTOceanSurface::update函数中添加了
else if( frame != _oldFrame )
{
if (twGUI->getishelicopter()==true)
if (twGUI->getishelicopter()!=oldIsHelicopter)
{
gHelicopterNode=new osg::Group;
gHelicopterNode->addChild(osgDB::readNodeFile("F:\doctor study\Osgocean\osgOcean-Source-1.0.1\osgocean\resources\helicopter\wzs.osg"));
std::cout<<"tttttttttttttt"<<std::endl;
}
点击菜单,控制台输出语句就能执行,但是不加载模型,不知道什么原因,我在oceanscene里也添加了直升机节点。
_oceanTransform->addChild(gHelicopterNode.get());
请各位大侠不吝赐教! |
|