Show
Ignore:
Timestamp:
11/27/06 15:52:07 (7 years ago)
Author:
robert
Message:

Renamed osg::CameraNode? to osg::Camera, cleaned up osg::View.

Added beginnings of new osgViewer::Scene,View,Viewer,CompositeViewer? and GraphicsWindowProxy? files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgprerendercubemap/osgprerendercubemap.cpp

    r5381 r5757  
    1919#include <osg/PositionAttitudeTransform> 
    2020 
    21 #include <osg/CameraNode> 
     21#include <osg/Camera> 
    2222#include <osg/TexGenNode> 
    2323 
     
    112112    public: 
    113113     
    114         typedef std::vector< osg::ref_ptr<osg::CameraNode> >  CameraList; 
    115  
    116         UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& cameraNodes): 
     114        typedef std::vector< osg::ref_ptr<osg::Camera> >  CameraList; 
     115 
     116        UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& Cameras): 
    117117            _reflectorNodePath(reflectorNodePath), 
    118             _cameraNodes(cameraNodes) 
     118            _Cameras(Cameras) 
    119119        { 
    120120        } 
     
    142142 
    143143            for(unsigned int i=0;  
    144                 i<6 && i<_cameraNodes.size(); 
     144                i<6 && i<_Cameras.size(); 
    145145                ++i) 
    146146            { 
     
    150150                osg::Matrix viewMatrix = worldToLocal*localOffset; 
    151151             
    152                 _cameraNodes[i]->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF); 
    153                 _cameraNodes[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0); 
    154                 _cameraNodes[i]->setViewMatrix(viewMatrix); 
     152                _Cameras[i]->setReferenceFrame(osg::Camera::ABSOLUTE_RF); 
     153                _Cameras[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0); 
     154                _Cameras[i]->setViewMatrix(viewMatrix); 
    155155            } 
    156156        } 
     
    161161         
    162162        osg::NodePath               _reflectorNodePath;         
    163         CameraList                  _cameraNodes; 
     163        CameraList                  _Cameras; 
    164164}; 
    165165 
     
    192192 
    193193 
    194 osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::CameraNode::RenderTargetImplementation renderImplementation) 
     194osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::Camera::RenderTargetImplementation renderImplementation) 
    195195{ 
    196196 
     
    208208     
    209209    // set up the render to texture cameras. 
    210     UpdateCameraAndTexGenCallback::CameraList cameraNodes; 
     210    UpdateCameraAndTexGenCallback::CameraList Cameras; 
    211211    for(unsigned int i=0; i<6; ++i) 
    212212    { 
    213213        // create the camera 
    214         osg::CameraNode* camera = new osg::CameraNode; 
     214        osg::Camera* camera = new osg::Camera; 
    215215 
    216216        camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     
    221221 
    222222        // set the camera to render before the main camera. 
    223         camera->setRenderOrder(osg::CameraNode::PRE_RENDER); 
     223        camera->setRenderOrder(osg::Camera::PRE_RENDER); 
    224224 
    225225        // tell the camera to use OpenGL frame buffer object where supported. 
     
    227227 
    228228        // attach the texture and use it as the color buffer. 
    229         camera->attach(osg::CameraNode::COLOR_BUFFER, texture, 0, i); 
     229        camera->attach(osg::Camera::COLOR_BUFFER, texture, 0, i); 
    230230 
    231231        // add subgraph to render 
     
    234234        group->addChild(camera); 
    235235         
    236         cameraNodes.push_back(camera); 
     236        Cameras.push_back(camera); 
    237237    } 
    238238    
     
    265265     
    266266    // set an update callback to keep moving the camera and tex gen in the right direction. 
    267     group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, cameraNodes)); 
     267    group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, Cameras)); 
    268268 
    269269    return group; 
     
    308308    while (arguments.read("--height", tex_height)) {} 
    309309 
    310     osg::CameraNode::RenderTargetImplementation renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; 
    311      
    312     while (arguments.read("--fbo")) { renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; } 
    313     while (arguments.read("--pbuffer")) { renderImplementation = osg::CameraNode::PIXEL_BUFFER; } 
    314     while (arguments.read("--fb")) { renderImplementation = osg::CameraNode::FRAME_BUFFER; } 
    315     while (arguments.read("--window")) { renderImplementation = osg::CameraNode::SEPERATE_WINDOW; } 
     310    osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; 
     311     
     312    while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } 
     313    while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } 
     314    while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } 
     315    while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } 
    316316     
    317317