CrystalSpace

Public API Reference

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 csSectorVisibleRenderMeshes;
00033 struct iDocumentNode;
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, 3, 0, 0);
00080   virtual void ObjectVisible (iVisibilityObject *visobject, 
00081     iMeshWrapper *mesh, uint32 frustum_mask) = 0;
00082 
00086   virtual int GetVisibleMeshes (iMeshWrapper* mw, uint32 frustum_mask,
00087     csSectorVisibleRenderMeshes*& meshList) = 0;
00088 
00092   virtual void MarkVisible (iMeshWrapper *mw, int numMeshes,
00093     csSectorVisibleRenderMeshes*& meshList) = 0;
00094 };
00095 
00113 struct iVisibilityCuller : public virtual iBase
00114 {
00115   SCF_INTERFACE (iVisibilityCuller, 5, 0, 0);
00116 
00122   virtual void Setup (const char* name) = 0;
00130   virtual void RegisterVisObject (iVisibilityObject* visobj) = 0;
00132   virtual void UnregisterVisObject (iVisibilityObject* visobj) = 0;
00139   virtual bool VisTest (iRenderView* irview, 
00140     iVisibilityCullerListener* viscallback,
00141     int renderWidth = 0, int renderHeight = 0) = 0;
00148   CS_DEPRECATED_METHOD_MSG("Use (Begin/End)PrecacheCulling methods!")
00149   virtual void PrecacheCulling () = 0;
00150 
00155   virtual csPtr<iVisibilityObjectIterator> VisTest (const csBox3& box) = 0;
00156 
00161   virtual csPtr<iVisibilityObjectIterator> VisTest (const csSphere& sphere) = 0;
00166   virtual void VisTest (const csSphere& sphere, 
00167     iVisibilityCullerListener* viscallback) = 0;
00168 
00174   virtual csPtr<iVisibilityObjectIterator> VisTest (csPlane3* plane,
00175         int num_planes) = 0;
00176 
00183   virtual void VisTest (csPlane3* plane, int num_planes, 
00184     iVisibilityCullerListener* viscallback) = 0;
00185 
00192   virtual csPtr<iVisibilityObjectIterator> IntersectSegmentSloppy (
00193     const csVector3& start, const csVector3& end) = 0;
00194 
00200   virtual csPtr<iVisibilityObjectIterator> IntersectSegment (
00201     const csVector3& start, const csVector3& end, bool accurate = false) = 0;
00202 
00212   virtual bool IntersectSegment (const csVector3& start,
00213     const csVector3& end, csVector3& isect, float* pr = 0,
00214     iMeshWrapper** p_mesh = 0, int* poly_idx = 0,
00215     bool accurate = true) = 0;
00216 
00221   virtual const char* ParseCullerParameters (iDocumentNode* node) = 0;
00222 
00226   virtual void RenderViscull (iRenderView* rview, iShaderVariableContext* shadervars) = 0;
00227 
00231   virtual void BeginPrecacheCulling () = 0;
00232 
00236   virtual void EndPrecacheCulling () = 0;
00237 };
00238 
00246 #define CS_CULLER_HINT_GOODOCCLUDER 4
00247 
00252 #define CS_CULLER_HINT_BADOCCLUDER 8
00253 
00269 struct iVisibilityObject : public virtual iBase
00270 {
00271   SCF_INTERFACE(iVisibilityObject, 3, 0, 0);
00272 
00274   virtual iMovable* GetMovable () const = 0;
00276   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00277 
00281   virtual iObjectModel* GetObjectModel () = 0;
00282 
00289   virtual csFlags& GetCullerFlags () = 0;
00290 
00294   virtual const csBox3& GetBBox () const = 0;
00295 };
00296 
00299 #endif // __CS_IENGINE_VISCULL_H__
00300 

Generated for Crystal Space 2.0 by doxygen 1.7.6.1