CrystalSpace

Public API Reference

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

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, 0, 1);
00046 
00050 struct iVisibilityObjectIterator : public iBase
00051 {
00053   virtual bool Next () = 0;
00054 
00056   virtual void Reset () = 0;
00057 
00059   virtual iVisibilityObject* GetObject () const = 0;
00060 
00062   virtual bool IsFinished () const = 0;
00063 };
00064 
00065 SCF_VERSION (iVisibilityCuller, 0, 3, 2);
00066 
00073 struct iVisibilityCuller : public iBase
00074 {
00080   virtual void Setup (const char* name) = 0;
00088   virtual void RegisterVisObject (iVisibilityObject* visobj) = 0;
00090   virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0;
00097   virtual bool VisTest (iRenderView* irview) = 0;
00098 
00103   virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0;
00104 
00109   virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0;
00110 
00116   virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane,
00117         int num_planes) = 0;
00118 
00124   virtual csPtr<iVisibilityObjectIterator> IntersectSegment (
00125     const csVector3& start, const csVector3& end, bool accurate = false) = 0;
00126 
00135   virtual bool IntersectSegment (const csVector3& start,
00136     const csVector3& end, csVector3& isect, float* pr = NULL,
00137     iMeshWrapper** p_mesh = NULL, iPolygon3D** poly = NULL,
00138     bool accurate = false) = 0;
00139 
00150   virtual void CastShadows (iFrustumView* fview) = 0;
00151 
00158   virtual uint32 GetCurrentVisibilityNumber () const = 0;
00159 };
00160 
00168 #define CS_CULLER_HINT_CONVEX 1
00169 
00181 #define CS_CULLER_HINT_CLOSED 2
00182 
00188 #define CS_CULLER_HINT_GOODOCCLUDER 4
00189 
00194 #define CS_CULLER_HINT_BADOCCLUDER 8
00195 
00198 SCF_VERSION (iVisibilityObject, 0, 2, 1);
00199 
00204 struct iVisibilityObject : public iBase
00205 {
00207   virtual iMovable* GetMovable () const = 0;
00209   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00210 
00216   virtual void SetVisibilityNumber (uint32 visnr) = 0;
00222   virtual uint32 GetVisibilityNumber () const = 0;
00223 
00227   virtual iObjectModel* GetObjectModel () = 0;
00228 
00239   virtual csFlags& GetCullerFlags () = 0;
00240 };
00241 
00244 #endif // __CS_IENGINE_VISCULL_H__
00245 

Generated for Crystal Space by doxygen 1.2.14