1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
45 #include "OSGMatrix.h"
46 #include "OSGFrustumVolume.h"
47 #include "OSGCameraBase.h"
55 /*! \brief Camera base class. See \ref PageSystemWindowCamera for a
58 \ingroup GrpSystemWindowCamera
59 \ingroup GrpLibOSGSystem
63 class OSG_SYSTEM_DLLMAPPING Camera
: public CameraBase
65 /*========================== PUBLIC =================================*/
69 typedef CameraBase Inherited
;
71 /*---------------------------------------------------------------------*/
72 /*! \name Class Get */
76 /*---------------------------------------------------------------------*/
77 /*! \name transformation */
80 virtual void changed(ConstFieldMaskArg whichField
,
85 /*---------------------------------------------------------------------*/
86 /*! \name Setup Rendering */
90 /*---------------------------------------------------------------------*/
91 /*! \name Access Parameters */
94 virtual void getProjection (Matrix
&result
,
98 virtual void getProjectionTranslation (Matrix
&result
,
102 virtual void getViewing (Matrix
&result
,
106 virtual void getFrustum (FrustumVolume
&result
,
110 virtual void getDecoration (Matrix
&result
,
115 virtual Matrix
getProjectionVal (UInt32 width
,
118 virtual Matrix
getProjectionTranslationVal(UInt32 width
,
121 virtual Matrix
getViewingVal (UInt32 width
,
124 virtual Matrix
getDecorationVal (UInt32 width
,
128 /*---------------------------------------------------------------------*/
129 /*! \name Access Parameters */
132 void calcFrustum ( FrustumVolume
&result
,
133 const Viewport
&port
);
135 void calcWorldToScreen ( Matrix
&result
,
136 const Viewport
&port
);
139 FrustumVolume
calcFrustumVal (const Viewport
&port
);
141 Matrix
calcWorldToScreenVal(const Viewport
&port
);
144 void getFrustum ( FrustumVolume
&result
,
145 const Viewport
&port
);
147 void getWorldToScreen ( Matrix
&result
,
148 const Viewport
&port
);
150 FrustumVolume
getFrustumVal (const Viewport
&port
);
152 Matrix
getWorldToScreenVal (const Viewport
&port
);
156 /*---------------------------------------------------------------------*/
157 /*! \name Tile Information */
160 virtual Vec2u
tileGetFullSize(void) const;
161 virtual Vec4f
tileGetRegion (void) const;
164 /*---------------------------------------------------------------------*/
165 /*! \name Intersection Helper */
168 bool calcViewRay( Line
&line
,
171 const Viewport
&port
,
175 /*---------------------------------------------------------------------*/
179 virtual void dump( UInt32 uiIndent
= 0,
180 const BitVector bvFlags
= 0) const;
183 /*========================= PROTECTED ===============================*/
187 /*---------------------------------------------------------------------*/
188 /*! \name Constructors */
192 Camera(const Camera
&source
);
195 /*---------------------------------------------------------------------*/
196 /*! \name Destructors */
199 virtual ~Camera(void);
202 /*---------------------------------------------------------------------*/
206 static void initMethod(InitPhase ePhase
);
209 /*========================== PRIVATE ================================*/
213 friend class FieldContainer
;
214 friend class CameraBase
;
216 // prohibit default functions (move to 'public' if you need one)
217 void operator =(const Camera
&source
);
220 //---------------------------------------------------------------------------
222 //---------------------------------------------------------------------------
224 typedef Camera
*CameraP
;
228 #include "OSGCameraBase.inl"
229 #include "OSGCamera.inl"
231 #endif /* _OSGCAMERA_H_ */