My Project
TerrainGeoMipmapIndices.h
1 
2 
3 #pragma once
4 
5 namespace ParaTerrain
6 {
7  enum GeoMipmapChunkType
8 {
9  gmc_normal = 0,
10  gmc_surrounded,
11  gmc_topLeft,
12  gmc_left,
13  gmc_bottomLeft,
14  gmc_bottom,
15  gmc_bottomRight,
16  gmc_right,
17  gmc_topRight,
18  gmc_top,
19  gmc_chunkTypeCount,
20 };
21 
22  class IndexInfo
23 {
24  int m_startPos;
25  int m_indexCount;
26 
27 public:
28  IndexInfo():m_startPos(0),m_indexCount(0){};
29  int GetStartIndexPos(){return m_startPos;};
30  int GetIndexCount(){return m_indexCount;};
31 
32  void SetStartIndex_(int startIndex){m_startPos = startIndex;}
33  void SetIndexCount_(int count){m_indexCount = count;}
34 };
35 
37  {
38  public:
41  bool CreateIndex(int indexOffset,int vertexCountX,int minVertexLodStep,int lodCount);
42  IndexInfo* GetChunkIndexInfo(int level,GeoMipmapChunkType type);
43  short* GetIndexData(){return m_pIndices;};
44  void ReleaseInternalIndices();
45  int GetIndexCount(){return m_totalIndexCount;}
46 
47  private:
48  int m_minVertexLodStep;
49  int m_lodCount;
50  int m_vertexCountX;
51  int m_indexOffset;
52 
53  int m_totalIndexCount;
54  short* m_pIndices;
55  IndexInfo** m_lodIndexInfoGroup;
56 
57  int GetChunkIndexCount(int vertexLodStep,GeoMipmapChunkType type);
58  int GetLevelIndexCount(int vertexLodStep);
59  int FillLevelIndex(int startIdx,int level);
60  };
61 }
Definition: SceneObject.h:15
Definition: TerrainGeoMipmapIndices.h:36
Definition: TerrainGeoMipmapIndices.h:22