CrystalSpace

Public API Reference

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

viscull.h

Go to the documentation of this file.
00001 /*
00002     Crystal Space 3D engine
00003     Copyright (C) 2001 by Jorrit Tyberghein
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_IENGINE_VISCULL_H__
00021 #define __CS_IENGINE_VISCULL_H__
00022 
00029 #include "csutil/scf.h"
00030 
00031 struct iRenderView;
00032 struct iFrustumView;
00033 struct iVisibilityObject;
00034 struct iMovable;
00035 struct iShadowReceiver;
00036 struct iPolygon3D;
00037 struct iMeshWrapper;
00038 struct iPolygonMesh;
00039 struct iObjectModel;
00040 class csVector3;
00041 class csBox3;
00042 class csSphere;
00043 class csFlags;
00044 
00045 SCF_VERSION (iVisibilityObjectIterator, 0, 1, 0);
00046 
00050 struct iVisibilityObjectIterator : public iBase
00051 {
00053   virtual bool HasNext () const = 0;
00054 
00056   virtual iVisibilityObject* Next () = 0;
00057 
00059   virtual void Reset () = 0;
00060 };
00061 
00062 
00063 SCF_VERSION (iVisibilityCullerListener, 0, 0, 1);
00064 
00069 struct iVisibilityCullerListener : public iBase
00070 {
00075   virtual void ObjectVisible (iVisibilityObject *visobject, 
00076     iMeshWrapper *mesh) = 0;
00077 };
00078 
00079 SCF_VERSION (iVisibilityCuller, 0, 4, 0);
00080 
00087 struct iVisibilityCuller : public iBase
00088 {
00094   virtual void Setup (const char* name) = 0;
00102   virtual void RegisterVisObject (iVisibilityObject* visobj) = 0;
00104   virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0;
00111   virtual bool VisTest (iRenderView* irview, 
00112     iVisibilityCullerListener* viscallback) = 0;
00113 
00118   virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0;
00119 
00124   virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0;
00129   virtual void VisTest (const csSphere& sphere, 
00130     iVisibilityCullerListener* viscallback) = 0;
00131 
00137   virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane,
00138         int num_planes) = 0;
00139 
00146   virtual void VisTest (csPlane3* plane, int num_planes, 
00147     iVisibilityCullerListener* viscallback) = 0;
00148         
00154   virtual csPtr<iVisibilityObjectIterator> IntersectSegment (
00155     const csVector3& start, const csVector3& end, bool accurate = false) = 0;
00156 
00165   virtual bool IntersectSegment (const csVector3& start,
00166     const csVector3& end, csVector3& isect, float* pr = 0,
00167     iMeshWrapper** p_mesh = 0, iPolygon3D** poly = 0,
00168     bool accurate = false) = 0;
00169 
00180   virtual void CastShadows (iFrustumView* fview) = 0;
00181 
00188   //virtual uint32 GetCurrentVisibilityNumber () const = 0;
00189 };
00190 
00198 #define CS_CULLER_HINT_GOODOCCLUDER 4
00199 
00204 #define CS_CULLER_HINT_BADOCCLUDER 8
00205 
00208 SCF_VERSION (iVisibilityObject, 0, 2, 1);
00209 
00214 struct iVisibilityObject : public iBase
00215 {
00217   virtual iMovable* GetMovable () const = 0;
00219   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00220 
00226   virtual void SetVisibilityNumber (uint32 visnr) = 0;
00232   virtual uint32 GetVisibilityNumber () const = 0;
00233 
00237   virtual iObjectModel* GetObjectModel () = 0;
00238 
00247   virtual csFlags& GetCullerFlags () = 0;
00248 };
00249 
00252 #endif // __CS_IENGINE_VISCULL_H__
00253 

Generated for Crystal Space by doxygen 1.2.14