Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::PerspectiveCamera Class Reference
[Cameras]

Perspective Camera class. See Perspective Camera for a description. More...

#include <OSGPerspectiveCamera.h>

Inheritance diagram for osg::PerspectiveCamera:

osg::PerspectiveCameraBase osg::Camera osg::CameraBase osg::AttachmentContainer osg::FieldContainer osg::OffCenterPerspectiveCameraBase osg::OffCenterPerspectiveCamera List of all members.

Public Types

typedef PerspectiveCameraPtr Ptr
enum  { FovFieldId = Inherited::NextFieldId, AspectFieldId = FovFieldId + 1, NextFieldId = AspectFieldId + 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)
dump
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFReal32getSFFov (void)
 Get the PerspectiveCamera::_sfFov field.
SFReal32getSFAspect (void)
 Get the PerspectiveCamera::_sfAspect field.
Real32getFov (void)
 Get the value of the PerspectiveCamera::_sfFov field.
const Real32getFov (void) const
 Get the value of the PerspectiveCamera::_sfFov field.
Real32getAspect (void)
 Get the value of the PerspectiveCamera::_sfAspect field.
const Real32getAspect (void) const
 Get the value of the PerspectiveCamera::_sfAspect field.
Field Set
*void setFov (const Real32 &value)
 Set the value of the PerspectiveCamera::_sfFov field.
void setAspect (const Real32 &value)
 Set the value of the PerspectiveCamera::_sfAspect 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 getViewing (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 SFNodePtrgetSFBeacon (void)
virtual SFReal32getSFNear (void)
virtual SFReal32getSFFar (void)
virtual NodePtrgetBeacon (void)
virtual const NodePtrgetBeacon (void) const
virtual Real32getNear (void)
virtual const Real32getNear (void) const
virtual Real32getFar (void)
virtual const Real32getFar (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 FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static PerspectiveCameraPtr create (void)
 create a new instance of the class
static PerspectiveCameraPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector FovFieldMask
static const osg::BitVector AspectFieldMask
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
PerspectiveCamera (void)
 PerspectiveCamera (const PerspectiveCamera &source)
Destructors
*virtual ~PerspectiveCamera (void)
Sync
*void executeSyncImpl (PerspectiveCameraBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (CameraBase *pOther, const BitVector &whichField)

Protected Attributes

Fields
*SFReal32 _sfFov
SFReal32 _sfAspect
Fields
*SFNodePtr _sfBeacon
SFReal32 _sfNear
SFReal32 _sfFar

Private Types

typedef PerspectiveCameraBase Inherited

Private Member Functions

void operator= (const PerspectiveCamera &source)

Static Private Member Functions

static void initMethod (void)

Friends

class FieldContainer
class PerspectiveCameraBase

Detailed Description

The Perspective Camera class, see Perspective Camera for a description.

The only new parameter is the _sfFov.

Definition at line 58 of file OSGPerspectiveCamera.h.


Member Typedef Documentation

typedef PerspectiveCameraBase osg::PerspectiveCamera::Inherited [private]
 

Reimplemented from osg::PerspectiveCameraBase.

Reimplemented in osg::OffCenterPerspectiveCamera, and osg::OffCenterPerspectiveCameraBase.

Definition at line 116 of file OSGPerspectiveCamera.h.

typedef PerspectiveCameraPtr osg::PerspectiveCameraBase::Ptr [inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 91 of file OSGPerspectiveCameraBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
FovFieldId 
AspectFieldId 
NextFieldId 

Reimplemented from osg::CameraBase.

Definition at line 93 of file OSGPerspectiveCameraBase.h.

00094     {
00095         FovFieldId    = Inherited::NextFieldId,
00096         AspectFieldId = FovFieldId    + 1,
00097         NextFieldId   = AspectFieldId + 1
00098     };


Constructor & Destructor Documentation

PerspectiveCamera::PerspectiveCamera void   )  [protected]
 

Definition at line 101 of file OSGPerspectiveCamera.cpp.

00101                                          :
00102     Inherited()
00103 {
00104 }

PerspectiveCamera::PerspectiveCamera const PerspectiveCamera source  )  [protected]
 

Definition at line 106 of file OSGPerspectiveCamera.cpp.

00106                                                                     :
00107     Inherited(source)
00108 {
00109 }

PerspectiveCamera::~PerspectiveCamera void   )  [protected, virtual]
 

Definition at line 111 of file OSGPerspectiveCamera.cpp.

00112 {
00113 }


Member Function Documentation

* static const char* osg::PerspectiveCamera::getClassname void   )  [inline, static]
 

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 67 of file OSGPerspectiveCamera.h.

