CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iengine/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 #include "csgeom/plane3.h"
00030 #include "csgeom/transfrm.h"
00031 #include "csgeom/box.h"
00032 #include "iengine/engine.h"
00033 
00034 #include "ivideo/graph3d.h"
00035 
00036 struct csFog;
00037 struct iEngine;
00038 struct iClipper2D;
00039 struct iGraphics2D;
00040 struct iGraphics3D;
00041 struct iCamera;
00042 struct iSector;
00043 struct iPortal;
00044 class csRenderView;
00045 class csReversibleTransform;
00046 class csVector3;
00047 class csSphere;
00048 
00056 class csFogInfo
00057 {
00058 public:
00060   csFogInfo* next;
00061 
00063   csPlane3 incoming_plane;
00065   csPlane3 outgoing_plane;
00070   bool has_incoming_plane;
00071 
00077   bool has_outgoing_plane;
00078 
00080   csFog* fog;
00081 };
00082 
00089 class csRenderContext
00090 {
00091   friend class csRenderView;
00092 
00093 public:
00095   iCamera* icamera;
00097   iClipper2D* iview;
00099   csPlane3 frustum[5];
00100 
00102   csPlane3 clip_planes[7];
00104   uint32 clip_planes_mask;
00105 
00107   iPortal* last_portal;
00109   iSector* previous_sector;
00111   iSector* this_sector;
00112 
00117   csPlane3 clip_plane;
00118 
00129   bool do_clip_plane;
00130 
00139   bool do_clip_frustum;
00140 
00145   csFogInfo* fog_info;
00146 
00151   bool added_fog_info;
00152 
00158   int draw_rec_level;
00159 
00165   uint32 context_id;
00166 };
00167 
00168 SCF_VERSION (iRenderView, 0, 5, 1);
00169 
00174 struct iRenderView : public iBase
00175 {
00177   virtual csRenderContext* GetRenderContext () = 0;
00178 
00180   virtual iEngine* GetEngine () = 0;
00182   virtual iGraphics2D* GetGraphics2D () = 0;
00184   virtual iGraphics3D* GetGraphics3D () = 0;
00186   virtual void GetFrustum (float& lx, float& rx, float& ty, float& by) = 0;
00187 
00188   //-----------------------------------------------------------------
00189   // The following functions operate on the current render context.
00190   //-----------------------------------------------------------------
00191 
00193   virtual iClipper2D* GetClipper () = 0;
00194 
00198   virtual iCamera* GetCamera () = 0;
00199 
00204   virtual void CalculateFogPolygon (G3DPolygonDP& poly) = 0;
00209   virtual void CalculateFogPolygon (G3DPolygonDPFX& poly) = 0;
00217   virtual void CalculateFogMesh (const csTransform& tr_o2c,
00218         G3DTriangleMesh& mesh) = 0;
00219 
00227   virtual void CalculateFogMesh (const csTransform &tr_o2c, 
00228     G3DPolygonMesh &mesh) = 0;
00229 
00233   virtual void CalculateClipSettings (uint32 frustum_mask,
00234     int &clip_portal, int &clip_plane, int &clip_z_plane) = 0;
00235 
00241   virtual bool TestBSphere (const csReversibleTransform& w2c,
00242         const csSphere& sphere) = 0;
00243 
00255   virtual bool ClipBBox (csPlane3* planes, uint32& frustum_mask,
00256         const csBox3& obox,
00257         int& clip_portal, int& clip_plane, int& clip_z_plane) = 0;
00258 
00264   virtual void SetupClipPlanes (const csReversibleTransform& tr_o2c,
00265         csPlane3* planes, uint32& frustum_mask) = 0;
00266 
00270   virtual iSector* GetThisSector () = 0;
00271 
00275   virtual iSector* GetPreviousSector () = 0;
00276 
00280   virtual iPortal* GetLastPortal () = 0;
00281 
00286   virtual iCamera* GetOriginalCamera () const = 0;
00287 
00291   virtual uint GetCurrentFrameNumber () const = 0;
00292 };
00293 
00296 #endif // __CS_IENGINE_RVIEW_H__
00297 

Generated for Crystal Space by doxygen 1.2.18