/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: */ #include "vertex_array_model.h" #define sampleRate 4 class SDL_Surface; class Vector; class Material; class PNode; class Texture; class HeightMap : public VertexArrayModel { public: void load(); void load(int Mode); void load(const char*, int Mode); void scale( Vector V); float getHeight(float x, float y); // x,y relative to HeightMap HeightMap(); HeightMap(const char*); HeightMap(const char*, const char*); ~HeightMap(); private: SDL_Surface* heightMap; SDL_Surface* colourMap; unsigned char* heights; unsigned char* colours; void generateNormalVectorField(); void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight ); void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight); Vector ** normalVectorField ; Vector camCoords; Material * tmp_mat; Material* red_mat; Texture* texture; const PNode* camera; float scaleX ; float scaleY ; float scaleZ ; int cmScaleX; int cmScaleY; bool hasColourMap; inline int abs(int val) { if(val < 0) val = -val; return val; } };