NL3D::ULandscape Class Reference

#include <u_landscape.h>

Inheritance diagram for NL3D::ULandscape:

NL3D::CLandscapeUser

Detailed Description

Game Interface for manipulate Landscape.
Author:
Lionel Berenguier

Nevrax France

Date:
2001

Definition at line 70 of file u_landscape.h.

Public Member Functions

ShadowMapping
virtual bool canReceiveShadowMap () const=0
 true if the instance receive shadow. By default false

virtual void enableReceiveShadowMap (bool state)=0
Lighting
virtual void enableAdditive (bool enable)=0
virtual CRGBA getPointLightDiffuseMaterial () const=0
virtual bool isAdditiveEnabled () const=0
virtual void setPointLightDiffuseMaterial (CRGBA diffuse)=0
virtual void setUpdateLightingFrequency (float freq)=0
virtual void setupStaticLight (const CRGBA &diffuse, const CRGBA &ambiant, float multiply)=0
virtual void updateLightingAll ()=0
virtual void enableVegetable (bool enable)=0
virtual void loadVegetableTexture (const std::string &textureFileName)=0
virtual void setupVegetableLighting (const CRGBA &ambient, const CRGBA &diffuse, const CVector &directionalLight)=0
virtual void setVegetableUpdateLightingFrequency (float freq)=0
virtual void setVegetableWind (const CVector &windDir, float windFreq, float windPower, float windBendMin)=0
Load
All those load methods use CPath to search files.

virtual void flushTiles (NLMISC::IProgressCallback &progress)=0
 Flush the tiles.

virtual void getAllZoneLoaded (std::vector< std::string > &zoneLoaded) const=0
virtual void invalidateAllTiles ()=0
 Flush the tiles.

virtual void loadAllZonesAround (const CVector &pos, float radius, std::vector< std::string > &zonesAdded)=0
virtual void loadAllZonesAround (const CVector &pos, float radius)=0
 Load all Zones around a position. This is a blocking call.

virtual void loadBankFiles (const std::string &tileBankFile, const std::string &farBankFile)=0
 Load the tile banks: the ".bank" and the ".farbank".

virtual void postfixTileFilename (const char *postfix)=0
 Postfix tile filename.

virtual void postfixTileVegetableDesc (const char *postfix)=0
 Postfix vegetable filename.

virtual void refreshAllZonesAround (const CVector &pos, float radius, std::vector< std::string > &zonesAdded, std::vector< std::string > &zonesRemoved, NLMISC::IProgressCallback &progress)=0
 Delete old zones, or load new zones, around a position, until it is finished. This is a blocking call.

virtual void refreshZonesAround (const CVector &pos, float radius, std::string &zoneAdded, std::string &zoneRemoved)=0
virtual void refreshZonesAround (const CVector &pos, float radius)=0
 Delete old zones, or load new zones, around a position. new Zones are loaded async.

virtual void removeAllZones ()=0
 Flush the tiles.

virtual void setZonePath (const std::string &zonePath)=0
 Set the zonePath from where zones are loaded.

Dynamic Lighting management
virtual CRGBA getDLMGlobalVegetableColor () const=0
virtual void setDLMGlobalVegetableColor (CRGBA gvc)=0
HeightField DeltaZ.
virtual CVector getHeightFieldDeltaZ (float x, float y) const=0
 return the HeightField DeltaZ for the 2D position. (0,0,dZ) is returned.

virtual void setHeightField (const CHeightMap &hf)=0
Misc
virtual bool getRefineCenterAuto () const=0
virtual const CVectorgetRefineCenterUser () const=0
virtual std::string getZoneName (const CVector &pos)=0
 Return the name of the zone around a particular position (in NL3D basis!).

virtual void hide ()=0
 hide the landscape. It is nor refined, nor rendered (=> take 0 CPU time).

virtual void setRefineCenterAuto (bool mode)=0
virtual void setRefineCenterUser (const CVector &refineCenter)=0
 setRefineCenterAuto

virtual void show ()=0
 show the landscape. visible by default.

Parameters
virtual float getThreshold () const=0
 Get threshold.

virtual uint getTileMaxSubdivision ()=0
 Get Maximum Tile subdivision.

virtual float getTileNear () const=0
 Get tile near distance.

virtual void setThreshold (float thre)=0
 Set threshold for subdivsion quality. The lower is threshold, the more the landscape is subdivided. Default: 0.001.

virtual void setTileColor (bool mono, float factor)=0
 Set all zones monochromatic or colored.

virtual void setTileMaxSubdivision (uint tileDiv)=0
 Set Maximum Tile subdivision. Valid values must be in [0..4] (assert). Default is 0 (for now :) ).

virtual void setTileNear (float tileNear)=0
 Set tile near distance. Default 50.f. maximized to length of Far alpha transition).

Tile added/removed callback
virtual ULandscapeTileCallbackgetTileCallback () const=0
virtual void setTileCallback (ULandscapeTileCallback *cb)=0

