CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 iFrustumView;
00052 struct iSector;
00053 struct iPortal;
00054 class csRenderMeshList;
00055 
00056 SCF_VERSION (iSectorCallback, 0, 0, 1);
00057 
00063 struct iSectorCallback : public iBase
00064 {
00069   virtual void Traverse (iSector* sector, iBase* context) = 0;
00070 };
00071 
00072 SCF_VERSION (iSector, 0, 5, 3);
00073 
00083 struct iSector : public iBase
00084 {
00086   virtual csSector *GetPrivateObject () = 0;
00088   virtual iObject *QueryObject() = 0;
00089 
00091   virtual bool HasFog () const = 0;
00093   virtual csFog *GetFog () const = 0;
00095   virtual void SetFog (float density, const csColor& color) = 0;
00097   virtual void DisableFog () = 0;
00098 
00100   virtual iMeshList* GetMeshes () = 0;
00106   virtual iLightList* GetLights () = 0;
00107 
00109   virtual void ShineLights () = 0;
00111   virtual void ShineLights (iMeshWrapper*) = 0;
00112 
00114   virtual void SetDynamicAmbientLight(const csColor& color) = 0;
00115 
00117   virtual csColor GetDynamicAmbientLight() const = 0;
00118 
00124   virtual void CalculateSectorBBox (csBox3& bbox,
00125     bool do_meshes) const = 0;
00126 
00132   virtual bool SetVisibilityCullerPlugin (const char *Name) = 0;
00138   virtual iVisibilityCuller* GetVisibilityCuller () = 0;
00139 
00143   virtual int GetRecLevel () const = 0;
00144 
00148   virtual void IncRecLevel () = 0;
00149 
00153   virtual void DecRecLevel () = 0;
00154 
00163   virtual iMeshWrapper* HitBeamPortals (const csVector3& start,
00164         const csVector3& end, csVector3& isect, int* polygon_idx) = 0;
00165 
00173   virtual iMeshWrapper* HitBeam (const csVector3& start, const csVector3& end,
00174     csVector3& intersect, int* polygon_idx, bool accurate = false) = 0;
00175 
00194   virtual iSector* FollowSegment (csReversibleTransform& t,
00195     csVector3& new_position, bool& mirror, bool only_portals = false) = 0;
00196 
00198   virtual void Draw (iRenderView* rview) = 0;
00199 
00204   virtual void PrepareDraw (iRenderView* rview) = 0;
00205 
00212   virtual csRenderMeshList* GetVisibleMeshes (iRenderView *) = 0;
00213 
00218   virtual void SetSectorCallback (iSectorCallback* cb) = 0;
00219 
00223   virtual void RemoveSectorCallback (iSectorCallback* cb) = 0;
00224 
00226   virtual int GetSectorCallbackCount () const = 0;
00227 
00229   virtual iSectorCallback* GetSectorCallback (int idx) const = 0;
00230 
00232   virtual void CheckFrustum (iFrustumView* lview) = 0;
00233 
00240   virtual const csSet<iMeshWrapper*>& GetPortalMeshes () const = 0;
00244   virtual void RegisterPortalMesh (iMeshWrapper* mesh) = 0;
00248   virtual void UnregisterPortalMesh (iMeshWrapper* mesh) = 0;
00249 };
00250 
00251 
00252 SCF_VERSION (iSectorList, 0, 0, 2);
00253 
00257 struct iSectorList : public iBase
00258 {
00260   virtual int GetCount () const = 0;
00261 
00263   virtual iSector *Get (int n) const = 0;
00264 
00266   virtual int Add (iSector *obj) = 0;
00267 
00269   virtual bool Remove (iSector *obj) = 0;
00270 
00272   virtual bool Remove (int n) = 0;
00273 
00275   virtual void RemoveAll () = 0;
00276 
00278   virtual int Find (iSector *obj) const = 0;
00279 
00281   virtual iSector *FindByName (const char *Name) const = 0;
00282 };
00283 
00284 SCF_VERSION (iSectorIterator, 0, 1, 0);
00285 
00290 struct iSectorIterator : public iBase
00291 {
00293   virtual bool HasNext () = 0;
00294 
00296   virtual iSector* Next () = 0;
00297 
00302   virtual const csVector3& GetLastPosition () = 0;
00303 
00305   virtual void Reset () = 0;
00306 };
00307 
00310 #endif // __CS_IENGINE_SECTOR_H__

Generated for Crystal Space by doxygen 1.2.18