Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/bsp_model/src/world_entities/terrain.h @ 7574

Last change on this file since 7574 was 7352, checked in by bottac, 19 years ago

Branch bsp_model created.

File size: 1.6 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#include "vector.h"
15
16// FORWARD DECLARATION
17class SpatialSeparation;
18class HeightMap;
19class Material;
20class BspManager;
21
22//! A simple method to call a desired debug world.
23enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
24
25
26//! A Class to handle Terrain of orxonox
27class Terrain : public WorldEntity
28{
29
30 public:
31  Terrain(const TiXmlElement* root = NULL);
32  Terrain(const std::string& fileName);
33  Terrain(DebugTerrain debugTerrain);
34  virtual ~Terrain();
35
36  virtual int       writeBytes(const byte* data, int length, int sender);
37  virtual int       readBytes(byte* data, int maxLength, int * reciever);
38  virtual void      writeDebug() const;
39  virtual void      readDebug() const;
40
41  void init();
42  virtual void loadParams(const TiXmlElement* root);
43
44  void loadVegetation(const std::string& vegetationFile);
45
46  void loadHeightMap(const std::string& heightMapFile, const std::string& colorMap);
47  void loadTexture(const std::string& textureName);
48  void setScale(float x, float y, float z);
49
50  void buildDebugTerrain(DebugTerrain debugTerrain);
51
52  float getHeight(float x, float y);
53  virtual void draw() const;
54
55  public:
56    SpatialSeparation* ssp;
57
58 private:
59   Model*              vegetation;
60   int                 objectList;
61
62   HeightMap*          heightMap;
63   BspManager*         bspManager;
64   Material*           heightMapMaterial;
65   Vector              terrainScale;
66};
67
68#endif /* _TERRAIN_H */
Note: See TracBrowser for help on using the repository browser.