2 #include "IAttributeFields.h" 3 #include "TerrainLoadListener.h" 4 #include "TextureSet.h" 5 #include "TextureFactory.h" 7 #include "TerrainGeoMipmapIndices.h" 60 typedef map<int, TerrainTileCacheItem> TerrainTileCacheMap_type;
69 virtual int GetChildAttributeObjectCount(
int nColumnIndex = 0);
71 virtual int GetChildAttributeColumnCount();
72 virtual IAttributeFields* GetChildAttributeObject(
int nRowIndex,
int nColumnIndex = 0);
74 void Load(
char *szBaseName,
int maxNumTriangles,
int maxBlockSize,
float commonRepeats);
75 void SetTileSize(
float fTileSize);
79 Terrain *GetTerrain(
int positionX,
int positionY);
80 Terrain *GetTerrainAtPoint(
float x,
float y);
81 void SetCameraPosition(
float x,
float y,
float z);
82 void ModelViewMatrixChanged();
84 float GetElevation(
float x,
float y);
90 DWORD GetRegionValue(
const string& sLayerName,
float x,
float y);
98 void GetNormal(
float x,
float y,
float &normalX,
float &normalY,
float &normalZ);
99 float IntersectRay(
float startX,
float startY,
float startZ,
float dirX,
float dirY,
float dirZ,
float &intersectX,
float &intersectY,
float &intersectZ,
float fMaxDistance = INFINITY);
102 void SetLowestVisibleHeight(
float fHeight);
104 float GetLowestVisibleHeight();
107 void Paint(
ParaEngine::TextureEntity* detailTexture,
float brushRadius,
float brushIntensity,
float maxIntensity,
bool erase,
float x,
float y);
123 void Flatten(
float x,
float y,
float radius,
int flatten_op,
float elevation,
float factor);
135 void DigCircleFlat(
float x,
float y,
float radius,
float fFlatPercentage = 0.7f,
float factor = 0.5f);
151 void GaussianHill(
float x,
float y,
float radius,
float hscale,
float standard_deviation = 0.1f,
float smooth_factor = 0.5f);
159 void Spherical(
float x,
float y,
float radius,
float offset);
172 void RadialScale(
float x,
float y,
float scale_factor,
float min_dist,
float max_dist,
float smooth_factor = 0.5f,
int frequency = 1);
188 void Roughen_Smooth(
float x,
float y,
float radius,
bool roughen =
false,
bool big_grid =
false,
float factor = 0.5f);
199 void AddHeightField(
float x,
float y,
const char* filename,
int nSmoothPixels = 7);
219 void MergeHeightField(
float x,
float y,
const char* filename,
int mergeOperation = 0,
float weight1 = 1.0,
float weight2 = 1.0,
int nSmoothPixels = 7);
227 void Ramp(
float x1,
float y1,
float x2,
float y2,
float radius,
float borderpercentage = 0.5f,
float factor = 1.0f);
233 void UpdateHoles(
float x,
float y);
241 bool IsHole(
float x,
float y);
250 void SetHole(
float x,
float y,
bool bIsHold);
252 void InitDeviceObjects();
253 void DeleteDeviceObjects();
254 void InvalidateDeviceObjects();
259 float GetVertexElevation(
float x,
float y);
264 void SetVertexElevation(
float x,
float y,
float newElevation,
bool recalculate_geometry =
true);
269 float GetVertexSpacing()
const;
276 bool SnapPointToVertexGrid(
float& x,
float& y);
283 int GetMaxTileCacheSize();
290 void SetMaxTileCacheSize(
int nNum);
293 void ResizeTextureMaskWidth(
int nWidth);
296 void SetGlobalConfigModified(
bool bEnable =
true);
306 bool Copy_Rect_to_HeightField(
ParaEngine::TTerrain* pHeightField,
float x,
float y,
float fRadius,
bool bNormalize =
true);
315 bool Apply_HeightField_to_Rect(
ParaEngine::TTerrain* pHeightField,
float x,
float y,
bool bRecalculateGeometry,
bool bRecoverHeightData =
true);
321 void RecalculateTerrainGeometry(
float x,
float y,
float fRadius);
324 Terrain * CreateTerrainTile(
int positionX,
int positionY);
325 ParaTerrain::DIRECTION GetOppositeDirection(ParaTerrain::DIRECTION direction);
326 Terrain *GetTerrainRelative(
Terrain * pTerrain,
int positionX,
int positionY);
327 Terrain *GetTerrainRelative(
Terrain * pTerrain, ParaTerrain::DIRECTION direction);
328 Terrain *LoadTerrain(
int index);
331 int m_WidthActiveTerrains, m_HeightActiveTerrains;
332 float m_TerrainWidth, m_TerrainHeight;
334 float m_fLowestVisibleHeight;
337 TerrainTileCacheMap_type m_pCachedTerrains;
340 int m_CurrentTerrainIndex[9];
345 bool m_bIsGlobalConfigModified;
358 void GetBoundingBoxes(vector<ParaEngine::CShapeAABB>& boxes,
const Matrix4* modelView,
const ParaEngine::CShapeFrustum& frustum,
int nMaxBoxesNum = 1024,
int nSmallestBoxStride = 4);
361 static int GetTileIDFromXY(
int X,
int Y);
364 static bool GetXYFromTileID(
int nTileID,
int* X,
int* Y);
367 void SetAllLoadedModified(
bool bIsModified =
true, DWORD dwModifiedBits = 16);
373 void SaveTerrain(
bool bHeightMap,
bool bTextures);
379 void SwitchLodStyle(
bool useGeoMipmap);
380 bool IsWalkable(
float x,
float y,
Vector3& oNormal);
381 void SetTerrainInfo(
float x,
float y,
float radius, uint32 data, uint32 bitMask, uint32 bitOffset);
382 uint32 GetTerrainInfo(
float x,
float y, uint32 bitMask, uint32 bitOffset);
383 void SetEditorMode(
bool enable);
384 void SetVisibleDataMask(uint32 mask, uint8 bitOffset);
389 int m_terrainBlockXCount;
392 int m_Level0ChunkCount;;
393 int m_Level1ChunkCount;
395 void CreateGeoMipmapIndexBuffer();
396 void GetIndexInfo(
int level, GeoMipmapChunkType type);
397 void CalcGeoMipmapLod(
float camX,
float camY);
398 int CalcBlockLod(
int* lodBounds,
int blockIndexX,
int blockIndexY,
int maxLod);
400 void SetVertexInfo(
float x,
float y, uint32 data, uint32 bitMask, uint32 bitOffset);
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
Definition: SceneObject.h:15
Definition: TerrainGeoMipmapIndices.h:36
virtual float GetTerrainWidth()=0
Returns the width in world units of each of the individual Terrain objects in the lattice (they must ...
temp height field terrain data used by terrain filters.
Definition: TTerrain.h:16
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual float GetTerrainHeight()=0
Returns the height in world units of each of the individual Terrain objects in the lattice (they must...
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
virtual void UnloadTerrain(int latticeX, int latticeY, Terrain *pTerrain)=0
Called by the TerrainLattice when a Terrain object in the lattice is no longer within the visible reg...
virtual Terrain * LoadTerrainAt(Terrain *pTerrain, int latticeX, int latticeY, bool useGeoMipmap=false)=0
Called by the TerrainLattice when a Terrain object in the lattice has entered the visible region and...
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
in OpenGL, there is no different between vertex and index buffer.
Definition: ParaVertexBuffer.h:78
A common interface for all classes implementing IAttributeFields By implementing this class's virtual...
Definition: IAttributeFields.h:59
You derive a concrete implementation of this interface in order to serve Terrains up to a TerrainLatt...
Definition: TerrainLattice.h:29
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386
Manages a network of Terrain objects arranged in a grid pattern to model extremely large worlds that ...
Definition: TerrainLattice.h:57
a general view frustum class.
Definition: ShapeFrustum.h:9
virtual bool UpdateTileConfigFile(int x, int y, const string &sTileConfigFile)=0
update the tile config file for the terrain terrain tile x,y.
a min max box.
Definition: ShapeAABB.h:190
virtual bool SaveWorldConfigFile()=0
save world config file to disk.