## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# iengine/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
    00029 #include "csutil/scf.h"
    00030
    00031 class csFlags;
    00032 class csMatrix3;
    00033 class csPlane3;
    00034 class csReversibleTransform;
    00035 class csTransform;
    00036 class csVector3;
    00037
    00038 struct iFrustumView;
    00039 struct iMeshWrapper;
    00040 struct iMovable;
    00041 struct iObject;
    00042 struct iPortal;
    00043 struct iSector;
    00044 struct iTextureHandle;
    00045
    00046
    00047
    00053 #define CS_PORTAL_CLIPDEST 0x00000001
    00054
    00062 #define CS_PORTAL_CLIPSTRADDLING 0x00000002
    00063
    00072 #define CS_PORTAL_ZFILL 0x00000004
    00073
    00080 #define CS_PORTAL_WARP 0x00000008
    00081
    00087 #define CS_PORTAL_MIRROR 0x00000010
    00088
    00095 #define CS_PORTAL_STATICDEST 0x00000020
    00096
    00106 #define CS_PORTAL_FLOAT 0x00000040
    00107
    00111 #define CS_PORTAL_COLLDET 0x00000080
    00112
    00116 #define CS_PORTAL_VISCULL 0x00000100
    00117
    00118
    00119 SCF_VERSION (iPortalCallback, 0, 0, 1);
    00120
    00128 struct iPortalCallback : public iBase
    00129 {
    00134   virtual bool Traverse (iPortal* portal, iBase* context) = 0;
    00135 };
    00136
    00153 struct iPortal : public virtual iBase
    00154 {
    00155   SCF_INTERFACE(iPortal, 2,0,0);
    00156
    00158   virtual void SetName (const char* name) = 0;
    00160   virtual const char* GetName () const = 0;
    00161
    00163   virtual iSector* GetSector () const = 0;
    00164
    00169   virtual const csVector3* GetVertices () const = 0;
    00170
    00175   virtual const csVector3* GetWorldVertices () = 0;
    00176
    00181   virtual int* GetVertexIndices () const = 0;
    00182
    00186   virtual int GetVertexIndicesCount () const = 0;
    00187
    00191   virtual const csPlane3& GetObjectPlane () = 0;
    00192
    00196   virtual const csPlane3& GetWorldPlane () = 0;
    00197
    00201   virtual void ComputeCameraPlane (const csReversibleTransform& t,
    00202         csPlane3& camplane) = 0;
    00203
    00208   virtual bool PointOnPolygon (const csVector3& point) = 0;
    00209
    00214   virtual void SetSector (iSector* s) = 0;
    00215
    00217   virtual csFlags& GetFlags () = 0;
    00218
    00225   virtual void SetMaximumSectorVisit (int msv) = 0;
    00227   virtual int GetMaximumSectorVisit () const = 0;
    00228
    00235   virtual void SetPortalCallback (iPortalCallback* cb) = 0;
    00236
    00240   virtual void RemovePortalCallback (iPortalCallback* cb) = 0;
    00241
    00243   virtual int GetPortalCallbackCount () const = 0;
    00244
    00246   virtual iPortalCallback* GetPortalCallback (int idx) const = 0;
    00247
    00254   virtual void SetMissingSectorCallback (iPortalCallback* cb) = 0;
    00255
    00259   virtual void RemoveMissingSectorCallback (iPortalCallback* cb) = 0;
    00260
    00262   virtual int GetMissingSectorCallbackCount () const = 0;
    00263
    00265   virtual iPortalCallback* GetMissingSectorCallback (int idx) const = 0;
    00266
    00268   virtual void SetFilter (iTextureHandle* ft) = 0;
    00270   virtual iTextureHandle* GetTextureFilter () const = 0;
    00271
    00273   virtual void SetFilter (float r, float g, float b) = 0;
    00275   virtual void GetColorFilter (float &r, float &g, float &b) const = 0;
    00276
    00277   //---- space warping ------------------------------------------------------
    00278
    00283   virtual void SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before,
    00284     const csVector3 &v_w_after) = 0;
    00289   virtual void SetWarp (const csTransform& t) = 0;
    00290
    00292   virtual void SetMirror (const csPlane3& plane) = 0;
    00293
    00295   virtual const csReversibleTransform &GetWarp () const = 0;
    00296
    00298   virtual void HardTransform (const csReversibleTransform& t) = 0;
    00299
    00304   virtual void ObjectToWorld (const csReversibleTransform& t,
    00305         csReversibleTransform& warp_wor) const = 0;
    00306
    00311   virtual csVector3 Warp (const csReversibleTransform& t,
    00312                   const csVector3& pos) const = 0;
    00313
    00325   virtual void WarpSpace (const csReversibleTransform& warp_wor,
    00326                   csReversibleTransform& t, bool& mirror) const = 0;
    00327
    00328   //-------------------------------------------------------------------------
    00329
    00335   virtual bool CompleteSector (iBase* context) = 0;
    00336
    00343   virtual void CheckFrustum (iFrustumView* lview,
    00344           const csReversibleTransform& t, int alpha) = 0;
    00345
    00355   virtual iMeshWrapper* HitBeamPortals (const csReversibleTransform& t,
    00356         const csVector3& start, const csVector3& end,
    00357         csVector3& isect, int* polygon_idx) = 0;
    00358
    00362   virtual size_t GetVerticesCount () const = 0;
    00363
    00364 };
    00365
    00368 #endif // __CS_IENGINE_PORTAL_H__
    00369