AI_SDB_GeometryOcclusionVisitor.h
Go to the documentation of this file.00001 #ifndef AI_SDB_GEOMETRYOCCLUSIONVISITOR_H 00002 #define AI_SDB_GEOMETRYOCCLUSIONVISITOR_H 00003 00004 // header file for the geometry-vased occlusion visitor 00005 // (C) 2004 Gary Haussmann 00006 // This code is licensed under the Nebula License 00007 00008 #include "AI_SDB_VisitorBase.h" 00009 #include "AI_SDB_PlaneClipper.h" 00010 00040 class AI_SDB_GeometryOcclusionVisitor : public AI_SDB_OcclusionVisitor { 00041 public: 00042 AI_SDB_GeometryOcclusionVisitor(const AI_Vector3 &vp, AI_SDB_VisibilityVisitor *v = NULL); 00043 ~AI_SDB_GeometryOcclusionVisitor(); 00044 00045 void Reset(); 00046 void Reset(const AI_Vector3 &newvp); 00047 00048 void Visit(AI_SDB_SpatialElement *visitee); 00049 00051 void AddBBoxOccluder(const AI_BBox &boxoccluder); 00053 void AddSphereOccluder(const AI_Sphere &sphereoccluder); 00055 void AddHullOccluder(const AI_SDB_PlaneClipper &hulloccluder); 00056 00058 AI_SDB_VisitorFlags VisibilityTest(const AI_BBox &testbox, AI_SDB_VisitorFlags flags); 00060 AI_SDB_VisitorFlags VisibilityTest(const AI_Sphere &testsphere, AI_SDB_VisitorFlags flags); 00061 00063 void EnterLocalSpace(AI_Matrix44 &warp); 00064 00066 void LeaveLocalSpace(); 00067 00068 protected: 00069 // the occluders, stored as AI_Plane clippers 00070 AI_Array<AI_SDB_PlaneClipper> m_occluderset; 00071 00072 // vertex endpoints of lines to draw for debugging purposes 00073 AI_Array<AI_Vector3> m_debuglines; 00074 }; 00075 00076 #endif