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
|
Rev | Line | |
---|
[5942] | 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 | |
---|
[5967] | 15 | |
---|
[6249] | 16 | #include "vertex_array_model.h" |
---|
[5942] | 17 | |
---|
[6249] | 18 | #define sampleRate 4 |
---|
[6227] | 19 | |
---|
[5967] | 20 | class SDL_Surface; |
---|
| 21 | class Vector; |
---|
[6227] | 22 | class Material; |
---|
| 23 | class PNode; |
---|
| 24 | class Texture; |
---|
[5942] | 25 | |
---|
[6249] | 26 | class HeightMap : public VertexArrayModel |
---|
[5942] | 27 | { |
---|
| 28 | public: |
---|
[6249] | 29 | |
---|
[5942] | 30 | void load(); |
---|
[6227] | 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 |
---|
[5942] | 35 | HeightMap(); |
---|
[5967] | 36 | HeightMap(const char*); |
---|
[6227] | 37 | HeightMap(const char*, const char*); |
---|
[5967] | 38 | ~HeightMap(); |
---|
| 39 | |
---|
[6227] | 40 | |
---|
[5967] | 41 | private: |
---|
| 42 | SDL_Surface* heightMap; |
---|
[6227] | 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 | } |
---|
[5967] | 66 | |
---|
[5942] | 67 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.