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

OgreBspNode.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 _BspNode_H__
00026 #define _BspNode_H__
00027 
00028 #include "OgreBspPrerequisites.h"
00029 #include "OgrePlane.h"
00030 #include "OgreAxisAlignedBox.h"
00031 
00032 namespace Ogre {
00033 
00047     class BspNode
00048     {
00049         friend class BspLevel;
00050 
00051     public:
00053         BspNode(BspLevel* owner, bool isLeaf);
00054 
00055         BspNode();
00056         ~BspNode();
00057 
00067         bool isLeaf(void) const;
00068 
00073         BspNode* getFront(void) const;
00074 
00079         BspNode* getBack(void) const;
00080 
00085         Plane::Side getSide (const Vector3& point) const;
00086 
00092         BspNode* getNextNode(const Vector3& point) const;
00093 
00094 
00099         Plane getSplitPlane(void);
00100 
00105         AxisAlignedBox& getBoundingBox(void);
00106 
00110         int getNumFaceGroups(void);
00120         int getFaceGroupStart(void);
00121 
00128         bool isLeafVisible(const BspNode* leaf);
00129 
00130         friend std::ostream& operator<< (std::ostream& o, BspNode& n);
00131 
00132 
00133 
00134     protected:
00135         BspLevel* mOwner; // Back-reference to containing level
00136         bool mIsLeaf;
00137 
00138         // Node-only members
00143         Plane mSplitPlane;
00145         BspNode* mFront;
00147         BspNode* mBack;
00148 
00149         // Leaf-only members
00161         int mVisCluster;
00162 
00164         AxisAlignedBox mBounds;
00166         int mNumFaceGroups;
00174         int mFaceGroupStart;
00175 
00176     };
00177 
00178 
00179 }
00180 
00181 #endif

Copyright © 2002 by The OGRE Team