|
楼主 |
发表于 2008-11-25 21:26:57
|
显示全部楼层
// 把漫游加入到场景之中,静态成员
TravelManipulator * TravelManipulator::TravelScene(osg::ref_ptr <osgProducer::Viewer> viewer)
{
//可以获得并使用系统提供的浏览方式
TravelManipulator* camera = new TravelManipulator;
//选择一种浏览方式
camera->m_nID = viewer->addCameraManipulator(camera);
//TEMP
camera->m_pHostViewer = viewer;
return camera;
}
//-----------------------------------------------------------------//------------------------------------------------------------
//激活所选的漫游方式
void TravelManipulator::Active(void)
{
m_pHostViewer->selectCameraManipulator(m_nID);
}
请解释一下camera->m_nID = viewer->addCameraManipulator(camera);和m_pHostViewer->selectCameraManipulator(m_nID);为什么我这里老是编译错误, |
|