Ignore:
Timestamp:
Jul 7, 2012, 12:35:22 PM (12 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/distortionNG
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r397 r398  
    533533        {
    534534                // Get slave struct to update the offset matrixes.
    535                 int slaveIndex = _viewer->findSlaveIndexForCamera( _viewer->getCamera() );
    536 
    537                 _viewer->getSlave( slaveIndex )._projectionOffset = _distortionSet->getProjectionOffset();
    538                 _viewer->getSlave( slaveIndex )._viewOffset = _distortionSet->getViewOffset();
     535                osgViewer::View::Slave* sceneSlave = _viewer->findSlaveForCamera( _distortionSet->getSceneCamera() );
     536
     537                sceneSlave->_projectionOffset = _distortionSet->getProjectionOffset();
     538                sceneSlave->_viewOffset = _distortionSet->getViewOffset();
    539539
    540540
  • experimental/distortionNG/DistortionSet.cpp

    r392 r398  
    4040        _showIntesityMapMapOnly = false;
    4141
    42         _camera = NULL;
     42        _sceneCamera = NULL;
     43        _distortionCamera = NULL;
    4344        _distortionInternals = NULL;
    4445
  • experimental/distortionNG/DistortionSet.h

    r383 r398  
    6464        bool& getShowIntensityMapOnlyAsRef()    { return _showIntesityMapMapOnly;}
    6565
    66         void setDistortionCamera(osg::Camera* camera)   { _camera = camera;}
    67         osg::Camera* getDistortionCamera()      { return _camera.get(); }
     66        void setSceneCamera(osg::Camera* camera)        { _sceneCamera = camera;}
     67        osg::Camera* getSceneCamera()   { return _sceneCamera.get(); }
     68
     69        void setDistortionCamera(osg::Camera* camera)   { _distortionCamera = camera;}
     70        osg::Camera* getDistortionCamera()      { return _distortionCamera.get(); }
    6871
    6972        osg::Switch* getDistortionInternals()   { return _distortionInternals; }
     
    129132        // These variable are therefor not saved/restored by the serializer but populated on runtime.
    130133        bool _showIntesityMapMapOnly;   // Intensity Blending is done by a frag shader. To control it on runtime, the uniform must be bound to a central variable.
    131         osg::observer_ptr<osg::Camera> _camera; // is used to pass the distortion cam from osgViewers setupDistortion() method to the manipulator.
     134        osg::observer_ptr<osg::Camera> _sceneCamera;    // us used to pass the scene camera to the manipulator to allow matrix changes of the camera
     135        osg::observer_ptr<osg::Camera> _distortionCamera;       // is used to pass the distortion cam from osgViewers setupDistortion() method to the manipulator.
    132136        osg::ref_ptr<osg::Switch> _distortionInternals; // definition: child #0 = mesh, #1 = highlighter, #2 HUD
    133137
  • experimental/distortionNG/extViewer.cpp

    r394 r398  
    259259        camera->attach(osg::Camera::COLOR_BUFFER, sceneTexture);
    260260
     261                _distortionSet->setSceneCamera( camera );
     262
    261263        addSlave(camera.get(), _distortionSet->getProjectionOffset(), _distortionSet->getViewOffset() );
    262264
  • experimental/distortionNG/shaderIntensityMap.frag

    r396 r398  
    77{
    88        vec4 blendColor = texture2DRect(intensityMapTexture, gl_FragCoord);
    9         //vec4 blendColor = texture2DRect(intensityMapTexture, texCoord);
    10        
    119        gl_FragColor = blendColor * texture2DRect( sceneTexture, texCoord) ;
    1210}
Note: See TracChangeset for help on using the changeset viewer.