|
本帖最后由 diorlv2010 于 2012-3-12 15:03 编辑
- Follow(osg::ref_ptr<osgViewer::Viewer> vv)
- {
- _position=osg::Vec3(0.0,0.0,2.0);
- _rotation=osg::Vec3(osg::PI_2,0.0f,0.0f);
- _moveSpeed=2.0;
- _mangle=2.5;
- _position=osg::Vec3(0.0,0.0,0.0);
- mt=CreatMT();
- viewer=vv;
- if (viewer)
- {
- viewer->setSceneData()->asGroup()->addChild(mt);
- }
- }
复制代码 这块编译的时候报错:
2>MapBar.cpp(40): error C2660: “osgViewer::Viewer::setSceneData”: 函数不接受 0 个参数
2>MapBar.cpp(40): error C2227: “->asGroup”的左边必须指向类/结构/联合/泛型类型
2>MapBar.cpp(40): error C2227: “->addChild”的左边必须指向类/结构/联合/泛型类型
首先viewer我声明私有变量的时候是声明成超级指针的,谁遇到过这种情况
osg::ref_ptr<osgViewer::Viewer> viewer;
我用的osg3.0环境 |
|