Last change
on this file since 6687 was
6495,
checked in by bensch, 19 years ago
|
terrain updated, so it can load a new HeightMap from an XML file
|
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 |
---|
16 | class SpatialSeparation; |
---|
17 | class HeightMap; |
---|
18 | class Material; |
---|
19 | |
---|
20 | //! A simple method to call a desired debug world. |
---|
21 | enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH}; |
---|
22 | |
---|
23 | |
---|
24 | //! A Class to handle Terrain of orxonox |
---|
25 | class 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 | virtual void draw() const; |
---|
49 | |
---|
50 | public: |
---|
51 | SpatialSeparation* ssp; |
---|
52 | |
---|
53 | private: |
---|
54 | Model* vegetation; |
---|
55 | int objectList; |
---|
56 | |
---|
57 | HeightMap* heightMap; |
---|
58 | Material* heightMapMaterial; |
---|
59 | }; |
---|
60 | |
---|
61 | #endif /* _TERRAIN_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.