# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

quad_grid_clip_cluster.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2001 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_QUAD_GRID_CLIP_CLUSTER_H
00027 #define NL_QUAD_GRID_CLIP_CLUSTER_H
00028 
00029 #include "nel/misc/types_nl.h"
00030 #include "3d/mot.h"
00031 #include "3d/clip_trav.h"
00032 #include "nel/misc/aabbox.h"
00033 
00034 
00035 namespace NL3D 
00036 {
00037 
00038 
00039 // ***************************************************************************
00040 // ClassIds.
00041 const NLMISC::CClassId          QuadGridClipClusterId=NLMISC::CClassId(0x31d517aa, 0x2c4357a0);
00042 
00043 
00044 // ***************************************************************************
00052 class CQuadGridClipCluster : public IModel
00053 {
00054 public:
00056         static  void    registerBasic();
00057 
00058         void            extendCluster(const NLMISC::CAABBox &worldBBox);
00059 
00060         void            setDistMax(float d) {_DistMax= d;}
00061 
00062         // never need to update, so unlink me from ValidateList.
00063         virtual void update();
00064 
00065 protected:
00067         CQuadGridClipCluster() {_Empty= true; _DistMax= -1;}
00069         virtual ~CQuadGridClipCluster() {}
00070 
00071 private:
00072         static IModel   *creator() {return new CQuadGridClipCluster;}
00073         friend class    CQuadGridClipClusterClipObs;
00074 
00075         NLMISC::CAABBox         _BBox;
00076         bool                            _Empty;
00077         float                           _DistMax;
00078         float                           _Radius;
00079 };
00080 
00081 
00082 // ***************************************************************************
00093 class   CQuadGridClipClusterClipObs : public IBaseClipObs
00094 {
00095         bool            _LastClipWasDistMaxClip;
00096         bool            _LastClipWasFrustumClip;
00097 
00098 public:
00099         CQuadGridClipClusterClipObs();
00100 
00101 
00102         // not used by traverse().
00103         virtual bool    clip(IBaseClipObs *caller) {return true;}
00104 
00105 
00107 
00108 
00109         virtual void    traverse(IObs *caller);
00111 
00112         static IObs     *creator() {return new CQuadGridClipClusterClipObs;}
00113 
00114 };
00115 
00116 
00117 } // NL3D
00118 
00119 
00120 #endif // NL_QUAD_GRID_CLIP_CLUSTER_H
00121 
00122 /* End of quad_grid_clip_cluster.h */