Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | 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 csFlags; 00031 class csMatrix3; 00032 class csPlane3; 00033 class csReversibleTransform; 00034 class csTransform; 00035 class csVector3; 00036 00037 struct iFrustumView; 00038 struct iMeshWrapper; 00039 struct iMovable; 00040 struct iObject; 00041 struct iPortal; 00042 struct iSector; 00043 struct iTextureHandle; 00044 00045 00046 00052 #define CS_PORTAL_CLIPDEST 0x00000001 00053 00061 #define CS_PORTAL_CLIPSTRADDLING 0x00000002 00062 00071 #define CS_PORTAL_ZFILL 0x00000004 00072 00079 #define CS_PORTAL_WARP 0x00000008 00080 00086 #define CS_PORTAL_MIRROR 0x00000010 00087 00094 #define CS_PORTAL_STATICDEST 0x00000020 00095 00105 #define CS_PORTAL_FLOAT 0x00000040 00106 00110 #define CS_PORTAL_COLLDET 0x00000080 00111 00115 #define CS_PORTAL_VISCULL 0x00000100 00116 00117 00118 SCF_VERSION (iPortalCallback, 0, 0, 1); 00119 00127 struct iPortalCallback : public iBase 00128 { 00133 virtual bool Traverse (iPortal* portal, iBase* context) = 0; 00134 }; 00135 00136 SCF_VERSION (iPortal, 0, 6, 0); 00137 00158 struct iPortal : public iBase 00159 { 00161 virtual iObject *QueryObject () = 0; 00162 00164 virtual void SetName (const char* name) = 0; 00166 virtual const char* GetName () const = 0; 00167 00169 virtual iSector* GetSector () const = 0; 00170 00175 virtual const csVector3* GetVertices () const = 0; 00176 00181 virtual const csVector3* GetWorldVertices () = 0; 00182 00187 virtual int* GetVertexIndices () const = 0; 00188 00192 virtual int GetVertexIndicesCount () const = 0; 00193 00197 virtual const csPlane3& GetObjectPlane () = 0; 00198 00202 virtual const csPlane3& GetWorldPlane () = 0; 00203 00207 virtual void ComputeCameraPlane (const csReversibleTransform& t, 00208 csPlane3& camplane) = 0; 00209 00214 virtual bool PointOnPolygon (const csVector3& point) = 0; 00215 00220 virtual void SetSector (iSector* s) = 0; 00221 00223 virtual csFlags& GetFlags () = 0; 00224 00231 virtual void SetMaximumSectorVisit (int msv) = 0; 00233 virtual int GetMaximumSectorVisit () const = 0; 00234 00241 virtual void SetPortalCallback (iPortalCallback* cb) = 0; 00242 00246 virtual void RemovePortalCallback (iPortalCallback* cb) = 0; 00247 00249 virtual int GetPortalCallbackCount () const = 0; 00250 00252 virtual iPortalCallback* GetPortalCallback (int idx) const = 0; 00253 00260 virtual void SetMissingSectorCallback (iPortalCallback* cb) = 0; 00261 00265 virtual void RemoveMissingSectorCallback (iPortalCallback* cb) = 0; 00266 00268 virtual int GetMissingSectorCallbackCount () const = 0; 00269 00271 virtual iPortalCallback* GetMissingSectorCallback (int idx) const = 0; 00272 00274 virtual void SetFilter (iTextureHandle* ft) = 0; 00276 virtual iTextureHandle* GetTextureFilter () const = 0; 00277 00279 virtual void SetFilter (float r, float g, float b) = 0; 00281 virtual void GetColorFilter (float &r, float &g, float &b) const = 0; 00282 00283 //---- space warping ------------------------------------------------------ 00284 00289 virtual void SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before, 00290 const csVector3 &v_w_after) = 0; 00295 virtual void SetWarp (const csTransform& t) = 0; 00296 00298 virtual void SetMirror (const csPlane3& plane) = 0; 00299 00301 virtual const csReversibleTransform &GetWarp () const = 0; 00302 00304 virtual void HardTransform (const csReversibleTransform& t) = 0; 00305 00310 virtual void ObjectToWorld (const csReversibleTransform& t, 00311 csReversibleTransform& warp_wor) const = 0; 00312 00317 virtual csVector3 Warp (const csReversibleTransform& t, 00318 const csVector3& pos) const = 0; 00319 00331 virtual void WarpSpace (const csReversibleTransform& warp_wor, 00332 csReversibleTransform& t, bool& mirror) const = 0; 00333 00334 //------------------------------------------------------------------------- 00335 00341 virtual bool CompleteSector (iBase* context) = 0; 00342 00349 virtual void CheckFrustum (iFrustumView* lview, 00350 const csReversibleTransform& t, int alpha) = 0; 00351 00361 virtual iMeshWrapper* HitBeamPortals (const csReversibleTransform& t, 00362 const csVector3& start, const csVector3& end, 00363 csVector3& isect, int* polygon_idx) = 0; 00364 00368 virtual size_t GetVerticesCount () const = 0; 00369 00370 }; 00371 00374 #endif // __CS_IENGINE_PORTAL_H__ 00375
Generated for Crystal Space by doxygen 1.4.4