Ignore:
Timestamp:
Jun 15, 2012, 7:22:30 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.