Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/height_map/src/lib/graphics/importer/height_map.h @ 6249

Last change on this file since 6249 was 6249, checked in by bottac, 18 years ago

Uses VertexArrayModel now

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer:
13*/
14
15
16#include "vertex_array_model.h"
17
18#define sampleRate 4
19
20class SDL_Surface;
21class Vector;
22class Material;
23class PNode;
24class Texture;
25
26class HeightMap : public VertexArrayModel
27{
28public:
29
30void load();
31void load(int Mode);
32void load(const char*, int Mode);
33void scale( Vector V); 
34float getHeight(float x, float y); // x,y relative to HeightMap
35HeightMap();
36HeightMap(const char*);
37HeightMap(const char*, const char*);
38~HeightMap();
39
40
41private:
42SDL_Surface* heightMap;
43SDL_Surface* colourMap;
44unsigned char* heights; 
45unsigned char* colours;
46void generateNormalVectorField();
47void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
48void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
49Vector  **  normalVectorField ; 
50Vector     camCoords;
51Material * tmp_mat;
52Material* red_mat;
53Texture* texture;
54const PNode* camera;
55float scaleX ;
56float scaleY ;
57float scaleZ ;
58int   cmScaleX;
59int   cmScaleY;
60bool  hasColourMap;
61inline int abs(int val)
62{
63 if(val < 0) val = -val;
64 return val;
65}
66
67};
Note: See TracBrowser for help on using the repository browser.