00067 { return "PerspectiveCamera"; };

void PerspectiveCamera::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 115 of file OSGPerspectiveCamera.cpp.

References osg::Camera::changed().

Referenced by osg::OffCenterPerspectiveCamera::changed().

00116 {
00117     Inherited::changed(whichField, origin);
00118 }

void PerspectiveCamera::draw DrawAction action,
const Viewport port
[virtual]
 

Draw the camera's geometry (if any). Usually there is none.

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 122 of file OSGPerspectiveCamera.cpp.

00124 {
00125 }

void PerspectiveCamera::getProjection Matrix result,
UInt32  width,
UInt32  height
[virtual]
 

Get/calculate the projection matrix for this camera.

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 127 of file OSGPerspectiveCamera.cpp.

References osg::PerspectiveCameraBase::getAspect(), osg::CameraBase::getFar(), osg::PerspectiveCameraBase::getFov(), osg::CameraBase::getNear(), osg::MatrixPerspective(), osg::osgdegree2rad(), osg::Pi, and osg::TransformationMatrix< ValueTypeT >::setIdentity().

00129 {
00130     Real32 fov = getFov();
00131 
00132     // catch some illegal cases
00133     if(fov < 0 || width == 0 || height == 0)
00134     {
00135         result.setIdentity();
00136         return;
00137     }
00138     
00139     // try to be nice to people giving degrees...
00140     if(fov > Pi)
00141         fov = osgdegree2rad(fov);
00142 
00143     MatrixPerspective(result, fov / 2, 
00144             width /(Real32) height * getAspect(), 
00145             getNear(), getFar());
00146 }

void PerspectiveCamera::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 151 of file OSGPerspectiveCamera.cpp.

References SLOG.

00153 {
00154     SLOG << "Dump PerspectiveCamera NI" << std::endl;
00155 }

void PerspectiveCamera::initMethod void   )  [static, private]
 

Reimplemented from osg::Camera.

Reimplemented in osg::OffCenterPerspectiveCamera.

Definition at line 86 of file OSGPerspectiveCamera.cpp.

00087 {
00088 }

void osg::PerspectiveCamera::operator= const PerspectiveCamera source  )  [private]
 

osg::FieldContainerType & osg::PerspectiveCameraBase::getClassType void   )  [inline, static, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 58 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_type.

Referenced by osg::PerspectiveCameraBase::create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::PerspectiveCameraBase::getClassTypeId void   )  [inline, static, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 65 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & PerspectiveCameraBase::getType void   )  [virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 117 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_type.

00118 {
00119     return _type; 
00120 } 

const FieldContainerType & PerspectiveCameraBase::getType void   )  const [virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 122 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_type.

00123 {
00124     return _type;
00125 } 

UInt32 PerspectiveCameraBase::getContainerSize void   )  const [virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 137 of file OSGPerspectiveCameraBase.cpp.

00138 { 
00139     return sizeof(PerspectiveCamera); 
00140 }

SFReal32 * osg::PerspectiveCameraBase::getSFFov void   )  [inline, inherited]
 

Definition at line 101 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfFov.

00102 {
00103     return &_sfFov;
00104 }

SFReal32 * osg::PerspectiveCameraBase::getSFAspect void   )  [inline, inherited]
 

Definition at line 108 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfAspect.

00109 {
00110     return &_sfAspect;
00111 }

Real32 & osg::PerspectiveCameraBase::getFov void   )  [inline, inherited]
 

