2 #include "TerrainCommon.h" 3 #include "util/ParaMemPool.h" 4 #include "TriangleStrip.h" 5 #include "TriangleFan.h" 11 #include "TerrainGeoMipmapIndices.h" 17 typedef TerrainBlock* TerrainBlockPtr;
18 typedef std::deque<TerrainBlockPtr, FixedSizedAllocator<TerrainBlockPtr> > deque_TerrainBlockPtr_Type;
19 typedef std::queue<TerrainBlockPtr, deque_TerrainBlockPtr_Type> queue_TerrainBlockPtr_Type;
37 inline int GetStride()
41 inline int GetHomeIndex()
52 inline float GetMaxElevation(){
return m_MaxElevation;}
53 inline float GetMinElevation(){
return m_MinElevation;}
55 void EnableStrip(
Terrain * pTerrain,
bool bEnabled);
57 void VertexChanged(
Terrain * pTerrain);
58 void VertexChanged(
Terrain * pTerrain,
int index1);
59 void VertexChanged(
Terrain * pTerrain,
int index1,
int index2);
60 void IntersectRay(
const CShapeRay & ray,
Vector3 & intersectionPoint,
float &lowestDistance,
const Terrain * pTerrain);
71 void CreateTriangleStrip(uint32 *pCount,
Terrain * pTerrain);
73 bool Tessellate_NonRecursive(uint32 *pCountStrips,
Terrain * pTerrain);
76 void ComputeMaxVertexError(
Terrain * pTerrain);
81 float m_MinElevation, m_MaxElevation;
84 int m_nTriangleStripIndex;
86 short int m_texture_group_id;
88 short int m_texture_cell_id;
90 short int m_texture_fog_id;
101 short int m_fog_side;
103 inline bool IsInFogRadius() {
return m_texture_group_id == m_texture_cell_id; }
114 inline short int GetFogSide() {
return m_fog_side; }
121 short int m_frustum_state;
123 inline short int GetFrustumState() {
return m_frustum_state; }
125 float m_texture_tile_x;
126 float m_texture_tile_y;
128 #if _USE_RAYTRACING_SUPPORT_ > 0 137 bool m_bChildrenActive:1;
148 GeoMipmapChunkType m_chunkType;
150 void SetLod(
int level,GeoMipmapChunkType type);
151 int GetLodLevel(){
return m_lodLevel;}
152 GeoMipmapChunkType GetChunkType(){
return m_chunkType;}
156 void InitMipmapBlock(
int homeVertex,
int stride,
Terrain* pTerrain,
TerrainBlock* pParent,
int nCol,
int nRow);
157 void TessellateGeoMipmap(
Terrain* pTerrain);
158 void CalculateGeometryGeoMipmap(
Terrain * pTerrain);
159 int GetChildChunkCount()
162 return m_chunkCountX*m_chunkCountX;
167 int GetTextureGroupId(){
return m_texture_group_id;}
168 bool IsInFog(){
return m_texture_group_id == m_texture_fog_id;}
169 void IntersectRayGeoMipmap(
const CShapeRay & ray,
Vector3 & intersectionPoint,
float &lowestDistance,
const Terrain * pTerrain);
170 void IntersectRayTriangle(
const CShapeRay & ray,
Vector3 & intersectionPoint,
float &lowestDistance,
const Terrain * pTerrain,
int startVertex);
Definition: SceneObject.h:15
different physics engine has different winding order.
Definition: EventBinding.h:32
float GetMaxError()
the amount of vertex error introduced if this block is simplified as just two triangles ...
Definition: TerrainBlock.h:50
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
void RepairCracks(Terrain *pTerrain, uint32 *pCountFans)
repair cracks in this block and child blocks.
Definition: TerrainBlock.cpp:444
Definition: TerrainGeoMipmapIndices.h:22
void CalculateGeometry(Terrain *pTerrain)
pre-compute data in this block.
Definition: TerrainBlock.cpp:730
Definition: TriangleFan.h:8
it represents the quad tree node of LOD terrain data
Definition: TerrainBlock.h:22
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386
A ray is a half-line P(t) = mOrig + mDir * t, with 0 <= t <= +infinity.
Definition: ShapeRay.h:11
bool UpdateHoles(Terrain *pTerrain)
update holes in the terrain.
Definition: TerrainBlock.cpp:142
Definition: TriangleStrip.h:9
void Tessellate(uint32 *pCountStrips, Terrain *pTerrain)
generate triangles for rendering in higher LOD.
Definition: TerrainBlock.cpp:179