Changeset 533


Ignore:
Timestamp:
11/18/10 18:26:02 (18 months ago)
Author:
ddangelo
Message:

Field to get the ViewMatrix? from the osg camera added

Location:
trunk/avango-osg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-osg/include/avango/osg/viewer/Camera.h

    r31 r533  
    9494        SFDouble Near; 
    9595        SFDouble Far; 
    96          
     96 
    9797        /** 
    9898         * Defines the background color. 
    9999         * Default is Vec4(0,0,0,1). 
    100100         */ 
    101         SFVec4 BackgroundColor;  
     101        SFVec4 BackgroundColor; 
    102102 
    103103        /** 
     
    175175         */ 
    176176        SFMatrix ProjectionMatrix; 
     177 
     178        /** 
     179         * Outputs the view matrix (modelview) of the osg camera 
     180         */ 
     181        SFMatrix ViewMatrix; 
    177182 
    178183        /** 
  • trunk/avango-osg/src/avango/osg/viewer/Camera.cpp

    r302 r533  
    127127  AV_FC_ADD_FIELD(Far, 500.0); 
    128128  AV_FC_ADD_FIELD(BackgroundColor, ::osg::Vec4(0.0, 0.0, 0.0, 1.0)); 
    129    
     129 
    130130  AV_FC_ADD_FIELD(ViewerTransform, ::osg::Matrix::translate(0.0, 0.0, 0.6)); 
    131131  AV_FC_ADD_FIELD(ScreenTransform, ::osg::Matrix::translate(0.0, 0.0, -0.6)); 
     
    140140  AV_FC_ADD_FIELD(MouseNearTransform, ::osg::Matrix::identity()); 
    141141  AV_FC_ADD_FIELD(ProjectionMatrix, ::osg::Matrix::identity()); 
     142  AV_FC_ADD_FIELD(ViewMatrix, ::osg::Matrix::identity()); 
     143 
    142144 
    143145  mOsgCamera->setReferenceFrame(::osg::Transform::ABSOLUTE_RF); 
     
    277279                                             ::osg::Matrix::translate(eye_trans.getTrans()) * 
    278280                                             ViewerTransform.getValue())); 
     281      ViewMatrix.setValue(mOsgCamera->getViewMatrix()); 
    279282    } 
    280283  } 
Note: See TracChangeset for help on using the changeset viewer.