|
1主相机和从相机有继承关系吗?
2既然新建一个相机作为主camera 但为什么用addSlave把他加到mViewer中,addSlave不是加从属相机的吗
主相机需要new吗。getCamera()就行了吧。从属相机与主相机是什么关系啊。
// Init a new Camera (Master for this View)
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
// Assign Graphics Context to the Camera
camera->setGraphicsContext(gc);
// Set the viewport for the Camera
camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height));
// Add the Camera to the Viewer
mViewer->addSlave(camera.get());
// Add the Camera Manipulator to the Viewer
mViewer->setCameraManipulator(keyswitchManipulator.get());
// Set the Scene Data
mViewer->setSceneData(mRoot.get()); |
|