My Project
GlobalTerrain.h
1 #pragma once
2 #include <vector>
3 #include <stdint.h>
4 #include "IAttributeFields.h"
5 #include "IObjectScriptingInterface.h"
6 
7 namespace ParaEngine
8 {
9  struct TextureEntity;
10  class CShapeBox;
11  class TTerrain;
12  class CShapeAABB;
13  class CShapeFrustum;
14 }
15 namespace ParaTerrain
16 {
17  using namespace ParaEngine;
18  class Terrain;
19  class TerrainLattice;
20  class CDynamicTerrainLoader;
21  class Settings;
22 
37  {
38  public:
39  CGlobalTerrain(void);
40  virtual ~CGlobalTerrain(void);
41  public:
43  // implementation of IAttributeFields
44 
46  virtual int GetAttributeClassID(){return ATTRIBUTE_CLASSID_CGlobalTerrain;}
48  virtual const char* GetAttributeClassName(){static const char name[] = "CGlobalTerrain"; return name;}
50  virtual const char* GetAttributeClassDescription(){static const char desc[] = ""; return desc;}
52  virtual int InstallFields(CAttributeClass* pClass, bool bOverride);
53 
55  virtual IAttributeFields* GetChildAttributeObject(const std::string& sName);
57  virtual int GetChildAttributeObjectCount(int nColumnIndex = 0);
59  virtual int GetChildAttributeColumnCount();
60  virtual IAttributeFields* GetChildAttributeObject(int nRowIndex, int nColumnIndex = 0);
61 
62  ATTRIBUTE_METHOD1(CGlobalTerrain, IsModified_s, bool*) {*p1 = cls->IsModified(); return S_OK;}
63 
64  ATTRIBUTE_METHOD1(CGlobalTerrain, TerrainRenderingEnabled_s, bool*) {*p1 = cls->TerrainRenderingEnabled(); return S_OK;}
65  ATTRIBUTE_METHOD1(CGlobalTerrain, EnableTerrainRendering_s, bool) {cls->EnableTerrainRendering(p1); return S_OK;}
66 
67  ATTRIBUTE_METHOD1(CGlobalTerrain, IsTerrainEngineEnabled_s, bool*) { *p1 = cls->IsTerrainEngineEnabled(); return S_OK; }
68  ATTRIBUTE_METHOD1(CGlobalTerrain, EnableTerrainEngine_s, bool) { cls->EnableTerrainEngine(p1); return S_OK; }
69 
70  ATTRIBUTE_METHOD1(CGlobalTerrain, IsVerbose_s, bool*) {*p1 = cls->IsVerbose(); return S_OK;}
71  ATTRIBUTE_METHOD1(CGlobalTerrain, SetVerbose_s, bool) {cls->SetVerbose(p1); return S_OK;}
72 
73  ATTRIBUTE_METHOD1(CGlobalTerrain, IsEditor_s, bool*) {*p1 = cls->IsEditor(); return S_OK;}
74  ATTRIBUTE_METHOD1(CGlobalTerrain, SetEditor_s, bool) {cls->SetEditor(p1); return S_OK;}
75 
76  ATTRIBUTE_METHOD1(CGlobalTerrain, GetTessellateMethod_s, int*) {*p1 = cls->GetTessellateMethod(); return S_OK;}
77  ATTRIBUTE_METHOD1(CGlobalTerrain, SetTessellateMethod_s, int) {cls->SetTessellateMethod(p1); return S_OK;}
78 
79  ATTRIBUTE_METHOD1(CGlobalTerrain, UseNormals_s, bool*) {*p1 = cls->UseNormals(); return S_OK;}
80  ATTRIBUTE_METHOD1(CGlobalTerrain, SetUseNormals_s, bool) {cls->SetUseNormals(p1); return S_OK;}
81 
82  ATTRIBUTE_METHOD1(CGlobalTerrain, GetTextureMaskWidth_s, int*) {*p1 = cls->GetTextureMaskWidth(); return S_OK;}
83  ATTRIBUTE_METHOD1(CGlobalTerrain, SetTextureMaskWidth_s, int) {cls->SetTextureMaskWidth(p1); return S_OK;}
84 
85  ATTRIBUTE_METHOD1(CGlobalTerrain, GetDefaultHeight_s, float*) { *p1 = cls->GetDefaultHeight(); return S_OK; }
86  ATTRIBUTE_METHOD1(CGlobalTerrain, SetDefaultHeight_s, float) { cls->SetDefaultHeight(p1); return S_OK; }
87 
88  ATTRIBUTE_METHOD1(CGlobalTerrain, IsGeoMipmapTerrain_s, bool*) {*p1 =cls->IsGeoMipmapTerrain(); return S_OK;}
89  ATTRIBUTE_METHOD1(CGlobalTerrain, SetGeoMipmapTerrain_s, bool) {cls->SetGeoMipmapTerrain(p1); return S_OK;}
90 
91  ATTRIBUTE_METHOD1(CGlobalTerrain, IsEditorMode_s, bool*) {*p1 =cls->IsEditorMode(); return S_OK;}
92  ATTRIBUTE_METHOD1(CGlobalTerrain, SetEditorMode_s, bool) {cls->SetEditorMode(p1); return S_OK;}
93 
94  ATTRIBUTE_METHOD1(CGlobalTerrain, IsSlopeCollision_s, bool*) {*p1 =cls->IsSlopeCollision(); return S_OK;}
95  ATTRIBUTE_METHOD1(CGlobalTerrain, SetSlopeCollision_s, bool) {cls->SetSlopeCollision(p1); return S_OK;}
96 
97  ATTRIBUTE_METHOD1(CGlobalTerrain, SetBlockSelectionTexture_s, const char*) {cls->SetBlockSelectionTexture(p1); return S_OK;}
98  ATTRIBUTE_METHOD1(CGlobalTerrain, SetBlockDamageTexture_s, const char*) {cls->SetBlockDamageTexture(p1); return S_OK;}
99  public:
106  IAttributeFields* GetAttributeObjectAt(float x, float y);
107 
109  bool IsVerbose();
110  void SetVerbose(bool bEnable);
111 
114  void SetEditor(bool isEditor);
116  bool IsEditor();
117 
120  void SetTessellateMethod(int method);
122  int GetTessellateMethod();
123 
127  void SetUseNormals(bool bUseNormals);
129  bool UseNormals();
130 
131 
133  void SetBlockDamageTexture(const char* textureName);
135  void SetBlockSelectionTexture(const char* textureName);
136 
137  public:
139  void Cleanup();
141  void InitDeviceObjects();
142  void RestoreDeviceObjects();
144  void DeleteDeviceObjects();
147 
150 
157 
167  void GetBoundingBoxes(vector<ParaEngine::CShapeAABB>& boxes, const Matrix4* modelView, const ParaEngine::CShapeFrustum& frustum, int nMaxBoxesNum=1024, int nSmallestBoxStride=4);
168 
173  void SetCameraPosition(float x, float y);
174 
179  void Update(bool bForceUpdate=false);
181  void Render();
183  //void RenderAuto();
184 
186  float GetElevation(float x, float y);
187 
192  DWORD GetRegionValue(const string& sLayerName, float x, float y);
193 
200  void SetVertexElevation(float x, float y,float fHeight);
207  float GetVertexElevation(float x, float y);
208 
210  float GetLowestVisibleHeight();
211 
227  float IntersectRay(float startX, float startY, float startZ, float dirX, float dirY, float dirZ, float &intersectX, float &intersectY, float &intersectZ, float fMaxDistance = 999999999.0f);
228 
235  void GetNormal(float x, float y, float &normalX, float &normalY, float &normalZ);
236 
251  void CreateSingleTerrain(const char* sHeightmapfile,
252  float fTerrainSize, float fElevscale, int bSwapvertical,
253  const char* sMainTextureFile, const char* sCommonTextureFile,
254  int nMaxBlockSize, float fDetailThreshold);
262  void CreateTerrain(const char * sConfigFileName);
263 
274  void Paint(ParaEngine::TextureEntity* detailTexture, float brushRadius, float brushIntensity, float maxIntensity, bool erase, float x, float y);
275 
290  void Flatten (float x,float y,float radius, int flatten_op, float elevation,float factor);
291 
302  void DigCircleFlat(float x, float y, float radius, float fFlatPercentage=0.7f, float factor=0.5f);
303 
304  /*
305  * This creates a Gaussian hill at the specified location with the specified parameters.
306  * it actually adds the hill to the original terrain surface.
307  * Here ElevNew(x,y) =
308  |(x,y)-(center_x,center_y)| < radius*smooth_factor, ElevOld(x,y)+hscale*exp(-[(x-center_x)^2+(y-center_y)^2]/(2*standard_deviation^2) ),
309  |(x,y)-(center_x,center_y)| > radius*smooth_factor, minimize hill effect.
310  * @param center_x: the center of the affected circle. value in the range [0,1]
311  * @param center_y: the center of the affected circle.value in the range [0,1]
312  * @param radius: the radius of the affected circle.value in the range [0,0.5]
313  * @param hscale: scale factor. One can think of it as the maximum height of the Gaussian Hill. this value can be negative
314  * @param standard_deviation: standard deviation of the unit height value. should be in the range (0,1).
315  * 0.1 is common value. larger than that will just make a flat hill with smoothing.
316  * @param smooth_factor: value is between [0,1]. 1 means fully transformed; 0 means nothing is changed
317  */
318  void GaussianHill (float x,float y,float radius,float hscale,float standard_deviation=0.1f,float smooth_factor=0.5f);
319 
326  void Spherical ( float x,float y,float radius, float offset);
327 
339  void RadialScale (float x, float y, float scale_factor, float min_dist,float max_dist, float smooth_factor=0.5f, int frequency=1);
340 
355  void Roughen_Smooth (float x, float y, float radius,bool roughen=false, bool big_grid=false,float factor=0.5f);
356 
363  void Ramp(float x1, float y1, float x2, float y2, float radius, float borderpercentage=0.5f, float factor=1.0f);
364 
374  void AddHeightField(float x, float y, const char* filename, int nSmoothPixels=7);
375 
395  void MergeHeightField(float x, float y, const char* filename, int mergeOperation=0, float weight1=1.0, float weight2=1.0, int nSmoothPixels=7);
396 
401  void UpdateHoles(float x, float y);
409  bool IsHole(float x, float y);
418  void SetHole(float x, float y, bool bIsHold);
419 
421  string GetOnloadScript(float x, float y);
422 
444  void SetContentModified(float x, float y, bool bIsModified = true, DWORD dwModifiedBits=16);
445 
447  void SetAllLoadedModified(bool bIsModified = true, DWORD dwModifiedBits=16);
448 
450  string GetTerrainElevFile(float x, float y);
455  void SaveTerrain(bool bHeightMap, bool bTextures);
456 
458  bool IsModified();
459 
461  void EnableLighting(bool bEnable);
462 
464  bool IsTerrainEngineEnabled() const;
465  void EnableTerrainEngine(bool val);
466 
472 
477  void EnableTerrainRendering(bool bEnable);
478 
488  bool GetHeightmapOf(float fCenterX, float fCenterY, float fSize, TTerrain* pOut);
489 
500  bool SetHeightmapOf(float fCenterX, float fCenterY, float fSize, TTerrain* pIn);
501 
509  void SnapPointToVertexGrid(float x, float y, float* vertex_x, float* vertex_y);
510 
512  float GetVertexSpacing() const;
513 
518  int GetTextureCount(float x, float y);
519 
528  void GetTexturesInCell(float x, float y, std::vector<int>& indices);
529 
536  bool RemoveTextureInCell(float x, float y, int nIndex);
537 
547  TextureEntity* GetTexture(float x, float y, int nIndex);
555  bool ReplaceTexture(float x, float y, int nIndex, TextureEntity* TextureAsset);
556 
558  Terrain * GetTerrainAtPoint(float x,float y);
559 
565  int GetMaxTileCacheSize();
566 
572  void SetMaxTileCacheSize(int nNum);
573 
578  void SetEnablePathEncoding(bool bEnable){ m_bEnablePathEncoding = bEnable;}
579 
584  bool GetEnablePathEncoding(){ return m_bEnablePathEncoding;}
585 
590  void SetTextureMaskWidth(int nWidth);
591  int GetTextureMaskWidth();
592 
593  void SwitheTerrainLodStyle(bool useGeoMipmap);
594 
596  float GetDefaultHeight() const;
597  void SetDefaultHeight(float val);
598 
599  private:
602  void ModelViewMatrixChanged();
603  private:
605  float m_fDefaultHeight;
606  Terrain* m_pTerrainSingle;
607  TerrainLattice* m_pTerrainLattice;
608  CDynamicTerrainLoader* m_pTerrainLoader;
609  enum Terrain_type{
610  SINGLE_TERRAIN,
611  LATTICED_TERRAIN
612  } m_nTerrainType;
613 
615  bool m_bRenderTerrain;
617  bool m_bEnableTerrainEngine;
618 
623  bool m_bEnablePathEncoding;
624 
625  //GeoMipmapCode
626  bool m_useGeoMipmap;
627  bool m_enableSlopeCollision;
628  bool m_isEditorMode;
629  bool m_isSlopeMeshVisible;
630  bool m_isWaypointRegionVisible;
631 
632  Vector3 m_matTerrainEye;
633  Vector3 m_vTerrainRenderOffset;
634 
635  public:
636  static const float g_fTerrainInvisibleHeight;
637 
638  const Vector3& GetMatTerrainEye() const;
639  const Vector3& GetTerrainRenderOffset() const;
640 
641  //this function must be called before CreateTerrain,we don't support change
642  //terrain rendering style at runtime -.- --clayman 2012.2.21
643 
644  void SetGeoMipmapTerrain(bool enable);
645 
646  bool IsGeoMipmapTerrain()
647  {
648  return m_useGeoMipmap;
649  }
650 
651  void SetEditorMode(bool enable);
652 
653  bool IsEditorMode()
654  {
655  return m_isEditorMode;
656  }
657 
658  void SetSlopeCollision(bool enable)
659  {
660  m_enableSlopeCollision = enable;
661  }
662 
663  bool IsSlopeCollision()
664  {
665  return m_enableSlopeCollision;
666  }
667 
668  void SetSlopeMeshVisible(bool);
669 
670  bool IsSlopeMeshVisible()
671  {
672  return m_isSlopeMeshVisible;
673  }
674 
675  void SetWaypointRegionVisible(bool enable);
676 
677  bool IsWaypointRegionVisible()
678  {
679  return m_isWaypointRegionVisible;
680  }
681 
682  void PaintTerrainData(float x,float y,float radius,unsigned int data,unsigned int dataMask,unsigned int bitOffset);
683 
684  uint32 GetTerrainData(float x,float y,uint32 dataMask,uint8 bitOffset);
685 
686  void SetVisibleDataMask(uint32 mask,uint8 bitOffset);
687 
688  bool IsWalkable(float x,float y, Vector3& oNormal) const;
689 
690  };
691 
692 }
Definition: DynamicTerrainLoader.h:10
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
void DigCircleFlat(float x, float y, float radius, float fFlatPercentage=0.7f, float factor=0.5f)
flatten a land centered at x,y, with a specified radius.
Definition: GlobalTerrain.cpp:794
void SetVertexElevation(float x, float y, float fHeight)
Set elevation at the nearest vertex to the specified point.
Definition: GlobalTerrain.cpp:558
bool SetHeightmapOf(float fCenterX, float fCenterY, float fSize, TTerrain *pIn)
set the height map of a given square region in the global terrain.
Definition: GlobalTerrain.cpp:1066
bool ReplaceTexture(float x, float y, int nIndex, TextureEntity *TextureAsset)
replace the texture at the given index.
Definition: GlobalTerrain.cpp:395
Definition: SceneObject.h:15
void SetContentModified(float x, float y, bool bIsModified=true, DWORD dwModifiedBits=16)
set the content of the terrain modified.
Definition: GlobalTerrain.cpp:981
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: GlobalTerrain.cpp:1215
temp height field terrain data used by terrain filters.
Definition: TTerrain.h:16
Terrain * GetTerrainAtPoint(float x, float y)
get the terrain at point no matter it is single or latticed.
Definition: GlobalTerrain.cpp:297
void SetTessellateMethod(int method)
This setting determines which algorithm Demeter uses to simplify terrain blocks.
Definition: GlobalTerrain.cpp:1134
DWORD GetRegionValue(const string &sLayerName, float x, float y)
get value of a given terrain region layer
Definition: GlobalTerrain.cpp:526
int GetMaxTileCacheSize()
set how many terrain tile(including height fields, etc) are cached in memory.
Definition: GlobalTerrain.cpp:1086
void SetBlockSelectionTexture(const char *textureName)
used to render selection texture.
Definition: GlobalTerrain.cpp:1311
void SetCameraPosition(float x, float y)
Set the camera position, so that terrain tiles around it are automatically loaded.
Definition: GlobalTerrain.cpp:152
virtual int GetAttributeClassID()
attribute class ID should be identical, unless one knows how overriding rules work.
Definition: GlobalTerrain.h:46
different physics engine has different winding order.
Definition: EventBinding.h:32
void SetTextureMaskWidth(int nWidth)
get the default texture mask file resolution.
Definition: GlobalTerrain.cpp:1169
void SetHole(float x, float y, bool bIsHold)
set a new terrain hole at the specified location.
Definition: GlobalTerrain.cpp:208
bool IsEditor()
brief Indicates whether or not SetEditor(true) has been called.
Definition: GlobalTerrain.cpp:1129
string GetTerrainElevFile(float x, float y)
get the height map file name for the terrain tile that contains the point (x,y)
Definition: GlobalTerrain.cpp:436
void Flatten(float x, float y, float radius, int flatten_op, float elevation, float factor)
Flatten the terrain both up and down to the specified elevation, using using the tightness parameter ...
Definition: GlobalTerrain.cpp:750
void InvalidateDeviceObjects()
must call this function when device is invalid.
Definition: GlobalTerrain.cpp:665
IAttributeFields * GetAttributeObjectAt(float x, float y)
get the attribute object associated with the terrain tile that contains the given point...
Definition: GlobalTerrain.cpp:1022
virtual int GetChildAttributeColumnCount()
we support multi-dimensional child object.
Definition: GlobalTerrain.cpp:1356
float IntersectRay(float startX, float startY, float startZ, float dirX, float dirY, float dirZ, float &intersectX, float &intersectY, float &intersectZ, float fMaxDistance=999999999.0f)
This method makes use of the terrain&#39;s quad tree to optimize the ray-tracing.
Definition: GlobalTerrain.cpp:588
this is the interface class for managing global terrain used in ParaEngine.
Definition: GlobalTerrain.h:36
bool UseNormals()
Indicates whether or not normals are on as set by calling SetUseNormals().
Definition: GlobalTerrain.cpp:1164
virtual const char * GetAttributeClassDescription()
a static string, describing the attribute class object
Definition: GlobalTerrain.h:50
float GetVertexElevation(float x, float y)
Returns the height of the vertex closest to the specified point.
Definition: GlobalTerrain.cpp:573
void Ramp(float x1, float y1, float x2, float y2, float radius, float borderpercentage=0.5f, float factor=1.0f)
create a ramp (inclined slope) from (x1,y1) to (x2,y2).
Definition: GlobalTerrain.cpp:884
float GetDefaultHeight() const
the default terrain height, normally it is 0
Definition: GlobalTerrain.cpp:1144
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
void EnableLighting(bool bEnable)
Enable both global and local lighting.
Definition: GlobalTerrain.cpp:1017
bool GetEnablePathEncoding()
get whether we will encode terrain related files.
Definition: GlobalTerrain.h:584
void GetTexturesInCell(float x, float y, std::vector< int > &indices)
get all texture indices in the cell specified by point(x,y) GetTextureCount() returns all textures us...
Definition: GlobalTerrain.cpp:311
int GetTessellateMethod()
Gets the current tessellation heuristic method.
Definition: GlobalTerrain.cpp:1139
void GetBoundingBoxes(vector< ParaEngine::CShapeAABB > &boxes, const Matrix4 *modelView, const ParaEngine::CShapeFrustum &frustum, int nMaxBoxesNum=1024, int nSmallestBoxStride=4)
Get the bounding boxes for a given view frustum.
Definition: GlobalTerrain.cpp:243
bool IsHole(float x, float y)
Whether the terrain contains a hole at the specified location.
Definition: GlobalTerrain.cpp:191
void SetEnablePathEncoding(bool bEnable)
set whether we will encode terrain related files.
Definition: GlobalTerrain.h:578
float GetElevation(float x, float y)
Automatically rebuild the terrain buffer and the render the terrain.
Definition: GlobalTerrain.cpp:541
void SetBlockDamageTexture(const char *textureName)
used to render damaged texture.
Definition: GlobalTerrain.cpp:1304
void SetMaxTileCacheSize(int nNum)
Get how many terrain tile(including height fields, etc) are cached in memory.
Definition: GlobalTerrain.cpp:1102
bool TerrainRenderingEnabled()
true if terrain is rendered.
Definition: GlobalTerrain.cpp:118
TextureEntity * GetTexture(float x, float y, int nIndex)
get the terrain detailed texture by index.
Definition: GlobalTerrain.cpp:363
void Render()
Render last scene assuming that the camera has not moved.
Definition: GlobalTerrain.cpp:502
int GetTextureCount(float x, float y)
get the total number of textures in the texture set of the terrain tile specified by a world position...
Definition: GlobalTerrain.cpp:350
Settings * GetSettings()
get the settings object to set and get terrain global parameters.
Definition: GlobalTerrain.cpp:55
void Cleanup()
clean up the global terrain
Definition: GlobalTerrain.cpp:49
void GetNormal(float x, float y, float &normalX, float &normalY, float &normalZ)
Returns the surface normal of the terrain at the specified point.
Definition: GlobalTerrain.cpp:685
void InitDeviceObjects()
this function currently does nothing
Definition: GlobalTerrain.cpp:632
void AddHeightField(float x, float y, const char *filename, int nSmoothPixels=7)
Add rectangular height field from file to the current terrain.
Definition: GlobalTerrain.cpp:907
float GetVertexSpacing() const
Returns the number of real units between vertices in the terrain&#39;s mesh.
Definition: GlobalTerrain.cpp:279
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
void Spherical(float x, float y, float radius, float offset)
offset in a spherical region
Definition: GlobalTerrain.cpp:772
bool GetHeightmapOf(float fCenterX, float fCenterY, float fSize, TTerrain *pOut)
get the height map of a given square region in the global terrain.
Definition: GlobalTerrain.cpp:1043
virtual int GetChildAttributeObjectCount(int nColumnIndex=0)
get the number of child objects (row count) in the given column.
Definition: GlobalTerrain.cpp:1351
void Update(bool bForceUpdate=false)
should be called when the camera moves to re-tessellate the terrain and rebuild the terrain buffer...
Definition: GlobalTerrain.cpp:477
bool IsVerbose()
Specifies whether or not Demeter should output diagnostic information at runtime. ...
Definition: GlobalTerrain.cpp:1114
void Paint(ParaEngine::TextureEntity *detailTexture, float brushRadius, float brushIntensity, float maxIntensity, bool erase, float x, float y)
paint on the specified location of the global terrain.
Definition: GlobalTerrain.cpp:703
void SaveTerrain(bool bHeightMap, bool bTextures)
save modified terrain to disk.
Definition: GlobalTerrain.cpp:937
virtual const char * GetAttributeClassName()
a static string, describing the attribute class object&#39;s name
Definition: GlobalTerrain.h:48
The Settings class is simply a manager of global variables. It provides a single place to set and ret...
Definition: Settings.h:10
float GetLowestVisibleHeight()
Get the height of the lowest visible terrain point.
Definition: GlobalTerrain.cpp:734
A common interface for all classes implementing IAttributeFields By implementing this class&#39;s virtual...
Definition: IAttributeFields.h:59
void SetEditor(bool isEditor)
This makes memory usage much higher but makes dynamically editing the terrain easier for applications...
Definition: GlobalTerrain.cpp:1124
void EnableTerrainRendering(bool bEnable)
specify whether to whether terrain.
Definition: GlobalTerrain.cpp:123
bool RemoveTextureInCell(float x, float y, int nIndex)
remove the given texture in the cell specified by the point(x,y).
Definition: GlobalTerrain.cpp:328
bool IsModified()
return true, if the terrain is modified and should be saved.
Definition: GlobalTerrain.cpp:960
void SetUseNormals(bool bUseNormals)
Turning this option on will make Demeter use more memory and will slow rendering slightly on most har...
Definition: GlobalTerrain.cpp:1154
virtual IAttributeFields * GetChildAttributeObject(const std::string &sName)
get attribute by child object.
Definition: GlobalTerrain.cpp:1328
Definition: IObjectScriptingInterface.h:6
void UpdateHoles(float x, float y)
Update all holes in the terrain tile that contains the input point.
Definition: GlobalTerrain.cpp:175
void DeleteDeviceObjects()
must call this function when device is lost.
Definition: GlobalTerrain.cpp:652
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386
void Roughen_Smooth(float x, float y, float radius, bool roughen=false, bool big_grid=false, float factor=0.5f)
square filter for sharpening and smoothing.
Definition: GlobalTerrain.cpp:861
bool IsTerrainEngineEnabled() const
enable/disable global real world terrain engine.
Definition: GlobalTerrain.cpp:108
void GetBoundingBox(ParaEngine::CShapeBox *BBox)
Get the bounding box from the last tessellation result.
Definition: GlobalTerrain.cpp:224
string GetOnloadScript(float x, float y)
get the on load script which created all objects on this terrain tile which contains the point x...
Definition: GlobalTerrain.cpp:456
Manages a network of Terrain objects arranged in a grid pattern to model extremely large worlds that ...
Definition: TerrainLattice.h:57
void SetAllLoadedModified(bool bIsModified=true, DWORD dwModifiedBits=16)
set all loaded terrain tile content modified.
Definition: GlobalTerrain.cpp:1001
a general view frustum class.
Definition: ShapeFrustum.h:9
void RadialScale(float x, float y, float scale_factor, float min_dist, float max_dist, float smooth_factor=0.5f, int frequency=1)
Note: terrain data should be in normalized space with height in the range [0,1].
Definition: GlobalTerrain.cpp:836
void CreateSingleTerrain(const char *sHeightmapfile, float fTerrainSize, float fElevscale, int bSwapvertical, const char *sMainTextureFile, const char *sCommonTextureFile, int nMaxBlockSize, float fDetailThreshold)
Create and set the single tile based global terrain from height map and texture files.
Definition: GlobalTerrain.cpp:127
void MergeHeightField(float x, float y, const char *filename, int mergeOperation=0, float weight1=1.0, float weight2=1.0, int nSmoothPixels=7)
merge a rectangular height field from file to the current terrain.
Definition: GlobalTerrain.cpp:922
void SnapPointToVertexGrid(float x, float y, float *vertex_x, float *vertex_y)
snap any 2D point on the height map to a vertex position on the height map.
Definition: GlobalTerrain.cpp:262
a min max box.
Definition: ShapeAABB.h:190
void CreateTerrain(const char *sConfigFileName)
create a terrain from a configuration file.
Definition: GlobalTerrain.cpp:59