Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
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 csColor; 00037 class csBox3; 00038 class csReversibleTransform; 00039 struct iMeshWrapper; 00040 struct iMeshList; 00041 struct iLightList; 00042 struct iLight; 00043 struct iThing; 00044 struct iVisibilityCuller; 00045 struct iVisibilityObject; 00046 struct iObject; 00047 struct csFog; 00048 struct iGraphics3D; 00049 struct iRenderView; 00050 struct iRenderLoop; 00051 struct iFrustumView; 00052 struct iSector; 00053 struct iPortal; 00054 struct iDocumentNode; 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 (iSectorMeshCallback, 0, 0, 1); 00074 00079 struct iSectorMeshCallback : public iBase 00080 { 00085 virtual void NewMesh (iSector* sector, iMeshWrapper* mesh) = 0; 00086 00090 virtual void RemoveMesh (iSector* sector, iMeshWrapper* mesh) = 0; 00091 }; 00092 00093 SCF_VERSION (iSector, 0, 5, 5); 00094 00122 struct iSector : public iBase 00123 { 00125 virtual iObject *QueryObject () = 0; 00126 00131 virtual void SetRenderLoop (iRenderLoop* rl) = 0; 00132 00138 virtual iRenderLoop* GetRenderLoop () = 0; 00139 00141 virtual bool HasFog () const = 0; 00143 virtual csFog *GetFog () const = 0; 00145 virtual void SetFog (float density, const csColor& color) = 0; 00147 virtual void DisableFog () = 0; 00148 00150 virtual iMeshList* GetMeshes () = 0; 00154 virtual iLightList* GetLights () = 0; 00155 00157 virtual void ShineLights () = 0; 00159 virtual void ShineLights (iMeshWrapper*) = 0; 00160 00162 virtual void SetDynamicAmbientLight(const csColor& color) = 0; 00163 00165 virtual csColor GetDynamicAmbientLight() const = 0; 00166 00172 virtual void CalculateSectorBBox (csBox3& bbox, 00173 bool do_meshes) const = 0; 00174 00182 virtual bool SetVisibilityCullerPlugin (const char* name, 00183 iDocumentNode* culler_params = 0) = 0; 00189 virtual iVisibilityCuller* GetVisibilityCuller () = 0; 00190 00194 virtual int GetRecLevel () const = 0; 00195 00199 virtual void IncRecLevel () = 0; 00200 00204 virtual void DecRecLevel () = 0; 00205 00214 virtual iMeshWrapper* HitBeamPortals (const csVector3& start, 00215 const csVector3& end, csVector3& isect, int* polygon_idx) = 0; 00216 00224 virtual iMeshWrapper* HitBeam (const csVector3& start, const csVector3& end, 00225 csVector3& intersect, int* polygon_idx, bool accurate = false) = 0; 00226 00245 virtual iSector* FollowSegment (csReversibleTransform& t, 00246 csVector3& new_position, bool& mirror, bool only_portals = false) = 0; 00247 00249 virtual void Draw (iRenderView* rview) = 0; 00250 00255 virtual void PrepareDraw (iRenderView* rview) = 0; 00256 00263 virtual csRenderMeshList* GetVisibleMeshes (iRenderView *) = 0; 00264 00269 virtual void SetSectorCallback (iSectorCallback* cb) = 0; 00270 00274 virtual void RemoveSectorCallback (iSectorCallback* cb) = 0; 00275 00277 virtual int GetSectorCallbackCount () const = 0; 00278 00280 virtual iSectorCallback* GetSectorCallback (int idx) const = 0; 00281 00286 virtual void AddSectorMeshCallback (iSectorMeshCallback* cb) = 0; 00287 00291 virtual void RemoveSectorMeshCallback (iSectorMeshCallback* cb) = 0; 00292 00294 virtual void CheckFrustum (iFrustumView* lview) = 0; 00295 00302 virtual const csSet<iMeshWrapper*>& GetPortalMeshes () const = 0; 00306 virtual void RegisterPortalMesh (iMeshWrapper* mesh) = 0; 00310 virtual void UnregisterPortalMesh (iMeshWrapper* mesh) = 0; 00311 00318 virtual void UnlinkObjects () = 0; 00319 }; 00320 00321 00322 SCF_VERSION (iSectorList, 0, 0, 2); 00323 00337 struct iSectorList : public iBase 00338 { 00340 virtual int GetCount () const = 0; 00341 00343 virtual iSector *Get (int n) const = 0; 00344 00346 virtual int Add (iSector *obj) = 0; 00347 00349 virtual bool Remove (iSector *obj) = 0; 00350 00352 virtual bool Remove (int n) = 0; 00353 00355 virtual void RemoveAll () = 0; 00356 00358 virtual int Find (iSector *obj) const = 0; 00359 00361 virtual iSector *FindByName (const char *Name) const = 0; 00362 }; 00363 00364 SCF_VERSION (iSectorIterator, 0, 1, 0); 00365 00375 struct iSectorIterator : public iBase 00376 { 00378 virtual bool HasNext () = 0; 00379 00381 virtual iSector* Next () = 0; 00382 00387 virtual const csVector3& GetLastPosition () = 0; 00388 00390 virtual void Reset () = 0; 00391 }; 00392 00395 #endif // __CS_IENGINE_SECTOR_H__
Generated for Crystal Space by doxygen 1.3.9.1