Definition at line 116 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfFov, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by getProjection(), and osg::OffCenterPerspectiveCamera::getProjection().

00117 {
00118     return _sfFov.getValue();
00119 }

const Real32 & osg::PerspectiveCameraBase::getFov void   )  const [inline, inherited]
 

Definition at line 123 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfFov, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00124 {
00125     return _sfFov.getValue();
00126 }

Real32 & osg::PerspectiveCameraBase::getAspect void   )  [inline, inherited]
 

Definition at line 137 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfAspect, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by getProjection(), and osg::OffCenterPerspectiveCamera::getProjection().

00138 {
00139     return _sfAspect.getValue();
00140 }

const Real32 & osg::PerspectiveCameraBase::getAspect void   )  const [inline, inherited]
 

Definition at line 144 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfAspect, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00145 {
00146     return _sfAspect.getValue();
00147 }

void osg::PerspectiveCameraBase::setFov const Real32 value  )  [inline, inherited]
 

Definition at line 130 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfFov, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00131 {
00132     _sfFov.setValue(value);
00133 }

void osg::PerspectiveCameraBase::setAspect const Real32 value  )  [inline, inherited]
 

Definition at line 151 of file OSGPerspectiveCameraBase.inl.

References osg::PerspectiveCameraBase::_sfAspect, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00152 {
00153     _sfAspect.setValue(value);
00154 }

UInt32 PerspectiveCameraBase::getBinSize const BitVector whichField  )  [virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 201 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_sfAspect, osg::PerspectiveCameraBase::_sfFov, osg::PerspectiveCameraBase::AspectFieldMask, osg::PerspectiveCameraBase::FovFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::CameraBase::getBinSize(), and osg::FieldBits::NoField.

Referenced by osg::OffCenterPerspectiveCameraBase::getBinSize().

00202 {
00203     UInt32 returnValue = Inherited::getBinSize(whichField);
00204 
00205     if(FieldBits::NoField != (FovFieldMask & whichField))
00206     {
00207         returnValue += _sfFov.getBinSize();
00208     }
00209 
00210     if(FieldBits::NoField != (AspectFieldMask & whichField))
00211     {
00212         returnValue += _sfAspect.getBinSize();
00213     }
00214 
00215 
00216     return returnValue;
00217 }

void PerspectiveCameraBase::copyToBin BinaryDataHandler pMem,
const BitVector whichField
[virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 219 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_sfAspect, osg::PerspectiveCameraBase::_sfFov, osg::PerspectiveCameraBase::AspectFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::CameraBase::copyToBin(), osg::PerspectiveCameraBase::FovFieldMask, and osg::FieldBits::NoField.

Referenced by osg::OffCenterPerspectiveCameraBase::copyToBin().

00221 {
00222     Inherited::copyToBin(pMem, whichField);
00223 
00224     if(FieldBits::NoField != (FovFieldMask & whichField))
00225     {
00226         _sfFov.copyToBin(pMem);
00227     }
00228 
00229     if(FieldBits::NoField != (AspectFieldMask & whichField))
00230     {
00231         _sfAspect.copyToBin(pMem);
00232     }
00233 
00234 
00235 }

void PerspectiveCameraBase::copyFromBin BinaryDataHandler pMem,
const BitVector whichField
[virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 237 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_sfAspect, osg::PerspectiveCameraBase::_sfFov, osg::PerspectiveCameraBase::AspectFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::CameraBase::copyFromBin(), osg::PerspectiveCameraBase::FovFieldMask, and osg::FieldBits::NoField.

Referenced by osg::OffCenterPerspectiveCameraBase::copyFromBin().

00239 {
00240     Inherited::copyFromBin(pMem, whichField);
00241 
00242     if(FieldBits::NoField != (FovFieldMask & whichField))
00243     {
00244         _sfFov.copyFromBin(pMem);
00245     }
00246 
00247     if(FieldBits::NoField != (AspectFieldMask & whichField))
00248     {
00249         _sfAspect.copyFromBin(pMem);
00250     }
00251 
00252 
00253 }

PerspectiveCameraPtr osg::PerspectiveCameraBase::create void   )  [inline, static, inherited]
 

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 72 of file OSGPerspectiveCameraBase.inl.

References osg::AttachmentContainerPtr::dcast(), osg::PerspectiveCameraBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::PerspectiveCameraBase::shallowCopy().

Referenced by osg::SimpleSceneManager::initialize().

00073 {
00074     PerspectiveCameraPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = PerspectiveCameraPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

PerspectiveCameraPtr osg::PerspectiveCameraBase::createEmpty void   )  [inline, static, inherited]
 

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 87 of file OSGPerspectiveCameraBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     PerspectiveCameraPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr PerspectiveCameraBase::shallowCopy void   )  const [virtual, inherited]
 

Implements osg::FieldContainer.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 128 of file OSGPerspectiveCameraBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::PerspectiveCameraBase::create().

00129 { 
00130     PerspectiveCameraPtr returnValue; 
00131 
00132     newPtr(returnValue, dynamic_cast<const PerspectiveCamera *>(this)); 
00133 
00134     return returnValue; 
00135 }

void PerspectiveCameraBase::executeSyncImpl PerspectiveCameraBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 256 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::_sfAspect, osg::PerspectiveCameraBase::_sfFov, osg::PerspectiveCameraBase::AspectFieldMask, osg::CameraBase::executeSyncImpl(), osg::PerspectiveCameraBase::FovFieldMask, osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::PerspectiveCameraBase::executeSync(), and osg::OffCenterPerspectiveCameraBase::executeSyncImpl().

00258 {
00259 
00260     Inherited::executeSyncImpl(pOther, whichField);
00261 
00262     if(FieldBits::NoField != (FovFieldMask & whichField))
00263         _sfFov.syncWith(pOther->_sfFov);
00264 
00265     if(FieldBits::NoField != (AspectFieldMask & whichField))
00266         _sfAspect.syncWith(pOther->_sfAspect);
00267 
00268 
00269 }

void CameraBase::executeSyncImpl CameraBase pOther,
const BitVector whichField
[protected, inherited]
 

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 }

