My Project
TriangleFan.h
1 #pragma once
2 #include "Terrain.h"
3 #include "TerrainBlock.h"
4 #include "VertexFVF.h"
5 
6 namespace ParaTerrain
7 {
8  class TriangleFan
9  {
10  public:
11  TriangleFan();
12  TriangleFan(const TriangleFan& tf);
13  ~TriangleFan();
14  void Render(Terrain * pTerrain);
15  int BuildTriangles(Terrain * pTerrain, terrain_vertex * pIndices, int nStart);
16  int BuildTriangles(Terrain * pTerrain, terrain_vertex_normal * pIndices, int nStart);
17  int GetTriangleNum();
18  private:
19  int m_pVertices[MAX_VERTICES_PER_FAN]; // Indices into the terrain vertices
20  // TBD: It is a pretty awful waste of memory to preallocate MAX_VERTICES_PER_FAN vertices for every triangle fan,
21  // when in most cases only a few vertices are needed. However, dynamically allocating these vertices
22  // during every tessellation is not an option either because it causes huge performance problems and
23  // badly fragments memory. Any good ideas for this?
24  unsigned char m_NumberOfVertices;
25  float fOffsetTexU, fOffsetTexV;
26  // in range [0, 8*8)
27  int texture_group_id;
28 
29  friend class TerrainBlock;
30  friend class Terrain;
31  friend class TerrainBuffer;
32  };
33 }
34 
Definition: SceneObject.h:15
for terrain
Definition: VertexFVF.h:86
it contains all the necessary dynamic information to render the terrain for the current frame...
Definition: TerrainBuffer.h:31
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
for terrain with normal
Definition: VertexFVF.h:95