Protected Member Functions

Object
protected because created/deleted by UScene.

 ULandscape ()
virtual ~ULandscape ()


Constructor & Destructor Documentation

NL3D::ULandscape::ULandscape  )  [inline, protected]
 

Definition at line 77 of file u_landscape.h.

00077 {}

virtual NL3D::ULandscape::~ULandscape  )  [inline, protected, virtual]
 

Definition at line 78 of file u_landscape.h.

00078 {}


Member Function Documentation

virtual bool NL3D::ULandscape::canReceiveShadowMap  )  const [pure virtual]
 

true if the instance receive shadow. By default false

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::enableAdditive bool  enable  )  [pure virtual]
 

Set additive Lighting. Disabled by default.

Parameters:
enable is true to activbe additive, false to disactive it.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::enableReceiveShadowMap bool  state  )  [pure virtual]
 

By default, map shadow receiving is disabled. This enabled shadow for this model. Fails if the model don't support dynamic Map Shadow Receiving (eg Particle system)

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::enableVegetable bool  enable  )  [pure virtual]
 

enable the vegetable management in landscape. Valid only if Hardware support VertexShader.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::flushTiles NLMISC::IProgressCallback progress  )  [pure virtual]
 

Flush the tiles.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::getAllZoneLoaded std::vector< std::string > &  zoneLoaded  )  const [pure virtual]
 

Get list of zones currently loaded in landscape. array of name of the zones added, without extension (eg: "150_EM").

Implemented in NL3D::CLandscapeUser.

virtual CRGBA NL3D::ULandscape::getDLMGlobalVegetableColor  )  const [pure virtual]
 

see setDLMGlobalVegetableColor()

Implemented in NL3D::CLandscapeUser.

virtual CVector NL3D::ULandscape::getHeightFieldDeltaZ float  x,
float  y
const [pure virtual]
 

return the HeightField DeltaZ for the 2D position. (0,0,dZ) is returned.

Implemented in NL3D::CLandscapeUser.

virtual CRGBA NL3D::ULandscape::getPointLightDiffuseMaterial  )  const [pure virtual]
 

See also:
setPointLightDiffuseMaterial

Implemented in NL3D::CLandscapeUser.

virtual bool NL3D::ULandscape::getRefineCenterAuto  )  const [pure virtual]
 

Implemented in NL3D::CLandscapeUser.

virtual const CVector& NL3D::ULandscape::getRefineCenterUser  )  const [pure virtual]
 

Implemented in NL3D::CLandscapeUser.

virtual float NL3D::ULandscape::getThreshold  )  const [pure virtual]
 

Get threshold.

Implemented in NL3D::CLandscapeUser.

virtual ULandscapeTileCallback* NL3D::ULandscape::getTileCallback  )  const [pure virtual]
 

Implemented in NL3D::CLandscapeUser.

virtual uint NL3D::ULandscape::getTileMaxSubdivision  )  [pure virtual]
 

Get Maximum Tile subdivision.

Implemented in NL3D::CLandscapeUser.

virtual float NL3D::ULandscape::getTileNear  )  const [pure virtual]
 

Get tile near distance.

Implemented in NL3D::CLandscapeUser.

virtual std::string NL3D::ULandscape::getZoneName const CVector pos  )  [pure virtual]
 

Return the name of the zone around a particular position (in NL3D basis!).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::hide  )  [pure virtual]
 

hide the landscape. It is nor refined, nor rendered (=> take 0 CPU time).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::invalidateAllTiles  )  [pure virtual]
 

Flush the tiles.

Implemented in NL3D::CLandscapeUser.

virtual bool NL3D::ULandscape::isAdditiveEnabled  )  const [pure virtual]
 

Get additive Lighting

Returns:
true to if additive is actived, else false.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::loadAllZonesAround const CVector pos,
float  radius,
std::vector< std::string > &  zonesAdded
[pure virtual]
 

Load all Zones around a position. This is a blocking call. array of name of the zones added, without extension (eg: "150_EM").

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::loadAllZonesAround const CVector pos,
float  radius
[pure virtual]
 

Load all Zones around a position. This is a blocking call.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::loadBankFiles const std::string &  tileBankFile,
const std::string &  farBankFile
[pure virtual]
 

Load the tile banks: the ".bank" and the ".farbank".

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::loadVegetableTexture const std::string &  textureFileName  )  [pure virtual]
 

load a texture for the vegetable, lookup in CPath

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::postfixTileFilename const char *  postfix  )  [pure virtual]
 

Postfix tile filename.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::postfixTileVegetableDesc const char *  postfix  )  [pure virtual]
 

Postfix vegetable filename.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::refreshAllZonesAround const CVector pos,
float  radius,
std::vector< std::string > &  zonesAdded,
std::vector< std::string > &  zonesRemoved,
NLMISC::IProgressCallback progress
[pure virtual]
 

