00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_IENGINE_SECTOR_H__
00021 #define __CS_IENGINE_SECTOR_H__
00022
00029 #include "cstypes.h"
00030 #include "csutil/scf.h"
00031 #include "iutil/object.h"
00032
00033 class csVector3;
00034 class csSector;
00035 class csColor;
00036 class csBox3;
00037 class csReversibleTransform;
00038 struct iMeshWrapper;
00039 struct iMeshList;
00040 struct iLightList;
00041 struct iLight;
00042 struct iThing;
00043 struct iStatLight;
00044 struct iVisibilityCuller;
00045 struct iObject;
00046 struct csFog;
00047 struct iGraphics3D;
00048 struct iPolygon3D;
00049 struct iRenderView;
00050 struct iFrustumView;
00051 struct iSector;
00052
00053 SCF_VERSION (iSectorCallback, 0, 0, 1);
00054
00060 struct iSectorCallback : public iBase
00061 {
00066 virtual void Traverse (iSector* sector, iBase* context) = 0;
00067 };
00068
00069
00070 SCF_VERSION (iSector, 0, 5, 2);
00071
00081 struct iSector : public iBase
00082 {
00084 virtual csSector *GetPrivateObject () = 0;
00086 virtual iObject *QueryObject() = 0;
00087
00088 #ifndef CS_USE_NEW_RENDERER
00089
00090 virtual bool HasFog () const = 0;
00092 virtual csFog *GetFog () const = 0;
00094 virtual void SetFog (float density, const csColor& color) = 0;
00096 virtual void DisableFog () = 0;
00097 #endif // CS_USE_NEW_RENDERER
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
00152 virtual iPolygon3D* HitBeam (const csVector3& start, const csVector3& end,
00153 csVector3& isect) = 0;
00154
00161 virtual iMeshWrapper* HitBeam (const csVector3& start, const csVector3& end,
00162 csVector3& intersect, iPolygon3D** polygonPtr, bool accurate = false) = 0;
00163
00182 virtual iSector* FollowSegment (csReversibleTransform& t,
00183 csVector3& new_position, bool& mirror, bool only_portals = false) = 0;
00184
00186 virtual void Draw (iRenderView* rview) = 0;
00187 #ifdef CS_USE_NEW_RENDERER
00188
00198 virtual void DrawZ (iRenderView* rview) = 0;
00204 virtual void DrawShadow (iRenderView* rview, iLight *light) = 0;
00209 virtual void DrawLight (iRenderView* rview, iLight *light) = 0;
00210 #endif
00211
00216 virtual void SetSectorCallback (iSectorCallback* cb) = 0;
00217
00221 virtual void RemoveSectorCallback (iSectorCallback* cb) = 0;
00222
00224 virtual int GetSectorCallbackCount () const = 0;
00225
00227 virtual iSectorCallback* GetSectorCallback (int idx) const = 0;
00228
00230 virtual void CheckFrustum (iFrustumView* lview) = 0;
00231 };
00232
00233
00234 SCF_VERSION (iSectorList, 0, 0, 2);
00235
00239 struct iSectorList : public iBase
00240 {
00242 virtual int GetCount () const = 0;
00243
00245 virtual iSector *Get (int n) const = 0;
00246
00248 virtual int Add (iSector *obj) = 0;
00249
00251 virtual bool Remove (iSector *obj) = 0;
00252
00254 virtual bool Remove (int n) = 0;
00255
00257 virtual void RemoveAll () = 0;
00258
00260 virtual int Find (iSector *obj) const = 0;
00261
00263 virtual iSector *FindByName (const char *Name) const = 0;
00264 };
00265
00266 SCF_VERSION (iSectorIterator, 0, 0, 1);
00267
00272 struct iSectorIterator : public iBase
00273 {
00275 virtual void Restart () = 0;
00276
00278 virtual iSector* Fetch () = 0;
00279
00284 virtual const csVector3& GetLastPosition () = 0;
00285 };
00286
00289 #endif // __CS_IENGINE_SECTOR_H__
00290