Changeset 381 for experimental


Ignore:
Timestamp:
Jun 15, 2012, 7:22:30 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/distortionNG
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r380 r381  
    2323#include <osg/Point>
    2424#include <osg/PolygonMode>
     25#include <osg/TextureRectangle>
    2526
    2627#include <osgDB/Registry>
     
    261262                                if( _distortionSet->isDirty() && _viewer.valid())
    262263                                {
    263                                         _viewer->updateDistortion();
     264                                        updateDistortionSetup();
    264265                                }
    265266                                //OSG_ALWAYS<<"..done"<<std::endl;
     
    512513        _highlighter->dirtyBound();
    513514}
     515
     516void DistortionManipulator::updateDistortionSetup()
     517{
     518        updateDistortionViewProjectionMatrix();
     519        updateDistortionMesh();
     520}
     521
     522void DistortionManipulator::updateDistortionViewProjectionMatrix()
     523{
     524        if(!_distortionSet.valid())
     525        {
     526                osg::notify(osg::WARN) << "You cannot update the distortion without distortion set up." << std::endl;
     527                return;
     528        }
     529
     530        if(_viewer.valid())
     531        {
     532                _viewer->getCamera()->setViewMatrix(_distortionSet->getViewOffset());
     533                _viewer->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset());
     534        }
     535        else
     536                OSG_NOTIFY(osg::ALWAYS)<<"Invalid viewer!"<<std::endl;
     537}
     538
     539void DistortionManipulator::updateDistortionMesh()
     540{
     541
     542}
  • experimental/distortionNG/DistortionManipulator.h

    r380 r381  
    8080        void updateHUD();
    8181
     82        void updateDistortionSetup();
     83        void updateDistortionViewProjectionMatrix();
     84        void updateDistortionMesh();
     85
     86
    8287        SetupMode activeSetupMode;
    8388        DistortionMode activeDistortionMode;
     
    9095        osg::ref_ptr<osg::Geometry> _highlighter;
    9196    osg::observer_ptr<osg::Camera> _camera;
    92          osg::observer_ptr<extViewer> _viewer;
     97        osg::observer_ptr<extViewer> _viewer;
    9398        osg::Geometry* _distortionMesh;
    9499        const osg::Vec4 _highlightColor;
  • experimental/distortionNG/extViewer.cpp

    r380 r381  
    397397        setUpViewForManualDistortion(ds);
    398398}
    399 
    400 void extViewer::updateDistortion()
    401 {
    402         if(!_distortionSet.valid())
    403         {
    404                 osg::notify(osg::WARN) << "You cannot update the distortion without distortion set up." << std::endl;
    405                 return;
    406         }
    407 
    408         this->getCamera()->setViewMatrix(_distortionSet->getViewOffset());
    409         this->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset());
    410 }
  • experimental/distortionNG/extViewer.h

    r380 r381  
    5151                void setUpIntensityMapBlending(std::string intensityMap);
    5252
    53                 /**
    54                  * \brief This functions updates the distortion setup by applying the distortionSet values to the viewers distortion setup.
    55                  *
    56                  */
    57                 void updateDistortion();
    5853
    5954                osgViewer::DistortionSet* getDistortionSet()    {return _distortionSet;}
Note: See TracChangeset for help on using the changeset viewer.