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 {
00077   virtual void ObjectVisible (iVisibilityObject *visobject, 
00078     iMeshWrapper *mesh, uint32 frustum_mask) = 0;
00079 };
00080 
00081 SCF_VERSION (iVisibilityCuller, 0, 4, 0);
00082 
00105 struct iVisibilityCuller : public iBase
00106 {
00112   virtual void Setup (const char* name) = 0;
00120   virtual void RegisterVisObject (iVisibilityObject* visobj) = 0;
00122   virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0;
00129   virtual bool VisTest (iRenderView* irview, 
00130     iVisibilityCullerListener* viscallback) = 0;
00131 
00136   virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0;
00137 
00142   virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0;
00147   virtual void VisTest (const csSphere& sphere, 
00148     iVisibilityCullerListener* viscallback) = 0;
00149 
00155   virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane,
00156         int num_planes) = 0;
00157 
00164   virtual void VisTest (csPlane3* plane, int num_planes, 
00165     iVisibilityCullerListener* viscallback) = 0;
00166         
00172   virtual csPtr<iVisibilityObjectIterator> IntersectSegment (
00173     const csVector3& start, const csVector3& end, bool accurate = false) = 0;
00174 
00184   virtual bool IntersectSegment (const csVector3& start,
00185     const csVector3& end, csVector3& isect, float* pr = 0,
00186     iMeshWrapper** p_mesh = 0, int* poly_idx = 0,
00187     bool accurate = true) = 0;
00188 
00199   virtual void CastShadows (iFrustumView* fview) = 0;
00200 
00207   //virtual uint32 GetCurrentVisibilityNumber () const = 0;
00208 };
00209 
00217 #define CS_CULLER_HINT_GOODOCCLUDER 4
00218 
00223 #define CS_CULLER_HINT_BADOCCLUDER 8
00224 
00227 SCF_VERSION (iVisibilityObject, 0, 2, 1);
00228 
00246 struct iVisibilityObject : public iBase
00247 {
00249   virtual iMovable* GetMovable () const = 0;
00251   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00252 
00258   virtual void SetVisibilityNumber (uint32 visnr) = 0;
00264   virtual uint32 GetVisibilityNumber () const = 0;
00265 
00269   virtual iObjectModel* GetObjectModel () = 0;
00270 
00279   virtual csFlags& GetCullerFlags () = 0;
00280 };
00281 
00284 #endif // __CS_IENGINE_VISCULL_H__
00285 

Generated for Crystal Space by doxygen 1.2.18