CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File 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 __CS_THING_PORTAL_H__
00020 #define __CS_THING_PORTAL_H__
00021 
00022 #include "csutil/scf.h"
00023 #include "iutil/objref.h"
00024 
00025 class csReversibleTransform;
00026 class csPlane3;
00027 
00033 #define CS_PORTAL_CLIPDEST 0x00000001
00034 
00043 #define CS_PORTAL_ZFILL 0x00000002
00044 
00051 #define CS_PORTAL_WARP 0x00000004
00052 
00058 #define CS_PORTAL_MIRROR 0x00000008
00059 
00066 #define CS_PORTAL_STATICDEST 0x00000010
00067 
00077 #define CS_PORTAL_FLOAT 0x00000020
00078 
00079 class csTransform;
00080 class csMatrix3;
00081 class csVector3;
00082 class csFlags;
00083 struct iTextureHandle;
00084 struct iSector;
00085 struct iPolygon3D;
00086 struct iPortal;
00087 struct iFrustumView;
00088 struct iObject;
00089 
00090 SCF_VERSION (iPortalCallback, 0, 0, 1);
00091 
00099 struct iPortalCallback : public iBase
00100 {
00105   virtual bool Traverse (iPortal* portal, iBase* context) = 0;
00106 };
00107 
00108 SCF_VERSION (iPortal, 0, 2, 1);
00109 
00117 struct iPortal : public iReference
00118 {
00120   virtual iObject *QueryObject () = 0;
00121 
00123   virtual iSector* GetSector () const = 0;
00124 
00129   virtual void SetSector (iSector* s) = 0;
00130 
00132   virtual csFlags& GetFlags () = 0;
00133 
00140   virtual void SetMaximumSectorVisit (int msv) = 0;
00142   virtual int GetMaximumSectorVisit () const = 0;
00143 
00150   virtual void SetPortalCallback (iPortalCallback* cb) = 0;
00151 
00155   virtual void RemovePortalCallback (iPortalCallback* cb) = 0;
00156 
00158   virtual int GetPortalCallbackCount () const = 0;
00159   
00161   virtual iPortalCallback* GetPortalCallback (int idx) const = 0;
00162 
00169   virtual void SetMissingSectorCallback (iPortalCallback* cb) = 0;
00170 
00174   virtual void RemoveMissingSectorCallback (iPortalCallback* cb) = 0;
00175 
00177   virtual int GetMissingSectorCallbackCount () const = 0;
00178   
00180   virtual iPortalCallback* GetMissingSectorCallback (int idx) const = 0;
00181 
00183   virtual void SetFilter (iTextureHandle* ft) = 0;
00185   virtual iTextureHandle* GetTextureFilter () const = 0;
00186 
00188   virtual void SetFilter (float r, float g, float b) = 0;
00190   virtual void GetColorFilter (float &r, float &g, float &b) const = 0;
00191 
00192   //---- space warping ------------------------------------------------------
00193 
00198   virtual void SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before,
00199     const csVector3 &v_w_after) = 0;
00204   virtual void SetWarp (const csTransform& t) = 0;
00205 
00207   virtual void SetMirror (const csPlane3& plane) = 0;
00208 
00210   virtual const csReversibleTransform &GetWarp () const = 0;
00211 
00213   virtual void HardTransform (const csReversibleTransform& t) = 0;
00214 
00219   virtual void ObjectToWorld (const csReversibleTransform& t,
00220         csReversibleTransform& warp_wor) const = 0;
00221 
00226   virtual csVector3 Warp (const csReversibleTransform& t,
00227                   const csVector3& pos) const = 0;
00228 
00240   virtual void WarpSpace (const csReversibleTransform& warp_wor,
00241                   csReversibleTransform& t, bool& mirror) const = 0;
00242 
00243   //-------------------------------------------------------------------------
00244 
00250   virtual bool CompleteSector (iBase* context) = 0;
00251 
00258   virtual void CheckFrustum (iFrustumView* lview,
00259           const csReversibleTransform& t, int alpha) = 0;
00260 
00270   virtual iPolygon3D* HitBeam (const csReversibleTransform& t,
00271         const csVector3& start, const csVector3& end,
00272         csVector3& isect) = 0;
00273 
00274 };
00275 
00276 #endif // __CS_THING_PORTAL_H__

Generated for Crystal Space by doxygen 1.2.14