AI_SDB_VisibleSphereVisitor.h

Go to the documentation of this file.
00001 #ifndef AI_SDB_VISIBLESPHEREVISITOR_H
00002 #define AI_SDB_VISIBLESPHEREVISITOR_H
00003 
00019 #include "AI_SDB_VisitorBase.h"
00020 #include "AI_SDB_SphereClipper.h"
00021 #include "AI_SDB_SpatialElements.h"
00022 
00023 class AI_SDB_VisibleSphereVisitor : public AI_SDB_VisibilityVisitor {
00024 public:
00025     AI_SDB_VisibleSphereVisitor(const AI_Sphere &viewsphere);
00026     ~AI_SDB_VisibleSphereVisitor();
00027 
00028     virtual void Reset();
00029 
00031     void Reset(const AI_Sphere &viewsphere);
00032 
00033     virtual void Visit(AI_SDB_SpatialElement *visitee);
00034 
00038     virtual AI_SDB_VisitorFlags VisibilityTest(const AI_BBox &testbox, AI_SDB_VisitorFlags flags);
00039 
00043     virtual AI_SDB_VisitorFlags VisibilityTest(const AI_Sphere &testsphere, AI_SDB_VisitorFlags flags);
00044 
00045     // entering a new local space; the matrix given will transform from the current local system into
00046     // the new space local coordinate system.  This is used to possibly update a transform matrix
00047     // or to transform the spatial region to a new coordinate system.
00048     virtual void EnterLocalSpace(AI_Matrix44 &warp);
00049 
00051     virtual void LeaveLocalSpace();
00052 
00053 protected:
00054     // represents the view AI_Sphere
00055     // changes if we enter a sector with different local coordinate system
00056     AI_Array<AI_Sphere> m_viewspherestack;
00057     AI_Array<AI_SDB_SphereClipper> m_sphereclipperstack;
00058 
00060     AI_SDB_SphereClipper &GetSphereClipper() const;
00061 
00062 };
00063 
00064 inline
00065 AI_SDB_SphereClipper &AI_SDB_VisibleSphereVisitor::GetSphereClipper() const
00066 {
00067     ai_assert(m_sphereclipperstack.Size() > 0);
00068     return m_sphereclipperstack.Back();
00069 }
00070 
00071 #endif