Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
BruteTerrain.h
1 //
2 // BruteTerrain class : A brute-force rendered terrain
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef CUSTOMTERRAINH
9 #define CUSTOMTERRAINH
10 
13 
14 #include "DynTerrain.h"
15 
27 {
28 public:
29  BruteTerrain();
30 
31  // initialization
32  DTErr Init(const vtElevationGrid *pGrid, float fZScale);
33 
34  // overrides
35  void DoRender();
36  void DoCulling(const vtCamera *pCam);
37  float GetElevation(int iX, int iZ, bool bTrue = false) const;
38  void GetWorldLocation(int iX, int iZ, FPoint3 &p, bool bTrue = false) const;
39  float GetVerticalExag() const { return m_fZScale; }
40 
41 protected:
42  virtual ~BruteTerrain();
43 
44  // rendering
45  void RenderSurface();
46  void RenderPass();
47  void LoadSingleMaterial();
48 
49 private:
50  float *m_pData; // the elevation height array
51  float m_fZScale;
52 };
53  // Group dynterr
55 
56 #endif