00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef NL_LANDSCAPE_USER_H
00027 #define NL_LANDSCAPE_USER_H
00028
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/3d/u_landscape.h"
00031 #include "3d/landscape_model.h"
00032 #include "3d/zone_manager.h"
00033 #include "3d/scene.h"
00034
00035 #define NL3D_MEM_LANDSCAPE NL_ALLOC_CONTEXT( 3dLand )
00036
00037 namespace NL3D
00038 {
00039
00040
00041
00048 class CLandscapeUser : public ULandscape
00049 {
00050 private:
00051
00052 CScene *_Scene;
00053
00054 CLandscapeModel *_Landscape;
00055
00056 CZoneManager _ZoneManager;
00057
00058 public:
00059
00061
00062 CLandscapeUser(CScene *scene)
00063 {
00064 NL3D_MEM_LANDSCAPE
00065 nlassert(scene);
00066 _Scene= scene;
00067 _Landscape= (CLandscapeModel*)_Scene->createModel(LandscapeModelId);
00068 }
00069 virtual ~CLandscapeUser()
00070 {
00071 NL3D_MEM_LANDSCAPE
00072 _Scene->deleteModel(_Landscape);
00073 _Landscape= NULL;
00074 }
00075
00076
00077
00080
00082
00084
00086
00087 virtual void loadAllZonesAround(const CVector &pos, float radius, std::vector<std::string> &zonesAdded);
00089 virtual void refreshZonesAround(const CVector &pos, float radius);
00090 virtual void refreshZonesAround(const CVector &pos, float radius, std::string &zoneAdded, std::string &zoneRemoved);
00092 virtual void refreshAllZonesAround(const CVector &pos, float radius, std::vector<std::string> &zonesAdded, std::vector<std::string> &zonesRemoved);
00093 virtual void getAllZoneLoaded(std::vector<std::string> &zoneLoaded) const;
00094
00095
00096
00098
00107 virtual void setupStaticLight (const CRGBA &diffuse, const CRGBA &ambiant, float multiply);
00108
00109 virtual void setPointLightDiffuseMaterial(CRGBA diffuse);
00110 virtual CRGBA getPointLightDiffuseMaterial () const;
00111
00112 virtual void setPointLightFactor(const std::string &lightGroupName, NLMISC::CRGBA nFactor);
00113
00114 virtual void setUpdateLightingFrequency(float freq);
00115
00116 virtual void updateLightingAll();
00117
00118
00119
00120
00122
00124
00126
00128
00130
00132
00134
00135
00136
00137
00139
00141
00142
00143 virtual void show()
00144 {
00145 NL3D_MEM_LANDSCAPE
00146 _Landscape->show();
00147 }
00148 virtual void hide()
00149 {
00150 NL3D_MEM_LANDSCAPE
00151 _Landscape->hide();
00152 }
00153
00154 virtual void enableAdditive (bool enable);
00155 virtual bool isAdditiveEnabled () const;
00156
00157
00158
00159
00161
00162 virtual CVector getHeightFieldDeltaZ(float x, float y) const;
00163 virtual void setHeightField(const CHeightMap &hf);
00164
00165
00167
00168 virtual void enableVegetable(bool enable);
00169 virtual void loadVegetableTexture(const std::string &textureFileName);
00170 virtual void setupVegetableLighting(const CRGBA &ambient, const CRGBA &diffuse, const CVector &directionalLight);
00171 virtual void setVegetableWind(const CVector &windDir, float windFreq, float windPower, float windBendMin);
00172 virtual void setVegetableUpdateLightingFrequency(float freq);
00173
00174
00175
00177
00178 virtual void setDLMGlobalVegetableColor(CRGBA gvc);
00179 virtual CRGBA getDLMGlobalVegetableColor() const;
00180
00181
00182 public:
00184
00185 CLandscapeModel *getLandscape()
00186 {
00187 NL3D_MEM_LANDSCAPE
00188 return _Landscape;
00189 }
00190
00191
00192 };
00193
00194
00195 }
00196
00197
00198 #endif // NL_LANDSCAPE_USER_H
00199
00200