CrystalSpace

Public API Reference

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

fview.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2000-2001 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_IENGINE_FVIEW_H__
00020 #define __CS_IENGINE_FVIEW_H__
00021 
00028 #include "csutil/scf.h"
00029 #include "csgeom/plane3.h"
00030 #include "csgeom/transfrm.h"
00031 #include "csgeom/box.h"
00032 #include "iengine/shadows.h"
00033 
00034 struct iFrustumView;
00035 struct iMeshWrapper;
00036 class csFrustum;
00037 class csFrustumContext;
00038 class csObject;
00039 class csOctreeNode;
00040 
00041 
00042 SCF_VERSION (iFrustumViewUserdata, 0, 0, 1);
00043 
00047 struct iFrustumViewUserdata : public iBase
00048 {
00049 };
00050 
00055 typedef void (csFrustumViewObjectFunc)(iMeshWrapper* mesh,
00056   iFrustumView* lview, bool vis);
00057 
00064 class csFrustumContext
00065 {
00066 private:
00072   csRef<iShadowBlockList> shadows;
00077   bool shared;
00078 
00080   bool mirror;
00081 
00086   csRef<csFrustum> light_frustum;
00087 
00088 public:
00090   csFrustumContext () :
00091     shared (false),
00092     mirror (false)
00093   { }
00094 
00095   csFrustumContext& operator= (csFrustumContext const& c)
00096   {
00097     shadows = c.shadows;
00098     shared = c.shared;
00099     mirror = c.mirror;
00100     light_frustum = c.light_frustum;
00101     return *this;
00102   }
00103 
00105   iShadowBlockList* GetShadows () { return shadows; }
00107   void SetShadows (iShadowBlockList* shad, bool sh = true)
00108   {
00109     shadows = shad;
00110     shared = sh;
00111   }
00113   void SetNewShadows (csPtr<iShadowBlockList> shad, bool sh = false)
00114   {
00115     shadows = shad;
00116     shared = sh;
00117   }
00119   bool IsShared () { return shared; }
00120 
00122   void SetLightFrustum (csFrustum* lf) { light_frustum = lf; }
00124   void SetNewLightFrustum (csPtr<csFrustum> lf) { light_frustum = lf; }
00126   csFrustum* GetLightFrustum () { return light_frustum; }
00127 
00132   void SetMirrored (bool m) { mirror = m; }
00134   bool IsMirrored () { return mirror; }
00135 };
00136 
00137 SCF_VERSION (iFrustumView, 0, 4, 1);
00138 
00143 struct iFrustumView : public iBase
00144 {
00146   virtual csFrustumContext* GetFrustumContext () const = 0;
00154   virtual void CreateFrustumContext () = 0;
00159   virtual csFrustumContext* CopyFrustumContext () = 0;
00164   virtual void SetFrustumContext (csFrustumContext* ctxt) = 0;
00170   virtual void RestoreFrustumContext (csFrustumContext* original) = 0;
00171 
00173   virtual void SetObjectFunction (csFrustumViewObjectFunc* func) = 0;
00175   virtual void CallObjectFunction (iMeshWrapper* mesh, bool vis) = 0;
00176 
00178   virtual float GetRadius () const = 0;
00180   virtual float GetSquaredRadius () const = 0;
00182   virtual bool ThingShadowsEnabled () = 0;
00184   virtual bool CheckShadowMask (unsigned int mask) = 0;
00186   virtual bool CheckProcessMask (unsigned int mask) = 0;
00187 
00189   virtual void StartNewShadowBlock () = 0;
00190 
00192   virtual void SetUserdata (iFrustumViewUserdata* data) = 0;
00194   virtual iFrustumViewUserdata* GetUserdata () = 0;
00195 
00197   virtual csPtr<iShadowBlock> CreateShadowBlock () = 0;
00198 };
00199 
00202 #endif // __CS_IENGINE_FVIEW_H__
00203 

Generated for Crystal Space by doxygen 1.3.9.1