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 | |
---|
20 | class SDL_Surface; |
---|
21 | class Vector; |
---|
22 | class Material; |
---|
23 | class PNode; |
---|
24 | class Texture; |
---|
25 | |
---|
26 | class HeightMap : public VertexArrayModel |
---|
27 | { |
---|
28 | public: |
---|
29 | |
---|
30 | void load(); |
---|
31 | void load(int Mode); |
---|
32 | void load(const char*, int Mode); |
---|
33 | void scale( Vector V); |
---|
34 | float getHeight(float x, float y); // x,y relative to HeightMap |
---|
35 | HeightMap(); |
---|
36 | HeightMap(const char*); |
---|
37 | HeightMap(const char*, const char*); |
---|
38 | ~HeightMap(); |
---|
39 | |
---|
40 | |
---|
41 | private: |
---|
42 | SDL_Surface* heightMap; |
---|
43 | SDL_Surface* colourMap; |
---|
44 | unsigned char* heights; |
---|
45 | unsigned char* colours; |
---|
46 | void generateNormalVectorField(); |
---|
47 | void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight ); |
---|
48 | void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight); |
---|
49 | Vector ** normalVectorField ; |
---|
50 | Vector camCoords; |
---|
51 | Material * tmp_mat; |
---|
52 | Material* red_mat; |
---|
53 | Texture* texture; |
---|
54 | const PNode* camera; |
---|
55 | float scaleX ; |
---|
56 | float scaleY ; |
---|
57 | float scaleZ ; |
---|
58 | int cmScaleX; |
---|
59 | int cmScaleY; |
---|
60 | bool hasColourMap; |
---|
61 | inline 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.