#include <OSGMatrixCamera.h>
Inheritance diagram for osg::MatrixCamera:

Public Types | |
| typedef MatrixCameraPtr | Ptr |
| enum | { ProjectionMatrixFieldId = Inherited::NextFieldId, ModelviewMatrixFieldId = ProjectionMatrixFieldId + 1, NextFieldId = ModelviewMatrixFieldId + 1 } |
Public Member Functions | |
transformation | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
your_category | |
| *virtual void | draw (DrawAction *action, const Viewport &port) |
| virtual void | getProjection (Matrix &result, UInt32 width, UInt32 height) |
| virtual void | getViewing (Matrix &result, UInt32 width, UInt32 height) |
dump | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFMatrix * | getSFProjectionMatrix (void) |
| Get the MatrixCamera::_sfProjectionMatrix field. | |
| SFMatrix * | getSFModelviewMatrix (void) |
| Get the MatrixCamera::_sfModelviewMatrix field. | |
| Matrix & | getProjectionMatrix (void) |
| Get the value of the MatrixCamera::_sfProjectionMatrix field. | |
| const Matrix & | getProjectionMatrix (void) const |
| Get the value of the MatrixCamera::_sfProjectionMatrix field. | |
| Matrix & | getModelviewMatrix (void) |
| Get the value of the MatrixCamera::_sfModelviewMatrix field. | |
| const Matrix & | getModelviewMatrix (void) const |
| Get the value of the MatrixCamera::_sfModelviewMatrix field. | |
Field Set | |
| *void | setProjectionMatrix (const Matrix &value) |
| Set the value of the MatrixCamera::_sfProjectionMatrix field. | |
| void | setModelviewMatrix (const Matrix &value) |
| Set the value of the MatrixCamera::_sfModelviewMatrix field. | |
Binary Access | |
| *virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Copy | |
| *virtual FieldContainerPtr | shallowCopy (void) const |
Setup Rendering | |
| *virtual void | setup (DrawActionBase *action, const Viewport &port) |
| virtual void | setupProjection (DrawActionBase *action, const Viewport &port) |
Access Parameters | |
| virtual void | getProjectionTranslation (Matrix &result, UInt32 width, UInt32 height) |
| virtual void | getFrustum (FrustumVolume &result, const Viewport &port) |
| virtual void | getWorldToScreen (Matrix &result, const Viewport &port) |
Intersection Helper | |
| *bool | calcViewRay (Line &line, Int32 x, Int32 y, const Viewport &port) |
Field Get | |
| *virtual SFNodePtr * | getSFBeacon (void) |
| virtual SFReal32 * | getSFNear (void) |
| virtual SFReal32 * | getSFFar (void) |
| virtual NodePtr & | getBeacon (void) |
| virtual const NodePtr & | getBeacon (void) const |
| virtual Real32 & | getNear (void) |
| virtual const Real32 & | getNear (void) const |
| virtual Real32 & | getFar (void) |
| virtual const Real32 & | getFar (void) const |
Field Set | |
| *virtual void | setBeacon (const NodePtr &value) |
| virtual void | setNear (const Real32 &value) |
| virtual void | setFar (const Real32 &value) |
Static Public Member Functions | |
Class Get | |
| *static const char * | getClassname (void) |
Class Get | |
| *static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| *static MatrixCameraPtr | create (void) |
| create a new instance of the class | |
| static MatrixCameraPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | ProjectionMatrixFieldMask |
| static const osg::BitVector | ModelviewMatrixFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | BeaconFieldMask |
| static const osg::BitVector | NearFieldMask |
| static const osg::BitVector | FarFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
Constructors | |
| * | MatrixCamera (void) |
| MatrixCamera (const MatrixCamera &source) | |
Destructors | |
| *virtual | ~MatrixCamera (void) |
Sync | |
| *void | executeSyncImpl (MatrixCameraBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Sync | |
| *void | executeSyncImpl (CameraBase *pOther, const BitVector &whichField) |
Protected Attributes | |
Fields | |
| *SFMatrix | _sfProjectionMatrix |
| SFMatrix | _sfModelviewMatrix |
Fields | |
| *SFNodePtr | _sfBeacon |
| SFReal32 | _sfNear |
| SFReal32 | _sfFar |
Private Types | |
| typedef MatrixCameraBase | Inherited |
Private Member Functions | |
| void | operator= (const MatrixCamera &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
Friends | |
| class | FieldContainer |
| class | MatrixCameraBase |
The used matrices are stored in the _sfModelviewMatrix and _sfProjectionMatrix Fields.
Definition at line 60 of file OSGMatrixCamera.h.
|
|
Reimplemented from osg::MatrixCameraBase. Definition at line 121 of file OSGMatrixCamera.h. |
|
|
Reimplemented from osg::CameraBase. Definition at line 91 of file OSGMatrixCameraBase.h. |
|
|
Reimplemented from osg::CameraBase. Definition at line 93 of file OSGMatrixCameraBase.h. 00094 { 00095 ProjectionMatrixFieldId = Inherited::NextFieldId, 00096 ModelviewMatrixFieldId = ProjectionMatrixFieldId + 1, 00097 NextFieldId = ModelviewMatrixFieldId + 1 00098 };
|
|
|
Definition at line 88 of file OSGMatrixCamera.cpp. 00088 : 00089 Inherited() 00090 { 00091 }
|
|
|
Definition at line 93 of file OSGMatrixCamera.cpp. 00093 : 00094 Inherited(source) 00095 { 00096 }
|
|
|
Definition at line 98 of file OSGMatrixCamera.cpp.
|
|
|
Reimplemented from osg::Camera. Definition at line 70 of file OSGMatrixCamera.h.
|
|
||||||||||||
|
Reimplemented from osg::Camera. Definition at line 102 of file OSGMatrixCamera.cpp. References osg::Camera::changed(). 00103 { 00104 Inherited::changed(whichField, origin); 00105 }
|
|
||||||||||||
|
Draw the camera's geometry (if any). Usually there is none. Reimplemented from osg::Camera. Definition at line 115 of file OSGMatrixCamera.cpp.
|
|
||||||||||||||||
|
Get/calculate the projection matrix for this camera. Reimplemented from osg::Camera. Definition at line 120 of file OSGMatrixCamera.cpp. References osg::MatrixCameraBase::getProjectionMatrix(). 00122 { 00123 result = getProjectionMatrix(); 00124 }
|
|
||||||||||||||||
|
Get/calculate the viewing matrix for this camera. This is the inverse of the beacon's toWorld transformation. Reimplemented from osg::Camera. Definition at line 126 of file OSGMatrixCamera.cpp. References osg::MatrixCameraBase::getModelviewMatrix(). 00128 { 00129 result = getModelviewMatrix(); 00130 }
|
|
||||||||||||
|
Reimplemented from osg::Camera. Definition at line 109 of file OSGMatrixCamera.cpp. References SLOG. 00111 { 00112 SLOG << "Dump MatrixCamera NI" << std::endl; 00113 }
|
|
|
Reimplemented from osg::Camera. Definition at line 78 of file OSGMatrixCamera.cpp.
|
|
|
|
|
|
Reimplemented from osg::CameraBase. Definition at line 58 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_type. Referenced by osg::MatrixCameraBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::CameraBase. Definition at line 65 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::CameraBase. Definition at line 117 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_type. 00118 { 00119 return _type; 00120 }
|
|
|
Reimplemented from osg::CameraBase. Definition at line 122 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_type. 00123 { 00124 return _type; 00125 }
|
|
|
Reimplemented from osg::CameraBase. Definition at line 137 of file OSGMatrixCameraBase.cpp. 00138 { 00139 return sizeof(MatrixCamera); 00140 }
|
|
|
Definition at line 101 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfProjectionMatrix. 00102 { 00103 return &_sfProjectionMatrix; 00104 }
|
|
|
Definition at line 108 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfModelviewMatrix. 00109 { 00110 return &_sfModelviewMatrix; 00111 }
|
|
|
Definition at line 116 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfProjectionMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by getProjection(). 00117 { 00118 return _sfProjectionMatrix.getValue(); 00119 }
|
|
|
Definition at line 123 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfProjectionMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00124 { 00125 return _sfProjectionMatrix.getValue(); 00126 }
|
|
|
Definition at line 137 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfModelviewMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by getViewing(). 00138 { 00139 return _sfModelviewMatrix.getValue(); 00140 }
|
|
|
Definition at line 144 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfModelviewMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00145 { 00146 return _sfModelviewMatrix.getValue(); 00147 }
|
|
|
Definition at line 130 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfProjectionMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00131 { 00132 _sfProjectionMatrix.setValue(value); 00133 }
|
|
|
Definition at line 151 of file OSGMatrixCameraBase.inl. References osg::MatrixCameraBase::_sfModelviewMatrix, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00152 { 00153 _sfModelviewMatrix.setValue(value); 00154 }
|
|
|
Reimplemented from osg::CameraBase. Definition at line 201 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_sfModelviewMatrix, osg::MatrixCameraBase::_sfProjectionMatrix, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::CameraBase::getBinSize(), osg::MatrixCameraBase::ModelviewMatrixFieldMask, osg::FieldBits::NoField, and osg::MatrixCameraBase::ProjectionMatrixFieldMask. 00202 { 00203 UInt32 returnValue = Inherited::getBinSize(whichField); 00204 00205 if(FieldBits::NoField != (ProjectionMatrixFieldMask & whichField)) 00206 { 00207 returnValue += _sfProjectionMatrix.getBinSize(); 00208 } 00209 00210 if(FieldBits::NoField != (ModelviewMatrixFieldMask & whichField)) 00211 { 00212 returnValue += _sfModelviewMatrix.getBinSize(); 00213 } 00214 00215 00216 return returnValue; 00217 }
|
|
||||||||||||
|
Reimplemented from osg::CameraBase. Definition at line 219 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_sfModelviewMatrix, osg::MatrixCameraBase::_sfProjectionMatrix, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::CameraBase::copyToBin(), osg::MatrixCameraBase::ModelviewMatrixFieldMask, osg::FieldBits::NoField, and osg::MatrixCameraBase::ProjectionMatrixFieldMask. 00221 { 00222 Inherited::copyToBin(pMem, whichField); 00223 00224 if(FieldBits::NoField != (ProjectionMatrixFieldMask & whichField)) 00225 { 00226 _sfProjectionMatrix.copyToBin(pMem); 00227 } 00228 00229 if(FieldBits::NoField != (ModelviewMatrixFieldMask & whichField)) 00230 { 00231 _sfModelviewMatrix.copyToBin(pMem); 00232 } 00233 00234 00235 }
|
|
||||||||||||
|
Reimplemented from osg::CameraBase. Definition at line 237 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_sfModelviewMatrix, osg::MatrixCameraBase::_sfProjectionMatrix, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::CameraBase::copyFromBin(), osg::MatrixCameraBase::ModelviewMatrixFieldMask, osg::FieldBits::NoField, and osg::MatrixCameraBase::ProjectionMatrixFieldMask. 00239 { 00240 Inherited::copyFromBin(pMem, whichField); 00241 00242 if(FieldBits::NoField != (ProjectionMatrixFieldMask & whichField)) 00243 { 00244 _sfProjectionMatrix.copyFromBin(pMem); 00245 } 00246 00247 if(FieldBits::NoField != (ModelviewMatrixFieldMask & whichField)) 00248 { 00249 _sfModelviewMatrix.copyFromBin(pMem); 00250 } 00251 00252 00253 }
|
|
|
Definition at line 72 of file OSGMatrixCameraBase.inl. References osg::AttachmentContainerPtr::dcast(), osg::MatrixCameraBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::MatrixCameraBase::shallowCopy(). Referenced by osg::DisplayCalibration::createCMViewports(). 00073 { 00074 MatrixCameraPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = MatrixCameraPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
Definition at line 87 of file OSGMatrixCameraBase.inl. References osg::FieldContainer::newPtr(). 00088 { 00089 MatrixCameraPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
|
|
|
Implements osg::FieldContainer. Definition at line 128 of file OSGMatrixCameraBase.cpp. References osg::FieldContainer::newPtr(). Referenced by osg::MatrixCameraBase::create(). 00129 { 00130 MatrixCameraPtr returnValue; 00131 00132 newPtr(returnValue, dynamic_cast<const MatrixCamera *>(this)); 00133 00134 return returnValue; 00135 }
|
|
||||||||||||
|
Definition at line 256 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::_sfModelviewMatrix, osg::MatrixCameraBase::_sfProjectionMatrix, osg::CameraBase::executeSyncImpl(), osg::MatrixCameraBase::ModelviewMatrixFieldMask, osg::FieldBits::NoField, osg::MatrixCameraBase::ProjectionMatrixFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::MatrixCameraBase::executeSync(). 00258 { 00259 00260 Inherited::executeSyncImpl(pOther, whichField); 00261 00262 if(FieldBits::NoField != (ProjectionMatrixFieldMask & whichField)) 00263 _sfProjectionMatrix.syncWith(pOther->_sfProjectionMatrix); 00264 00265 if(FieldBits::NoField != (ModelviewMatrixFieldMask & whichField)) 00266 _sfModelviewMatrix.syncWith(pOther->_sfModelviewMatrix); 00267 00268 00269 }
|
|
||||||||||||
|
Definition at line 275 of file OSGCameraBase.cpp. References osg::CameraBase::_sfBeacon, osg::CameraBase::_sfFar, osg::CameraBase::_sfNear, osg::CameraBase::BeaconFieldMask, osg::AttachmentContainer::executeSyncImpl(), osg::CameraBase::FarFieldMask, osg::CameraBase::NearFieldMask, osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::CameraBase::executeSync(), osg::PerspectiveCameraBase::executeSyncImpl(), osg::MatrixCameraBase::executeSyncImpl(), and osg::CameraDecoratorBase::executeSyncImpl(). 00277 { 00278 00279 Inherited::executeSyncImpl(pOther, whichField); 00280 00281 if(FieldBits::NoField != (BeaconFieldMask & whichField)) 00282 _sfBeacon.syncWith(pOther->_sfBeacon); 00283 00284 if(FieldBits::NoField != (NearFieldMask & whichField)) 00285 _sfNear.syncWith(pOther->_sfNear); 00286 00287 if(FieldBits::NoField != (FarFieldMask & whichField)) 00288 _sfFar.syncWith(pOther->_sfFar); 00289 00290 00291 }
|
|
||||||||||||
|
||||||||||||
|
Definition at line 333 of file OSGFieldContainerImpl.inl. Referenced by osg::StateBase::executeSyncImpl(), osg::DVRShaderBase::executeSyncImpl(), osg::DVRClipGeometryBase::executeSyncImpl(), osg::AttachmentContainer::executeSyncImpl(), and osg::Attachment::executeSyncImpl().
|
|
||||||||||||
|
Reimplemented from osg::CameraBase. Definition at line 144 of file OSGMatrixCameraBase.cpp. References osg::MatrixCameraBase::executeSyncImpl(). 00146 { 00147 this->executeSyncImpl((MatrixCameraBase *) &other, whichField); 00148 }
|
|
||||||||||||
|
Setup OpenGL for rendering, call all the necessary commands to start rendering with this camera. Definition at line 109 of file OSGCamera.cpp. References osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::Camera::getProjection(), osg::Camera::getProjectionTranslation(), osg::TransformationMatrix< ValueTypeT >::getValues(), osg::Camera::getViewing(), and osg::TransformationMatrix< ValueTypeT >::mult(). 00111 { 00112 Matrix m, t; 00113 00114 // set the projection 00115 00116 getProjection ( m, port.getPixelWidth(), port.getPixelHeight() ); 00117 getProjectionTranslation( t, port.getPixelWidth(), port.getPixelHeight() ); 00118 00119 m.mult(t); 00120 00121 //SDEBUG << "Projection matrix: " << m << std::endl; 00122 00123 glMatrixMode( GL_PROJECTION ); 00124 glLoadMatrixf( m.getValues() ); 00125 00126 // set the viewing 00127 00128 getViewing( m, port.getPixelWidth(), port.getPixelHeight() ); 00129 00130 //SDEBUG << "Viewing matrix: " << m << std::endl; 00131 00132 glMatrixMode( GL_MODELVIEW ); 00133 glLoadMatrixf( m.getValues() ); 00134 }
|
|
||||||||||||
|
Setup OpenGL projection for rendering. Definition at line 138 of file OSGCamera.cpp. References osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::Camera::getProjection(), osg::Camera::getProjectionTranslation(), osg::TransformationMatrix< ValueTypeT >::getValues(), and osg::TransformationMatrix< ValueTypeT >::mult(). Referenced by osg::RenderAction::start(). 00140 { 00141 Matrix m, t; 00142 00143 // set the projection 00144 00145 getProjection ( m, port.getPixelWidth(), port.getPixelHeight() ); 00146 getProjectionTranslation( t, port.getPixelWidth(), port.getPixelHeight() ); 00147 00148 m.mult(t); 00149 00150 //SDEBUG << "Projection matrix: " << m << std::endl; 00151 00152 glMatrixMode( GL_PROJECTION ); 00153 glLoadMatrixf( m.getValues() ); 00154 }
|
|
||||||||||||||||
|
Get/calculate the projection translation matrix for this camera. The default is identity. Reimplemented in osg::CameraDecorator, osg::MatrixCameraDecorator, and osg::ProjectionCameraDecorator. Definition at line 176 of file OSGCamera.cpp. References osg::TransformationMatrix< ValueTypeT >::setIdentity(). Referenced by osg::Camera::calcViewRay(), osg::SkyBackground::clear(), osg::DVRIsoShader::getCoveredScreenRect(), osg::Camera::getFrustum(), osg::Camera::getWorldToScreen(), osg::Camera::setup(), and osg::Camera::setupProjection(). 00179 { 00180 result.setIdentity(); 00181 }
|
|
||||||||||||
|
Calculate the frustum of this camera's visible area. Definition at line 202 of file OSGCamera.cpp. References osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::Camera::getProjection(), osg::Camera::getProjectionTranslation(), osg::Camera::getViewing(), osg::TransformationMatrix< ValueTypeT >::mult(), and osg::FrustumVolume::setPlanes(). Referenced by osg::DrawActionBase::start(). 00203 { 00204 Matrix mv,prt,pr; 00205 00206 getProjection (pr , p.getPixelWidth(), p.getPixelHeight()); 00207 getProjectionTra |