# 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  

landscape_model.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 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_LANDSCAPE_MODEL_H
00027 #define NL_LANDSCAPE_MODEL_H
00028 
00029 #include "nel/misc/types_nl.h"
00030 #include "3d/transform.h"
00031 #include "3d/render_trav.h"
00032 #include "3d/landscape.h"
00033 
00034 
00035 namespace NL3D 
00036 {
00037 
00038 class   CLandscape;
00039 
00040 // ***************************************************************************
00041 const NLMISC::CClassId          LandscapeModelId=NLMISC::CClassId(0x5a573b55, 0x6b395829);
00042 
00043 
00044 // ***************************************************************************
00051 class   CLandscapeModel : public CTransform
00052 {
00053 public:
00055         static  void    registerBasic();
00056 
00057 public:
00058         CLandscape              Landscape;
00059 
00064         void                    setAdditive (float additive)
00065         {
00066                 _Additive=additive;
00067         }
00068 
00073         float                   getAdditive () const
00074         {
00075                 return _Additive;
00076         }
00077 
00082         void                    enableAdditive (bool enable)
00083         {
00084                 _ActiveAdditive=enable;
00085         }
00086 
00091         bool                    isAdditive () const
00092         {
00093                 return _ActiveAdditive;
00094         }
00095 
00096 
00100         virtual void    initModel();
00101 
00102 
00103 protected:
00104         CLandscapeModel();
00105         virtual ~CLandscapeModel() {}
00106 
00107 private:
00108         static IModel   *creator() {return new CLandscapeModel;}
00109 
00110         bool    _ActiveAdditive;
00111         float   _Additive;
00112 
00113         friend class CLandscapeClipObs;
00114         friend class CLandscapeRenderObs;
00115 
00116         // The current small pyramid, for faster clip.
00117         CPlane          CurrentPyramid[NL3D_TESSBLOCK_NUM_CLIP_PLANE];
00118 };
00119 
00120 
00121 // Clip obs.
00122 //*************
00124 class   CLandscapeClipObs : public CTransformClipObs
00125 {
00126 public:
00127 
00129         virtual void    init();
00130 
00132         virtual bool    clip(IBaseClipObs *caller);
00133 
00134         // The creator.
00135         static IObs     *creator() {return new CLandscapeClipObs;}
00136 };
00137 // Render obs.
00138 //*************
00140 class   CLandscapeRenderObs : public CTransformRenderObs
00141 {
00142 public:
00144         virtual void    traverse(IObs *caller);
00145 
00146         // The creator.
00147         static IObs     *creator() {return new CLandscapeRenderObs;}
00148 };
00149 
00150 
00151 
00152 
00153 } // NL3D
00154 
00155 
00156 #endif // NL_LANDSCAPE_MODEL_H
00157 
00158 /* End of landscape_model.h */