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 <stdlib.h>
00044 #include <stdio.h>
00045
00046 #include <OSGConfig.h>
00047
00048 #include "OSGMatrixCameraDecorator.h"
00049
00050 OSG_USING_NAMESPACE
00051
00052
00053
00054
00055
00068
00069
00070
00071
00072
00073
00074
00075
00076 void MatrixCameraDecorator::initMethod (void)
00077 {
00078 }
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 MatrixCameraDecorator::MatrixCameraDecorator(void) :
00092 Inherited()
00093 {
00094 }
00095
00096 MatrixCameraDecorator::MatrixCameraDecorator(const MatrixCameraDecorator &source) :
00097 Inherited(source)
00098 {
00099 }
00100
00101 MatrixCameraDecorator::~MatrixCameraDecorator(void)
00102 {
00103 }
00104
00105
00106
00107 void MatrixCameraDecorator::changed(BitVector whichField, UInt32 origin)
00108 {
00109 Inherited::changed(whichField, origin);
00110 }
00111
00112
00113 void MatrixCameraDecorator::getProjection(Matrix &result,
00114 UInt32 width, UInt32 height)
00115 {
00116 CameraPtr camera = getDecoratee();
00117 if(camera == NullFC)
00118 {
00119 FWARNING(("MatrixCameraDecorator::getProjection: no decoratee!\n"));
00120 result.setIdentity();
00121 return;
00122 }
00123 camera->getProjection(result, width, height);
00124
00125 result.multLeft(getPostProjection());
00126 result.mult(getPreProjection());
00127 }
00128
00129 void MatrixCameraDecorator::getProjectionTranslation(Matrix &result,
00130 UInt32 width, UInt32 height)
00131 {
00132 CameraPtr camera = getDecoratee();
00133 if(camera == NullFC)
00134 {
00135 FWARNING(("MatrixCameraDecorator::getProjectionTranslation: no decoratee!\n"));
00136 result.setIdentity();
00137 return;
00138 }
00139 camera->getProjectionTranslation(result, width, height);
00140
00141 result.multLeft(getPostProjectionTranslation());
00142 result.mult(getPreProjectionTranslation());
00143 }
00144
00145 void MatrixCameraDecorator::getViewing(Matrix &result,
00146 UInt32 width, UInt32 height)
00147 {
00148 CameraPtr camera = getDecoratee();
00149 if(camera == NullFC)
00150 {
00151 FWARNING(("MatrixCameraDecorator::getViewing: no decoratee!\n"));
00152 result.setIdentity();
00153 return;
00154 }
00155 camera->getViewing(result, width, height);
00156
00157 result.multLeft(getPostViewing());
00158 result.mult(getPreViewing());
00159 }
00160
00161 void MatrixCameraDecorator::dump( UInt32 ,
00162 const BitVector ) const
00163 {
00164 SLOG << "Dump MatrixCameraDecorator NI" << std::endl;
00165 }
00166
00167
00168
00169
00170
00171 #ifdef OSG_SGI_CC
00172 #pragma set woff 1174
00173 #endif
00174
00175 #ifdef OSG_LINUX_ICC
00176 #pragma warning( disable : 177 )
00177 #endif
00178
00179 namespace
00180 {
00181 static Char8 cvsid_cpp [] = "@(#)$Id: $";
00182 static Char8 cvsid_hpp [] = OSGMATRIXCAMERADECORATORBASE_HEADER_CVSID;
00183 static Char8 cvsid_inl [] = OSGMATRIXCAMERADECORATORBASE_INLINE_CVSID;
00184
00185 static Char8 cvsid_fields_hpp[] = OSGMATRIXCAMERADECORATORFIELDS_HEADER_CVSID;
00186 }
00187
00188 #ifdef __sgi
00189 #pragma reset woff 1174
00190 #endif
00191