My Project
TerrainBuffer.h
1 #pragma once
2 #include "util/ParaMemPool.h"
3 
4 namespace ParaTerrain
5 {
6  using namespace ParaEngine;
7  class Terrain;
8 
12  struct TextureGroup
13  {
14  public:
19  };
20 
21  typedef FixedSizedAllocator<TextureGroup> TextureGroup_Allocator;
22  typedef std::vector <TextureGroup> TextureGroups_Type;
23 
32  {
33  public:
38 
41 
44 
47 
49  TextureGroups_Type m_textureGroups;
50  public:
51  TerrainBuffer();
52  ~TerrainBuffer();
53  public:
54 
55  VertexBufferDevicePtr_type GetVertexBufferDevicePtr();
56 
58  void DeleteDeviceObjects();
62  void RebuildBuffer();
63 
65  bool HasData();
66 
67  //GeoMipmapCode
68  void BuildGeoMipmapBuffer();
69  int GetChunkVertexOffset(int x, int y);
70  };
71 }
Definition: SceneObject.h:15
Matrix4 matModelview
current camera model view matrix
Definition: TerrainBuffer.h:37
different physics engine has different winding order.
Definition: EventBinding.h:32
cross platform vertex/index buffer.
Definition: ParaVertexBuffer.h:18
int nStartIndex
the index of the first triangle vertex in the m_pVertexBuffer buffer.
Definition: TerrainBuffer.h:16
Terrain * m_pTerrain
the terrain object for which this buffer is built
Definition: TerrainBuffer.h:35
int nNumTriangles
The total number of triangles in this group.
Definition: TerrainBuffer.h:18
it represents a texture batch of many triangles.
Definition: TerrainBuffer.h:12
int m_nNumOfTriangles
total number of vertices
Definition: TerrainBuffer.h:46
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
it contains all the necessary dynamic information to render the terrain for the current frame...
Definition: TerrainBuffer.h:31
ParaVertexBuffer m_pVertexBuffer
the dynamic vertex buffer which hold a triangle vertex array
Definition: TerrainBuffer.h:40
TextureGroups_Type m_textureGroups
groups of object ordered by texture
Definition: TerrainBuffer.h:49
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386
int m_nBufferSize
number of reserved triangles in buffer
Definition: TerrainBuffer.h:43