Changeset 91


Ignore:
Timestamp:
Jun 2, 2005, 12:17:57 PM (19 years ago)
Author:
darran
Message:
 
Location:
Swollen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Swollen/swollen/main.cpp

    r88 r91  
    1212#include <osg/PositionAttitudeTransform>
    1313#include <osg/StateAttribute>
     14#include <osgProducer/Viewer>
    1415
    1516#include <project.h>
    1617#include <SWWReader.h>
    1718#include <bedslope.h>
    18 #include <customviewer.h>
    1919#include <hud.h>
    2020#include <keyboardeventhandler.h>
     
    5050
    5151    // construct the viewer.
    52     CustomViewer viewer(arguments);
     52    osgProducer::Viewer viewer(arguments);
    5353
    5454    // set up with sensible default event handlers
    5555    viewer.setUpViewer( osgProducer::Viewer::STANDARD_SETTINGS );
    5656    viewer.setClearColor( osg::Vec4(DEF_BACKGROUND_COLOUR) );
    57     viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200,300,800,600);
     57    //viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200,300,800,600);
    5858    viewer.getCullSettings().setComputeNearFarMode( osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES );
    5959
     
    109109
    110110
    111 
    112111    // root node
    113112    osg::Group* rootnode = new osg::Group;
     
    176175
    177176    // initial camera position
    178     CustomTerrainManipulator* terrainmanipulator = viewer.getTerrainManipulator();
    179     terrainmanipulator->setNode( model );
    180     terrainmanipulator->setAutoComputeHomePosition( false );
    181     terrainmanipulator->setHomePosition(
    182         osg::Vec3d(0,-3,0),    // camera location
    183         osg::Vec3d(0,0,0),     // camera target
    184         osg::Vec3d(0,0,1) );   // camera up vector
    185     terrainmanipulator->moveToHome();
    186     terrainmanipulator->enable();
     177    //CustomTerrainManipulator* terrainmanipulator = viewer.getTerrainManipulator();
     178    //terrainmanipulator->setNode( model );
     179    //terrainmanipulator->setAutoComputeHomePosition( false );
     180    //terrainmanipulator->setHomePosition(
     181    //    osg::Vec3d(0,-3,0),    // camera location
     182    //    osg::Vec3d(0,0,0),     // camera target
     183    //    osg::Vec3d(0,0,1) );   // camera up vector
     184    //terrainmanipulator->moveToHome();
     185    //terrainmanipulator->enable();
    187186
    188187
     
    227226            water->toggleWireframe();
    228227
    229         // click-mouse movement can change either camera view or scene light position
     228        // click-mouse movement can change either camera view or scene light position
    230229        if( event_handler->toggleManipulatorMode() )
    231         {
    232         }
     230        {
     231        }
    233232       
    234233
    235        // update the scene by traversing with the update visitor
     234        // update the scene by traversing with the update visitor
    236235        viewer.update();
    237236         
    238237        // fire off the cull and draw traversals of the scene.
    239238        viewer.frame();
    240         //pcam1->frame(false);
    241         //pcam2->frame();
    242 
    243239    }
    244240   
Note: See TracChangeset for help on using the changeset viewer.