CrystalSpace

Public API Reference

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 
00029 #include "csutil/scf.h"
00030 
00031 #include "csgeom/plane3.h"
00032 
00033 struct iCamera;
00034 struct iClipper2D;
00035 struct iEngine;
00036 struct iGraphics2D;
00037 struct iGraphics3D;
00038 struct iPortal;
00039 struct iSector;
00040 
00041 struct csFog;
00042 
00043 class csBox3;
00044 class csRenderView;
00045 class csReversibleTransform;
00046 class csSphere;
00047 class csVector3;
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   csRenderContext* previous;
00096 
00098   csRef<iCamera> icamera;
00100   csRef<iClipper2D> iview;
00102   csPlane3 frustum[5];
00103 
00105   csPlane3 clip_planes[7];
00107   uint32 clip_planes_mask;
00108 
00110   iPortal* last_portal;
00112   iSector* previous_sector;
00114   iSector* this_sector;
00115 
00120   csPlane3 clip_plane;
00121 
00132   bool do_clip_plane;
00133 
00142   bool do_clip_frustum;
00143 
00148   csFogInfo* fog_info;
00149 
00154   bool added_fog_info;
00155 
00161   int draw_rec_level;
00162 
00168   uint32 context_id;
00169 };
00170 
00181 struct iRenderView : public virtual iBase
00182 {
00183   SCF_INTERFACE(iRenderView, 2,1,0);
00185   virtual csRenderContext* GetRenderContext () = 0;
00186 
00188   virtual iEngine* GetEngine () = 0;
00190   virtual iGraphics2D* GetGraphics2D () = 0;
00192   virtual iGraphics3D* GetGraphics3D () = 0;
00194   virtual void GetFrustum (float& lx, float& rx, float& ty, float& by) = 0;
00195 
00196   //-----------------------------------------------------------------
00197   // The following functions operate on the current render context.
00198   //-----------------------------------------------------------------
00199 
00201   virtual iClipper2D* GetClipper () = 0;
00202 
00206   virtual iCamera* GetCamera () = 0;
00207 
00212   CS_DEPRECATED_METHOD_MSG("Use CS::RenderViewClipper::CalculateClipSettings() instead.")
00213   virtual void CalculateClipSettings (uint32 frustum_mask,
00214     int &clip_portal, int &clip_plane, int &clip_z_plane) = 0;
00215 
00222   CS_DEPRECATED_METHOD_MSG("Use CS::RenderViewClipper::TestBSphere() instead.")
00223   virtual bool TestBSphere (const csReversibleTransform& w2c,
00224         const csSphere& sphere) = 0;
00225 
00238   CS_DEPRECATED_METHOD_MSG("Use CS::RenderViewClipper::CullBBox() instead.")
00239   virtual bool ClipBBox (const csPlane3* planes, uint32& frustum_mask,
00240         const csBox3& obox,
00241         int& clip_portal, int& clip_plane, int& clip_z_plane) = 0;
00242 
00249   CS_DEPRECATED_METHOD_MSG("Use CS::RenderViewClipper::SetupClipPlanes() instead.")
00250   virtual void SetupClipPlanes (const csReversibleTransform& tr_o2c,
00251         csPlane3* planes, uint32& frustum_mask) = 0;
00252 
00256   virtual iSector* GetThisSector () = 0;
00257 
00261   virtual iSector* GetPreviousSector () = 0;
00262 
00266   virtual iPortal* GetLastPortal () = 0;
00267 
00272   virtual iCamera* GetOriginalCamera () const = 0;
00273 
00277   virtual uint GetCurrentFrameNumber () const = 0;
00278 
00286   CS_DEPRECATED_METHOD_MSG("Use CS::RenderViewClipper::CullBSphere() instead.")
00287   virtual bool ClipBSphere (
00288         const csSphere &cam_sphere,
00289         const csSphere &world_sphere,
00290         int& clip_portal, int& clip_plane, int& clip_z_plane) = 0;
00291 };
00292 
00295 #endif // __CS_IENGINE_RVIEW_H__
00296 

Generated for Crystal Space 1.2.1 by doxygen 1.5.3