CrystalSpace

Public API Reference

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

iengine/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 iMeshWrapper;
00037 struct iPolygonMesh;
00038 struct iObjectModel;
00039 class csVector3;
00040 class csBox3;
00041 class csSphere;
00042 class csFlags;
00043 
00044 SCF_VERSION (iVisibilityObjectIterator, 0, 1, 0);
00045 
00049 struct iVisibilityObjectIterator : public iBase
00050 {
00052   virtual bool HasNext () const = 0;
00053 
00055   virtual iVisibilityObject* Next () = 0;
00056 
00058   virtual void Reset () = 0;
00059 };
00060 
00061 
00062 SCF_VERSION (iVisibilityCullerListener, 0, 0, 1);
00063 
00068 struct iVisibilityCullerListener : public iBase
00069 {
00074   virtual void ObjectVisible (iVisibilityObject *visobject, 
00075     iMeshWrapper *mesh) = 0;
00076 };
00077 
00078 SCF_VERSION (iVisibilityCuller, 0, 4, 0);
00079 
00086 struct iVisibilityCuller : public iBase
00087 {
00093   virtual void Setup (const char* name) = 0;
00101   virtual void RegisterVisObject (iVisibilityObject* visobj) = 0;
00103   virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0;
00110   virtual bool VisTest (iRenderView* irview, 
00111     iVisibilityCullerListener* viscallback) = 0;
00112 
00117   virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0;
00118 
00123   virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0;
00128   virtual void VisTest (const csSphere& sphere, 
00129     iVisibilityCullerListener* viscallback) = 0;
00130 
00136   virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane,
00137         int num_planes) = 0;
00138 
00145   virtual void VisTest (csPlane3* plane, int num_planes, 
00146     iVisibilityCullerListener* viscallback) = 0;
00147         
00153   virtual csPtr<iVisibilityObjectIterator> IntersectSegment (
00154     const csVector3& start, const csVector3& end, bool accurate = false) = 0;
00155 
00165   virtual bool IntersectSegment (const csVector3& start,
00166     const csVector3& end, csVector3& isect, float* pr = 0,
00167     iMeshWrapper** p_mesh = 0, int* poly_idx = 0,
00168     bool accurate = true) = 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.18