My Project
|
it represents the quad tree node of LOD terrain data More...
#include <TerrainBlock.h>
Public Member Functions | |
TerrainBlock (TerrainBlock *pParent, bool useGeoMipmap=false) | |
TerrainBlock (int homeVertex, int stride, Terrain *pTerrain, TerrainBlock *pParent, bool useGeoMipmap=false) | |
void | CalculateGeometry (Terrain *pTerrain) |
pre-compute data in this block. More... | |
void | Tessellate (uint32 *pCountStrips, Terrain *pTerrain) |
generate triangles for rendering in higher LOD. More... | |
void | RepairCracks (Terrain *pTerrain, uint32 *pCountFans) |
repair cracks in this block and child blocks. More... | |
bool | IsActive () |
int | GetStride () |
int | GetHomeIndex () |
bool | IsHole () |
float | GetMaxError () |
the amount of vertex error introduced if this block is simplified as just two triangles | |
float | GetMaxElevation () |
float | GetMinElevation () |
void | EnableStrip (Terrain *pTerrain, bool bEnabled) |
void | VertexChanged (Terrain *pTerrain) |
void | VertexChanged (Terrain *pTerrain, int index1) |
void | VertexChanged (Terrain *pTerrain, int index1, int index2) |
void | IntersectRay (const CShapeRay &ray, Vector3 &intersectionPoint, float &lowestDistance, const Terrain *pTerrain) |
bool | UpdateHoles (Terrain *pTerrain) |
update holes in the terrain. More... | |
short int | GetFrustumState () |
void | SetLod (int level, GeoMipmapChunkType type) |
int | GetLodLevel () |
GeoMipmapChunkType | GetChunkType () |
Public Attributes | |
IndexInfo * | m_indexInfo |
bool | m_useGeoMipmap |
int | m_chunkCountX |
int | m_lodLevel |
GeoMipmapChunkType | m_chunkType |
Friends | |
class | Terrain |
it represents the quad tree node of LOD terrain data
void TerrainBlock::CalculateGeometry | ( | Terrain * | pTerrain | ) |
pre-compute data in this block.
This is a recursive function.
void TerrainBlock::RepairCracks | ( | Terrain * | pTerrain, |
uint32 * | pCountFans | ||
) |
repair cracks in this block and child blocks.
This is a recursive function.
for the special condition
void TerrainBlock::Tessellate | ( | uint32 * | pCountStrips, |
Terrain * | pTerrain | ||
) |
generate triangles for rendering in higher LOD.
This is a recursive function.
define to use depth first transversing
bool TerrainBlock::UpdateHoles | ( | Terrain * | pTerrain | ) |
update holes in the terrain.
This will set the m_bIsHold attribute of the terrain block. This function will recursively call itself. Call this function when the terrain block has already been built. return true if any of its child block contains a hole.
if the block is smaller than a terrain hole, check from the hole map whether this block is inside a hole
if this block is a container block, then this block will only be a hole if all of its child is a hole block