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 00030 #include "csutil/scf.h" 00031 00032 struct iDocumentNode; 00033 struct iFrustumView; 00034 struct iMeshWrapper; 00035 struct iMovable; 00036 struct iObjectModel; 00037 struct iRenderView; 00038 struct iVisibilityObject; 00039 00040 class csBox3; 00041 class csFlags; 00042 class csPlane3; 00043 class csSphere; 00044 class csVector3; 00045 00046 SCF_VERSION (iVisibilityObjectIterator, 0, 1, 0); 00047 00051 struct iVisibilityObjectIterator : public iBase 00052 { 00054 virtual bool HasNext () const = 0; 00055 00057 virtual iVisibilityObject* Next () = 0; 00058 00060 virtual void Reset () = 0; 00061 }; 00062 00063 00068 struct iVisibilityCullerListener : public virtual iBase 00069 { 00070 SCF_INTERFACE(iVisibilityCullerListener, 2,0,0); 00078 virtual void ObjectVisible (iVisibilityObject *visobject, 00079 iMeshWrapper *mesh, uint32 frustum_mask) = 0; 00080 }; 00081 00082 SCF_VERSION (iVisibilityCuller, 0, 7, 0); 00083 00102 struct iVisibilityCuller : public virtual iBase 00103 { 00109 virtual void Setup (const char* name) = 0; 00117 virtual void RegisterVisObject (iVisibilityObject* visobj) = 0; 00119 virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0; 00126 virtual bool VisTest (iRenderView* irview, 00127 iVisibilityCullerListener* viscallback) = 0; 00134 virtual void PrecacheCulling () = 0; 00135 00140 virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0; 00141 00146 virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0; 00151 virtual void VisTest (const csSphere& sphere, 00152 iVisibilityCullerListener* viscallback) = 0; 00153 00159 virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane, 00160 int num_planes) = 0; 00161 00168 virtual void VisTest (csPlane3* plane, int num_planes, 00169 iVisibilityCullerListener* viscallback) = 0; 00170 00177 virtual csPtr<iVisibilityObjectIterator> IntersectSegmentSloppy ( 00178 const csVector3& start, const csVector3& end) = 0; 00179 00185 virtual csPtr<iVisibilityObjectIterator> IntersectSegment ( 00186 const csVector3& start, const csVector3& end, bool accurate = false) = 0; 00187 00197 virtual bool IntersectSegment (const csVector3& start, 00198 const csVector3& end, csVector3& isect, float* pr = 0, 00199 iMeshWrapper** p_mesh = 0, int* poly_idx = 0, 00200 bool accurate = true) = 0; 00201 00212 virtual void CastShadows (iFrustumView* fview) = 0; 00213 00218 virtual const char* ParseCullerParameters (iDocumentNode* node) = 0; 00219 }; 00220 00228 #define CS_CULLER_HINT_GOODOCCLUDER 4 00229 00234 #define CS_CULLER_HINT_BADOCCLUDER 8 00235 00251 struct iVisibilityObject : public virtual iBase 00252 { 00253 SCF_INTERFACE(iVisibilityObject, 2, 0, 0); 00254 00256 virtual iMovable* GetMovable () const = 0; 00258 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00259 00263 virtual iObjectModel* GetObjectModel () = 0; 00264 00271 virtual csFlags& GetCullerFlags () = 0; 00272 }; 00273 00276 #endif // __CS_IENGINE_VISCULL_H__ 00277
Generated for Crystal Space by doxygen 1.4.6