00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_IENGINE_SHADOWS_H__
00021 #define __CS_IENGINE_SHADOWS_H__
00022
00029 #include "csutil/scf.h"
00030 #include "csgeom/frustum.h"
00031
00032 struct iShadowBlock;
00033 struct iShadowBlockList;
00034 class csTransform;
00035 class csPlane3;
00036 class csVector3;
00037
00038 SCF_VERSION (iShadowIterator, 0, 0, 1);
00039
00044 struct iShadowIterator : public iBase
00045 {
00047 virtual void Reset () = 0;
00049 virtual bool HasNext () = 0;
00051 virtual csFrustum* Next () = 0;
00053 virtual void* GetUserData () = 0;
00055 virtual bool IsRelevant () = 0;
00057 virtual void MarkRelevant (bool rel) = 0;
00059 virtual void DeleteCurrent () = 0;
00061 virtual iShadowBlock* GetCurrentShadowBlock () = 0;
00063 virtual iShadowBlock* GetNextShadowBlock () = 0;
00064 };
00065
00066 SCF_VERSION (iShadowBlock, 0, 0, 3);
00067
00072 struct iShadowBlock : public iBase
00073 {
00075 virtual iShadowIterator* GetShadowIterator (bool reverse = false) = 0;
00077 virtual void DeleteShadows () = 0;
00078
00085 virtual void AddRelevantShadows (iShadowBlock* source,
00086 csTransform* trans = 0) = 0;
00087
00093 virtual void AddRelevantShadows (iShadowBlockList* source) = 0;
00094
00100 virtual void AddAllShadows (iShadowBlockList* source) = 0;
00101
00107 virtual void AddUniqueRelevantShadows (iShadowBlockList* source) = 0;
00108
00114 virtual csFrustum* AddShadow (const csVector3& origin, void* userData,
00115 int num_verts, csPlane3& backplane) = 0;
00116
00118 virtual void UnlinkShadow (int idx) = 0;
00119
00121 virtual int GetShadowCount () = 0;
00122
00124 virtual csFrustum* GetShadow (int idx) = 0;
00125
00129 virtual void Transform (csTransform* trans) = 0;
00130
00132 virtual const csBox3& GetBoundingBox () = 0;
00133 };
00134
00135 SCF_VERSION (iShadowBlockList, 0, 0, 5);
00136
00141 struct iShadowBlockList : public iBase
00142 {
00144 virtual iShadowIterator* GetShadowIterator (bool reverse = false) = 0;
00151 virtual iShadowIterator* GetShadowIterator (
00152 const csBox3& bbox, bool reverse = false) = 0;
00153
00155 virtual iShadowBlock* NewShadowBlock (int num_shadows = 30) = 0;
00156
00158 virtual iShadowBlock* GetFirstShadowBlock () = 0;
00160 virtual iShadowBlock* GetLastShadowBlock () = 0;
00162 virtual iShadowBlock* GetNextShadowBlock (iShadowBlock* s) = 0;
00164 virtual iShadowBlock* GetPreviousShadowBlock (iShadowBlock* s) = 0;
00166 virtual void RemoveLastShadowBlock () = 0;
00168 virtual void DeleteAllShadows () = 0;
00169
00176 virtual uint32 MarkNewRegion () = 0;
00177
00182 virtual void RestoreRegion (uint32 prev) = 0;
00183
00188 virtual bool FromCurrentRegion (iShadowBlock* block) = 0;
00189 };
00190
00193 #endif // __CS_IENGINE_SHADOWS_H__
00194