Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/height_map_merge/src/world_entities/terrain.h @ 6727

Last change on this file since 6727 was 6727, checked in by bottac, 19 years ago
File size: 1.4 KB
Line 
1/*!
2 * @file terrain.h
3  *  Defines and handles the terrain of the World
4
5    @todo implement it
6
7    The terrain should either be build from a Model a OBJModel or from a HeightMap.
8*/
9
10#ifndef _TERRAIN_H
11#define _TERRAIN_H
12
13#include "world_entity.h"
14
15// FORWARD DECLARATION
16class SpatialSeparation;
17class HeightMap;
18class Material;
19
20//! A simple method to call a desired debug world.
21enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
22
23
24//! A Class to handle Terrain of orxonox
25class Terrain : public WorldEntity
26{
27
28 public:
29  Terrain(const TiXmlElement* root = NULL);
30  Terrain(const char* fileName);
31  Terrain(DebugTerrain debugTerrain);
32  virtual ~Terrain();
33
34  virtual int       writeBytes(const byte* data, int length, int sender);
35  virtual int       readBytes(byte* data, int maxLength, int * reciever);
36  virtual void      writeDebug() const;
37  virtual void      readDebug() const;
38
39  void init();
40  void loadParams(const TiXmlElement* root);
41
42  void loadVegetation(const char* vegetationFile);
43
44  void loadHeightMap(const char* heightMapFile, const char* colorMap = NULL);
45  void loadTexture(const char* textureName);
46
47  void buildDebugTerrain(DebugTerrain debugTerrain);
48 
49  float getHeight(float x, float y);
50  virtual void draw() const;
51
52  public:
53    SpatialSeparation* ssp;
54
55 private:
56   Model*              vegetation;
57   int                 objectList;
58
59   HeightMap*          heightMap;
60   Material*           heightMapMaterial;
61};
62
63#endif /* _TERRAIN_H */
Note: See TracBrowser for help on using the repository browser.