iengine/sector.h
Go to the documentation of this file.00001 /* 00002 Crystal Space 3D engine 00003 Copyright (C) 1998-2001 by Jorrit Tyberghein 00004 2004 by Marten Svanfeldt 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the Free 00018 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __CS_IENGINE_SECTOR_H__ 00022 #define __CS_IENGINE_SECTOR_H__ 00023 00030 #include "cstypes.h" 00031 #include "csutil/scf.h" 00032 #include "csutil/hash.h" 00033 #include "iutil/object.h" 00034 00035 class csVector3; 00036 class csSector; 00037 class csColor; 00038 class csBox3; 00039 class csReversibleTransform; 00040 struct iMeshWrapper; 00041 struct iMeshList; 00042 struct iLightList; 00043 struct iLight; 00044 struct iThing; 00045 struct iVisibilityCuller; 00046 struct iVisibilityObject; 00047 struct iObject; 00048 struct csFog; 00049 struct iGraphics3D; 00050 struct iRenderView; 00051 struct iRenderLoop; 00052 struct iFrustumView; 00053 struct iSector; 00054 struct iPortal; 00055 class csRenderMeshList; 00056 00057 SCF_VERSION (iSectorCallback, 0, 0, 1); 00058 00064 struct iSectorCallback : public iBase 00065 { 00070 virtual void Traverse (iSector* sector, iBase* context) = 0; 00071 }; 00072 00073 SCF_VERSION (iSector, 0, 5, 3); 00074 00102 struct iSector : public iBase 00103 { 00105 virtual csSector *GetPrivateObject () = 0; 00107 virtual iObject *QueryObject () = 0; 00108 00113 virtual void SetRenderLoop (iRenderLoop* rl) = 0; 00114 00120 virtual iRenderLoop* GetRenderLoop () = 0; 00121 00123 virtual bool HasFog () const = 0; 00125 virtual csFog *GetFog () const = 0; 00127 virtual void SetFog (float density, const csColor& color) = 0; 00129 virtual void DisableFog () = 0; 00130 00132 virtual iMeshList* GetMeshes () = 0; 00136 virtual iLightList* GetLights () = 0; 00137 00139 virtual void ShineLights () = 0; 00141 virtual void ShineLights (iMeshWrapper*) = 0; 00142 00144 virtual void SetDynamicAmbientLight(const csColor& color) = 0; 00145 00147 virtual csColor GetDynamicAmbientLight() const = 0; 00148 00154 virtual void CalculateSectorBBox (csBox3& bbox, 00155 bool do_meshes) const = 0; 00156 00162 virtual bool SetVisibilityCullerPlugin (const char *Name) = 0; 00168 virtual iVisibilityCuller* GetVisibilityCuller () = 0; 00169 00173 virtual int GetRecLevel () const = 0; 00174 00178 virtual void IncRecLevel () = 0; 00179 00183 virtual void DecRecLevel () = 0; 00184 00193 virtual iMeshWrapper* HitBeamPortals (const csVector3& start, 00194 const csVector3& end, csVector3& isect, int* polygon_idx) = 0; 00195 00203 virtual iMeshWrapper* HitBeam (const csVector3& start, const csVector3& end, 00204 csVector3& intersect, int* polygon_idx, bool accurate = false) = 0; 00205 00224 virtual iSector* FollowSegment (csReversibleTransform& t, 00225 csVector3& new_position, bool& mirror, bool only_portals = false) = 0; 00226 00228 virtual void Draw (iRenderView* rview) = 0; 00229 00234 virtual void PrepareDraw (iRenderView* rview) = 0; 00235 00242 virtual csRenderMeshList* GetVisibleMeshes (iRenderView *) = 0; 00243 00248 virtual void SetSectorCallback (iSectorCallback* cb) = 0; 00249 00253 virtual void RemoveSectorCallback (iSectorCallback* cb) = 0; 00254 00256 virtual int GetSectorCallbackCount () const = 0; 00257 00259 virtual iSectorCallback* GetSectorCallback (int idx) const = 0; 00260 00262 virtual void CheckFrustum (iFrustumView* lview) = 0; 00263 00270 virtual const csSet<iMeshWrapper*>& GetPortalMeshes () const = 0; 00274 virtual void RegisterPortalMesh (iMeshWrapper* mesh) = 0; 00278 virtual void UnregisterPortalMesh (iMeshWrapper* mesh) = 0; 00279 }; 00280 00281 00282 SCF_VERSION (iSectorList, 0, 0, 2); 00283 00297 struct iSectorList : public iBase 00298 { 00300 virtual int GetCount () const = 0; 00301 00303 virtual iSector *Get (int n) const = 0; 00304 00306 virtual int Add (iSector *obj) = 0; 00307 00309 virtual bool Remove (iSector *obj) = 0; 00310 00312 virtual bool Remove (int n) = 0; 00313 00315 virtual void RemoveAll () = 0; 00316 00318 virtual int Find (iSector *obj) const = 0; 00319 00321 virtual iSector *FindByName (const char *Name) const = 0; 00322 }; 00323 00324 SCF_VERSION (iSectorIterator, 0, 1, 0); 00325 00335 struct iSectorIterator : public iBase 00336 { 00338 virtual bool HasNext () = 0; 00339 00341 virtual iSector* Next () = 0; 00342 00347 virtual const csVector3& GetLastPosition () = 0; 00348 00350 virtual void Reset () = 0; 00351 }; 00352 00355 #endif // __CS_IENGINE_SECTOR_H__
Generated for Crystal Space by doxygen 1.2.18