Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreBspSceneManager.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __BspSceneManager_H__
00026 #define __BspSceneManager_H__
00027 
00028 
00029 #include "OgreBspPrerequisites.h"
00030 #include "OgreSceneManager.h"
00031 #include "OgreStaticFaceGroup.h"
00032 #include "OgreRenderOperation.h"
00033 #include <set>
00034 
00035 
00036 namespace Ogre {
00037 
00059     class BspSceneManager : public SceneManager
00060     {
00061     protected:
00062 
00063         // Pointer to resource manager just for singleton management
00064         BspResourceManager* mBspResMgr;
00065 
00066         // World geometry
00067         BspLevel* mLevel;
00068 
00069         // State variables for rendering WIP
00070         // Set of face groups (by index) already included
00071         typedef std::set<int> FaceGroupSet;
00072         FaceGroupSet mFaceGroupSet;
00073         // Material -> face group hashmap
00074         typedef std::map<Material*, std::vector<StaticFaceGroup*>, materialLess > MaterialFaceGroupMap;
00075         MaterialFaceGroupMap mMatFaceGroupMap;
00077         RenderOperation mPendingGeometry;
00078 
00079         // Debugging features
00080         bool mShowNodeAABs;
00081         RenderOperation mAABGeometry;
00082 
00089         BspNode* walkTree(Camera* camera);
00091         void processVisibleLeaf(BspNode* leaf, Camera* cam);
00092 
00094         void clearGeometryCaches(void);
00096         void cacheGeometry(const StaticFaceGroup* faceGroup);
00097 
00099         void freeMemory(void);
00100 
00102         void addBoundingBox(AxisAlignedBox& aab, bool visible);
00103 
00105         void renderStaticGeometry(void);
00106 
00107 
00108     public:
00109         BspSceneManager();
00110         ~BspSceneManager();
00111 
00113         void setWorldGeometry(const String& filename);
00114 
00118         void showNodeBoxes(bool show);
00119 
00121         ViewPoint getSuggestedViewpoint(bool random = false);
00122 
00124         void _findVisibleObjects(Camera* cam);
00125 
00127         void _renderVisibleObjects(void);
00128     };
00129 
00130 }
00131 
00132 #endif

Copyright © 2002 by The OGRE Team