void AttachmentContainer::executeSyncImpl AttachmentContainer pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 316 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::AttachmentContainer::AttachmentsFieldMask, osg::FieldContainer::executeSyncImpl(), osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::AttachmentContainer::executeSync(), osg::WindowBase::executeSyncImpl(), osg::ViewportBase::executeSyncImpl(), osg::ShaderParameterBase::executeSyncImpl(), osg::Node::executeSyncImpl(), osg::NodeCore::executeSyncImpl(), osg::MaterialBase::executeSyncImpl(), osg::ImageComposerBase::executeSyncImpl(), osg::ImageBase::executeSyncImpl(), osg::ForegroundBase::executeSyncImpl(), osg::DisplayCalibrationBase::executeSyncImpl(), osg::CameraBase::executeSyncImpl(), and osg::BackgroundBase::executeSyncImpl().

00319 {
00320     Inherited::executeSyncImpl(pOther, whichField);
00321 
00322     if (FieldBits::NoField != (AttachmentsFieldMask & whichField))
00323     {
00324         _attachmentMap.syncWith(pOther->_attachmentMap);
00325     }
00326 }

void osg::FieldContainer::executeSyncImpl FieldContainer pOther,
const BitVector whichField
[inline, protected, inherited]
 

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().

00335 {
00336 }

void PerspectiveCameraBase::executeSync FieldContainer other,
const BitVector whichField
[protected, virtual, inherited]
 

Reimplemented from osg::CameraBase.

Reimplemented in osg::OffCenterPerspectiveCameraBase.

Definition at line 144 of file OSGPerspectiveCameraBase.cpp.

References osg::PerspectiveCameraBase::executeSyncImpl().

00146 {
00147     this->executeSyncImpl((PerspectiveCameraBase *) &other, whichField);
00148 }

void Camera::setup DrawActionBase action,
const Viewport port
[virtual, inherited]
 

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 }

void Camera::setupProjection DrawActionBase action,
const Viewport port
[virtual, inherited]
 

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.