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

OgreBspLevel.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 _BspLevel_H__
00026 #define _BspLevel_H__
00027 
00028 #include "OgreBspPrerequisites.h"
00029 #include "OgreResource.h"
00030 #include "OgreStaticFaceGroup.h"
00031 #include "OgreSceneManager.h"
00032 
00033 
00034 namespace Ogre {
00035 
00049     class BspLevel : public Resource
00050     {
00051         friend class BspSceneManager;
00052     public:
00054         BspLevel(String name);
00055         ~BspLevel();
00056 
00058         virtual void load(void);
00060         virtual void unload(void);
00061 
00063         bool isLeafVisible(const BspNode* from, const BspNode* to) const;
00064 
00066         const BspNode* getRootNode(void);
00067 
00071         BspNode* findLeaf(const Vector3& point) const;
00072 
00073 
00074     protected:
00081         BspNode* mRootNode;
00082         int mNumNodes;
00083         int mNumLeaves;
00084         int mLeafStart; // the index at which leaf nodes begin
00085 
00093         struct BspVertex
00094         {
00095             Real position[3];
00096             Real texcoords[2];
00097             Real lightmap[2];
00098             Real normal[3];
00099             int colour;
00100         };
00102         BspVertex* mVertices;
00103         int mNumVertices;
00104 
00108         int* mLeafFaceGroups;
00109         int mNumLeafFaceGroups;
00110 
00112         StaticFaceGroup* mFaceGroups;
00113         int mNumFaceGroups;
00114 
00116         int* mElements;
00117         int mNumElements;
00118 
00119 
00121         std::vector<ViewPoint> mPlayerStarts;
00122 
00124         void loadQuake3Level(const Quake3Level& q3lvl);
00140         struct VisData
00141         {
00142             unsigned char *tableData;
00143             int numClusters;            // Number of clusters, therefore number of rows
00144             int rowLength;                // Length in bytes of each row (num clusters / 8 rounded up)
00145         };
00146 
00147         VisData mVisData;
00148 
00149 
00151         void loadEntities(const Quake3Level& q3lvl);
00152 
00153 
00154     };
00155 
00156 }
00157 
00158 #endif

Copyright © 2002 by The OGRE Team