Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
portal.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2003 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_PORTAL_H__ 00020 #define __CS_IENGINE_PORTAL_H__ 00021 00028 #include "csutil/scf.h" 00029 00030 class csReversibleTransform; 00031 class csPlane3; 00032 struct iMeshWrapper; 00033 struct iMovable; 00034 00040 #define CS_PORTAL_CLIPDEST 0x00000001 00041 00049 #define CS_PORTAL_CLIPSTRADDLING 0x00000002 00050 00059 #define CS_PORTAL_ZFILL 0x00000004 00060 00067 #define CS_PORTAL_WARP 0x00000008 00068 00074 #define CS_PORTAL_MIRROR 0x00000010 00075 00082 #define CS_PORTAL_STATICDEST 0x00000020 00083 00093 #define CS_PORTAL_FLOAT 0x00000040 00094 00098 #define CS_PORTAL_COLLDET 0x00000080 00099 00103 #define CS_PORTAL_VISCULL 0x00000100 00104 00105 class csTransform; 00106 class csMatrix3; 00107 class csVector3; 00108 class csFlags; 00109 struct iTextureHandle; 00110 struct iSector; 00111 struct iPortal; 00112 struct iFrustumView; 00113 struct iObject; 00114 00115 SCF_VERSION (iPortalCallback, 0, 0, 1); 00116 00124 struct iPortalCallback : public iBase 00125 { 00130 virtual bool Traverse (iPortal* portal, iBase* context) = 0; 00131 }; 00132 00133 SCF_VERSION (iPortal, 0, 6, 0); 00134 00155 struct iPortal : public iBase 00156 { 00158 virtual iObject *QueryObject () = 0; 00159 00161 virtual void SetName (const char* name) = 0; 00163 virtual const char* GetName () const = 0; 00164 00166 virtual iSector* GetSector () const = 0; 00167 00172 virtual const csVector3* GetVertices () const = 0; 00173 00178 virtual const csVector3* GetWorldVertices () = 0; 00179 00184 virtual int* GetVertexIndices () const = 0; 00185 00189 virtual int GetVertexIndicesCount () const = 0; 00190 00194 virtual const csPlane3& GetObjectPlane () = 0; 00195 00199 virtual const csPlane3& GetWorldPlane () = 0; 00200 00204 virtual void ComputeCameraPlane (const csReversibleTransform& t, 00205 csPlane3& camplane) = 0; 00206 00211 virtual bool PointOnPolygon (const csVector3& point) = 0; 00212 00217 virtual void SetSector (iSector* s) = 0; 00218 00220 virtual csFlags& GetFlags () = 0; 00221 00228 virtual void SetMaximumSectorVisit (int msv) = 0; 00230 virtual int GetMaximumSectorVisit () const = 0; 00231 00238 virtual void SetPortalCallback (iPortalCallback* cb) = 0; 00239 00243 virtual void RemovePortalCallback (iPortalCallback* cb) = 0; 00244 00246 virtual int GetPortalCallbackCount () const = 0; 00247 00249 virtual iPortalCallback* GetPortalCallback (int idx) const = 0; 00250 00257 virtual void SetMissingSectorCallback (iPortalCallback* cb) = 0; 00258 00262 virtual void RemoveMissingSectorCallback (iPortalCallback* cb) = 0; 00263 00265 virtual int GetMissingSectorCallbackCount () const = 0; 00266 00268 virtual iPortalCallback* GetMissingSectorCallback (int idx) const = 0; 00269 00271 virtual void SetFilter (iTextureHandle* ft) = 0; 00273 virtual iTextureHandle* GetTextureFilter () const = 0; 00274 00276 virtual void SetFilter (float r, float g, float b) = 0; 00278 virtual void GetColorFilter (float &r, float &g, float &b) const = 0; 00279 00280 //---- space warping ------------------------------------------------------ 00281 00286 virtual void SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before, 00287 const csVector3 &v_w_after) = 0; 00292 virtual void SetWarp (const csTransform& t) = 0; 00293 00295 virtual void SetMirror (const csPlane3& plane) = 0; 00296 00298 virtual const csReversibleTransform &GetWarp () const = 0; 00299 00301 virtual void HardTransform (const csReversibleTransform& t) = 0; 00302 00307 virtual void ObjectToWorld (const csReversibleTransform& t, 00308 csReversibleTransform& warp_wor) const = 0; 00309 00314 virtual csVector3 Warp (const csReversibleTransform& t, 00315 const csVector3& pos) const = 0; 00316 00328 virtual void WarpSpace (const csReversibleTransform& warp_wor, 00329 csReversibleTransform& t, bool& mirror) const = 0; 00330 00331 //------------------------------------------------------------------------- 00332 00338 virtual bool CompleteSector (iBase* context) = 0; 00339 00346 virtual void CheckFrustum (iFrustumView* lview, 00347 const csReversibleTransform& t, int alpha) = 0; 00348 00358 virtual iMeshWrapper* HitBeamPortals (const csReversibleTransform& t, 00359 const csVector3& start, const csVector3& end, 00360 csVector3& isect, int* polygon_idx) = 0; 00361 00362 }; 00363 00366 #endif // __CS_IENGINE_PORTAL_H__ 00367
Generated for Crystal Space by doxygen 1.3.9.1