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_interface.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 00049 struct iVisibilityObjectIterator : public virtual iBase 00050 { 00051 SCF_INTERFACE (iVisibilityObjectIterator, 2, 0, 0); 00053 virtual bool HasNext () const = 0; 00054 00056 virtual iVisibilityObject* Next () = 0; 00057 00059 virtual void Reset () = 0; 00060 }; 00061 00062 00070 struct iVisibilityCullerListener : public virtual iBase 00071 { 00072 SCF_INTERFACE(iVisibilityCullerListener, 2,0,0); 00080 virtual void ObjectVisible (iVisibilityObject *visobject, 00081 iMeshWrapper *mesh, uint32 frustum_mask) = 0; 00082 }; 00083 00101 struct iVisibilityCuller : public virtual iBase 00102 { 00103 SCF_INTERFACE (iVisibilityCuller, 2, 0, 0); 00104 00110 virtual void Setup (const char* name) = 0; 00118 virtual void RegisterVisObject (iVisibilityObject* visobj) = 0; 00120 virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0; 00127 virtual bool VisTest (iRenderView* irview, 00128 iVisibilityCullerListener* viscallback) = 0; 00135 virtual void PrecacheCulling () = 0; 00136 00141 virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0; 00142 00147 virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0; 00152 virtual void VisTest (const csSphere& sphere, 00153 iVisibilityCullerListener* viscallback) = 0; 00154 00160 virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane, 00161 int num_planes) = 0; 00162 00169 virtual void VisTest (csPlane3* plane, int num_planes, 00170 iVisibilityCullerListener* viscallback) = 0; 00171 00178 virtual csPtr<iVisibilityObjectIterator> IntersectSegmentSloppy ( 00179 const csVector3& start, const csVector3& end) = 0; 00180 00186 virtual csPtr<iVisibilityObjectIterator> IntersectSegment ( 00187 const csVector3& start, const csVector3& end, bool accurate = false) = 0; 00188 00198 virtual bool IntersectSegment (const csVector3& start, 00199 const csVector3& end, csVector3& isect, float* pr = 0, 00200 iMeshWrapper** p_mesh = 0, int* poly_idx = 0, 00201 bool accurate = true) = 0; 00202 00213 virtual void CastShadows (iFrustumView* fview) = 0; 00214 00219 virtual const char* ParseCullerParameters (iDocumentNode* node) = 0; 00220 }; 00221 00229 #define CS_CULLER_HINT_GOODOCCLUDER 4 00230 00235 #define CS_CULLER_HINT_BADOCCLUDER 8 00236 00252 struct iVisibilityObject : public virtual iBase 00253 { 00254 SCF_INTERFACE(iVisibilityObject, 2, 0, 0); 00255 00257 virtual iMovable* GetMovable () const = 0; 00259 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00260 00264 virtual iObjectModel* GetObjectModel () = 0; 00265 00272 virtual csFlags& GetCullerFlags () = 0; 00273 }; 00274 00277 #endif // __CS_IENGINE_VISCULL_H__ 00278
Generated for Crystal Space by doxygen 1.4.7