CloudyDay
 All Classes Functions Variables Enumerations
Terrain.h
1 #pragma once
2 #include "Scene.h"
3 #include "TerrainConfig.h"
4 #include "Fog.h"
5 
6 namespace osgCloudyDay
7 {
11  class MyTerrain
12  {
13  public:
18  MyTerrain(TerrainConfig* config);
22  ~MyTerrain(void);
23 
27  virtual void Initialize() = 0;
28 
33  osg::MatrixTransform* GetNode();
38  osg::MatrixTransform* GetLightNode();
39 
44  void SetFog(Fog* fog);
45 
50  osg::ref_ptr<osg::Texture2D> GetHeightTexture();
55  osg::ref_ptr<osg::Texture2D> GetDefinitionTexture();
60  osg::ref_ptr<osg::Texture2D> GetOrthogonalTexture();
61 
62  protected:
63  Fog* m_fog;
64 
65  osg::ref_ptr<osg::Texture2D> tex_height;
66  osg::ref_ptr<osg::Texture2D> tex_def;
67  osg::ref_ptr<osg::Texture2D> tex_ortho;
68 
69  TerrainConfig* m_config;
70 
71  osg::ref_ptr<osg::Program> terrainShadowProg;
72  osg::ref_ptr<osg::Program> mieTerrainProg;
73  osg::ref_ptr<osg::MatrixTransform> trans;
74  osg::ref_ptr<osg::MatrixTransform> trans_light;
75 
76  bool m_use_geometry_shader;
77  };
78 }