Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_SCENE_SECTOR_H__
00009 #define __SP_SCENE_SECTOR_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013
00014 #ifdef SP_COMPILE_WITH_SCENEGRAPH_PORTAL_BASED
00015
00016
00017 #include "Base/spViewFrustum.hpp"
00018 #include "Base/spConvexPolyhedron.hpp"
00019 #include "SceneGraph/spBoundingVolume.hpp"
00020
00021 #include <map>
00022
00023
00024 namespace sp
00025 {
00026 namespace scene
00027 {
00028
00029
00030 class Portal;
00031 class RenderNode;
00032 class Camera;
00033 class SceneGraphPortalBased;
00034
00040 class SP_EXPORT Sector
00041 {
00042
00043 public:
00044
00045 Sector();
00046 ~Sector();
00047
00048
00049
00050 bool addPortal(Portal* PortalObj);
00051 bool removePortal(Portal* PortalObj);
00052 void clearPortals();
00053
00054 void addRenderNode(RenderNode* NodeObj);
00055 void removeRenderNode(RenderNode* NodeObj);
00056 void clearRenderNodes();
00057
00059 f32 getPointDistance(const dim::vector3df &Point) const;
00060
00062 bool isPointInside(const dim::vector3df &Point) const;
00063
00064 bool isBoundingVolumeInsideInv(const BoundingVolume &BoundVolume, const dim::matrix4f &InvMatrix) const;
00065
00072 bool isPortalNearby(const Portal* PortalObj, f32 Tolerance = 0.1f) const;
00073
00074 void setTransformation(const dim::matrix4f &Transform);
00075 dim::matrix4f getTransformation() const;
00076
00077 private:
00078
00079 friend class SceneGraphPortalBased;
00080
00081
00082
00083 void render(
00084 Sector* Predecessor, const dim::vector3df &GlobalViewOrigin,
00085 ViewFrustum &Frustum, const dim::matrix4f &BaseMatrix
00086 );
00087
00088
00089
00090 dim::matrix4f InvTransform_;
00091 dim::obbox3df BoundBox_;
00092 ConvexPolyhedron<f32, 6> ConvexHull_;
00093
00094 std::vector<Portal*> Portals_;
00095 std::vector<RenderNode*> RenderNodes_;
00096
00097 };
00098
00099
00100 }
00101
00102 }
00103
00104
00105 #endif
00106
00107 #endif
00108
00109
00110
00111