OSGCameraDecorator.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <cstdlib>
00044 #include <cstdio>
00045
00046 #include "OSGConfig.h"
00047
00048 #include "OSGCameraDecorator.h"
00049
00050 OSG_USING_NAMESPACE
00051
00062
00063
00064 CameraDecorator::CameraDecorator(void) :
00065 Inherited()
00066 {
00067 }
00068
00069 CameraDecorator::CameraDecorator(const CameraDecorator &source) :
00070 Inherited(source)
00071 {
00072 }
00073
00074 CameraDecorator::~CameraDecorator(void)
00075 {
00076 }
00077
00078
00079
00080 void CameraDecorator::initMethod(InitPhase ePhase)
00081 {
00082 Inherited::initMethod(ePhase);
00083 }
00084
00085 void CameraDecorator::changed(ConstFieldMaskArg whichField,
00086 UInt32 origin,
00087 BitVector details)
00088 {
00089 Inherited::changed(whichField, origin, details);
00090 }
00091
00092 void CameraDecorator::dump( UInt32 ,
00093 const BitVector ) const
00094 {
00095 SLOG << "Dump CameraDecorator NI" << std::endl;
00096 }
00097
00098
00099
00100
00101
00102 void CameraDecorator::getProjection(Matrix &result,
00103 UInt32 width ,
00104 UInt32 height)
00105 {
00106 Camera *camera = getDecoratee();
00107
00108 if(camera == NULL)
00109 {
00110 FWARNING(("CameraDecorator::getProjection: no decoratee!\n"));
00111
00112 result.setIdentity();
00113
00114 return;
00115 }
00116
00117 camera->getProjection(result, width, height);
00118 }
00119
00120 void CameraDecorator::getProjectionTranslation(Matrix &result,
00121 UInt32 width ,
00122 UInt32 height)
00123 {
00124 Camera *camera = getDecoratee();
00125
00126 if(camera == NULL)
00127 {
00128 FWARNING(("CameraDecorator::getProjectionTranslation: "
00129 "no decoratee!\n"));
00130
00131 result.setIdentity();
00132
00133 return;
00134 }
00135
00136 camera->getProjectionTranslation(result, width, height);
00137 }
00138
00139 void CameraDecorator::getViewing(Matrix &result,
00140 UInt32 width ,
00141 UInt32 height)
00142 {
00143 Camera *camera = getDecoratee();
00144
00145 if(camera == NULL)
00146 {
00147 FWARNING(("CameraDecorator::getViewing: no decoratee!\n"));
00148
00149 result.setIdentity();
00150
00151 return;
00152 }
00153
00154 camera->getViewing(result, width, height);
00155 }
00156
00157 Vec2u CameraDecorator::tileGetFullSize(void) const
00158 {
00159 Camera *pCam = getDecoratee();
00160
00161 if(pCam != NULL)
00162 {
00163 return pCam->tileGetFullSize();
00164 }
00165
00166 return Inherited::tileGetFullSize();
00167 }
00168
00169 Vec4f CameraDecorator::tileGetRegion(void) const
00170 {
00171 Camera *pCam = getDecoratee();
00172
00173 if(pCam != NULL)
00174 {
00175 return pCam->tileGetRegion();
00176 }
00177
00178 return Inherited::tileGetRegion();
00179 }