Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

portal.h

00001 /*
00002     Copyright (C) 1998-2001 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 __IENGINE_PORTAL_H__
00020 #define __IENGINE_PORTAL_H__
00021 
00022 #include "csutil/scf.h"
00023 #include "iutil/objref.h"
00024 
00025 class csReversibleTransform;
00026 
00032 #define CS_PORTAL_CLIPDEST 0x00000001
00033 
00042 #define CS_PORTAL_ZFILL 0x00000002
00043 
00050 #define CS_PORTAL_WARP 0x00000004
00051 
00057 #define CS_PORTAL_MIRROR 0x00000008
00058 
00065 #define CS_PORTAL_STATICDEST 0x00000010
00066 
00067 class csTransform;
00068 class csMatrix3;
00069 class csVector3;
00070 class csFlags;
00071 struct iTextureHandle;
00072 struct iSector;
00073 struct iPolygon3D;
00074 struct iPortal;
00075 struct iFrustumView;
00076 struct iObject;
00077 
00078 SCF_VERSION (iPortalCallback, 0, 0, 1);
00079 
00087 struct iPortalCallback : public iBase
00088 {
00090   virtual bool Traverse (iPortal* portal, iBase* context) = 0;
00091 };
00092 
00093 SCF_VERSION (iPortal, 0, 0, 7);
00094 
00102 struct iPortal : public iReference
00103 {
00105   virtual iObject *QueryObject () = 0;
00106 
00108   virtual iSector* GetSector () const = 0;
00109 
00114   virtual void SetSector (iSector* s) = 0;
00115 
00117   virtual csFlags& GetFlags () = 0;
00118 
00125   virtual void SetMaximumSectorVisit (int msv) = 0;
00127   virtual int GetMaximumSectorVisit () const = 0;
00128 
00134   virtual void SetPortalCallback (iPortalCallback* cb) = 0;
00135 
00137   virtual iPortalCallback* GetPortalCallback () const = 0;
00138 
00144   virtual void SetMissingSectorCallback (iPortalCallback* cb) = 0;
00145 
00147   virtual iPortalCallback* GetMissingSectorCallback () const = 0;
00148 
00150   virtual void SetFilter (iTextureHandle* ft) = 0;
00152   virtual iTextureHandle* GetTextureFilter () const = 0;
00153 
00155   virtual void SetFilter (float r, float g, float b) = 0;
00157   virtual void GetColorFilter (float &r, float &g, float &b) const = 0;
00158 
00159   //---- space warping ------------------------------------------------------
00160 
00165   virtual void SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before,
00166     const csVector3 &v_w_after) = 0;
00171   virtual void SetWarp (const csTransform& t) = 0;
00172 
00174   virtual void SetMirror (iPolygon3D *iPoly) = 0;
00175 
00177   virtual const csReversibleTransform &GetWarp () const = 0;
00178 
00180   virtual void ObjectToWorld (const csReversibleTransform& t) = 0;
00181 
00183   virtual void HardTransform (const csReversibleTransform& t) = 0;
00184 
00186   virtual csVector3 Warp (const csVector3& pos) const = 0;
00187 
00198   virtual void WarpSpace (csReversibleTransform& t, bool& mirror) const = 0;
00199 
00200   //-------------------------------------------------------------------------
00201 
00207   virtual bool CompleteSector (iBase* context) = 0;
00208 
00214   virtual void CheckFrustum (iFrustumView* lview, int alpha) = 0;
00215 };
00216 
00217 #endif // __IENGINE_PORTAL_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000