Delete old zones, or load new zones, around a position, until it is finished. This is a blocking call.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::refreshZonesAround const CVector pos,
float  radius,
std::string &  zoneAdded,
std::string &  zoneRemoved
[pure virtual]
 

Delete old zones, or load new zones, around a position. new Zones are loaded async. This method add or remove only one zone at a time. name of the zone removed, without extension (eg: "150_EM"). "" if none. name of the zone added, without extension (eg: "150_EM"). "" if none.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::refreshZonesAround const CVector pos,
float  radius
[pure virtual]
 

Delete old zones, or load new zones, around a position. new Zones are loaded async.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::removeAllZones  )  [pure virtual]
 

Flush the tiles.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setDLMGlobalVegetableColor CRGBA  gvc  )  [pure virtual]
 

For Vegetable Dynamic ligthing only: this is an approximate color of all vegetables. Default is (180, 180, 180).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setHeightField const CHeightMap hf  )  [pure virtual]
 

set the HeightField data. NB: take lot of place in memory. only one is possible. You should setup this heightfield around the zones which will be loaded. It is applied only when a zone is loaded, so you should setup it 2km around the user, each time you move too far from a previous place (eg 160m from last setup).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setPointLightDiffuseMaterial CRGBA  diffuse  )  [pure virtual]
 

Setup the equivalent material diffuse component used for both Static and Dynamic PointLights. Default is White.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setRefineCenterAuto bool  mode  )  [pure virtual]
 

if true, the refine Center is auto computed each frame from Camera Position. Else must be given by setRefineCenterUser() Default to true.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setRefineCenterUser const CVector refineCenter  )  [pure virtual]
 

setRefineCenterAuto

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setThreshold float  thre  )  [pure virtual]
 

Set threshold for subdivsion quality. The lower is threshold, the more the landscape is subdivided. Default: 0.001.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setTileCallback ULandscapeTileCallback cb  )  [pure virtual]
 

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setTileColor bool  mono,
float  factor
[pure virtual]
 

Set all zones monochromatic or colored.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setTileMaxSubdivision uint  tileDiv  )  [pure virtual]
 

Set Maximum Tile subdivision. Valid values must be in [0..4] (assert). Default is 0 (for now :) ).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setTileNear float  tileNear  )  [pure virtual]
 

Set tile near distance. Default 50.f. maximized to length of Far alpha transition).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setUpdateLightingFrequency float  freq  )  [pure virtual]
 

Set the frequency of lighting update. If freq==1, ALL patchs are updated each second. e.g: if 1/20, then every 20 seconds, all patchs are updated. If you set 0, no update will be done at all (this is the default setup!!).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setupStaticLight const CRGBA diffuse,
const CRGBA ambiant,
float  multiply
[pure virtual]
 

Setup the light color use for static illumination. NB: This setup will be visible only for new texture far/near computed (when player move or see dynamic lighting).

Parameters:
diffuse is the color of the diffuse componante of the lighting.
ambiant is the color of the ambiante componante of the lighting.
multiply is the multiply factor. Final color is (diffuse*multiply*shading+ambiant*(1.0-shading))

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setupVegetableLighting const CRGBA ambient,
const CRGBA diffuse,
const CVector directionalLight
[pure virtual]
 

setup lighting ambient and diffuse for vegetable.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setVegetableUpdateLightingFrequency float  freq  )  [pure virtual]
 

set the frequency of Vegetable lighting update. If freq==1, ALL lighted igs are updated each second. e.g: if 1/20, then every 20 seconds, all Igs are updated. If you set 0, no update will be done at all (this is the default setup!!).

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setVegetableWind const CVector windDir,
float  windFreq,
float  windPower,
float  windBendMin
[pure virtual]
 

set the vegetable Wind for animation. All thoses variables may be modified each frame without penalty.

Parameters:
windDir is the direction of the wind. NB: only XY direction is kept.
windFreq is the frequency for the animation (speed)
windPower is the power of the wind, and is a factor (0..1) of Bend
windBendMin is a value in (0..1) which indicate how much the vegetables are bended at minimum (for very powerfull wind)

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::setZonePath const std::string &  zonePath  )  [pure virtual]
 

Set the zonePath from where zones are loaded.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::show  )  [pure virtual]
 

show the landscape. visible by default.

Implemented in NL3D::CLandscapeUser.

virtual void NL3D::ULandscape::updateLightingAll  )  [pure virtual]
 

update the lighting of ALL patch (slow method). NB: work even if UpdateLightingFrequency==0 Additionaly, vegetables are also ALL updated. WARNING!! If Scene Lighting is enabled (usual case), vegetable lighting setup take last Sun setup at UScene::render(). Hence, you should force the new lighting setup with ULandscape::setupVegetableLighting(), before calling updateLightingAll().

Implemented in NL3D::CLandscapeUser.


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 08:46:08 2004 for NeL by doxygen 1.3.6