Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages
rview.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IENGINE_RVIEW_H__ 00020 #define __CS_IENGINE_RVIEW_H__ 00021 00028 #include "csutil/scf.h" 00029 00030 #include "csgeom/plane3.h" 00031 00032 struct iCamera; 00033 struct iClipper2D; 00034 struct iEngine; 00035 struct iGraphics2D; 00036 struct iGraphics3D; 00037 struct iPortal; 00038 struct iSector; 00039 00040 struct csFog; 00041 00042 class csBox3; 00043 class csRenderView; 00044 class csReversibleTransform; 00045 class csSphere; 00046 class csVector3; 00047 00055 class csFogInfo 00056 { 00057 public: 00059 csFogInfo* next; 00060 00062 csPlane3 incoming_plane; 00064 csPlane3 outgoing_plane; 00069 bool has_incoming_plane; 00070 00076 bool has_outgoing_plane; 00077 00079 csFog* fog; 00080 }; 00081 00088 class csRenderContext 00089 { 00090 friend class csRenderView; 00091 00092 public: 00094 csRenderContext* previous; 00095 00097 csRef<iCamera> icamera; 00099 csRef<iClipper2D> iview; 00101 csPlane3 frustum[5]; 00102 00104 csPlane3 clip_planes[7]; 00106 uint32 clip_planes_mask; 00107 00109 iPortal* last_portal; 00111 iSector* previous_sector; 00113 iSector* this_sector; 00114 00119 csPlane3 clip_plane; 00120 00131 bool do_clip_plane; 00132 00141 bool do_clip_frustum; 00142 00147 csFogInfo* fog_info; 00148 00153 bool added_fog_info; 00154 00160 int draw_rec_level; 00161 00167 uint32 context_id; 00168 }; 00169 00170 SCF_VERSION (iRenderView, 0, 5, 1); 00171 00176 struct iRenderView : public iBase 00177 { 00179 virtual csRenderContext* GetRenderContext () = 0; 00180 00182 virtual iEngine* GetEngine () = 0; 00184 virtual iGraphics2D* GetGraphics2D () = 0; 00186 virtual iGraphics3D* GetGraphics3D () = 0; 00188 virtual void GetFrustum (float& lx, float& rx, float& ty, float& by) = 0; 00189 00190 //----------------------------------------------------------------- 00191 // The following functions operate on the current render context. 00192 //----------------------------------------------------------------- 00193 00195 virtual iClipper2D* GetClipper () = 0; 00196 00200 virtual iCamera* GetCamera () = 0; 00201 00205 virtual void CalculateClipSettings (uint32 frustum_mask, 00206 int &clip_portal, int &clip_plane, int &clip_z_plane) = 0; 00207 00213 virtual bool TestBSphere (const csReversibleTransform& w2c, 00214 const csSphere& sphere) = 0; 00215 00227 virtual bool ClipBBox (csPlane3* planes, uint32& frustum_mask, 00228 const csBox3& obox, 00229 int& clip_portal, int& clip_plane, int& clip_z_plane) = 0; 00230 00236 virtual void SetupClipPlanes (const csReversibleTransform& tr_o2c, 00237 csPlane3* planes, uint32& frustum_mask) = 0; 00238 00242 virtual iSector* GetThisSector () = 0; 00243 00247 virtual iSector* GetPreviousSector () = 0; 00248 00252 virtual iPortal* GetLastPortal () = 0; 00253 00258 virtual iCamera* GetOriginalCamera () const = 0; 00259 00263 virtual uint GetCurrentFrameNumber () const = 0; 00264 00272 virtual bool ClipBSphere ( 00273 const csSphere &cam_sphere, 00274 const csSphere &world_sphere, 00275 int& clip_portal, int& clip_plane, int& clip_z_plane) = 0; 00276 00277 00278 00279 // @@@ ADDED B/C OF FATLOOP PORTAL HACKING 00280 // @@@ REMOVE AGAIN ASAP 00281 virtual void CreateRenderContext () = 0; 00282 virtual int GetRenderRecursionLevel () const = 0; 00283 virtual void SetRenderRecursionLevel (int rec) = 0; 00284 virtual void SetClipper (iClipper2D* clip) = 0; 00285 virtual void ResetFogInfo () = 0; 00286 virtual void SetPreviousSector (iSector* s) = 0; 00287 virtual void SetClipPlane (const csPlane3& p) = 0; 00288 virtual bool GetClipPlane (csPlane3& pl) const = 0; 00289 virtual const csPlane3& GetClipPlane () const = 0; 00290 virtual csPlane3& GetClipPlane () = 0; 00291 virtual void UseClipPlane (bool u) = 0; 00292 virtual void UseClipFrustum (bool u) = 0; 00293 virtual void SetLastPortal (iPortal* por) = 0; 00294 virtual bool IsClipperRequired () const = 0; 00295 virtual iCamera* CreateNewCamera () = 0; 00296 virtual void RestoreRenderContext () = 0; 00297 virtual void SetThisSector (iSector* s) = 0; 00298 virtual void SetupClipPlanes () = 0; 00299 }; 00300 00303 #endif // __CS_IENGINE_RVIEW_H__ 00304
Generated for Crystal Space by doxygen 1.4.4