//////////////////////////////////////////////////////////// // terrain.h // // Header file for the terrain class for EDrive, a multiplatform driving // simulator. // // Copyright 2004 by Evan Alexander Weaver // // Despite the copyright, this is free software. See edrive.cpp for details. // // Date last modified: 31 May 2004 #ifndef _edrive_terrain_h_ #define _edrive_terrain_h_ #include "graphics.h" // The terrain over which the car drives // class terrain { vector tri[1000][3]; // copy of triangles comprising the terrain int tricnt; // the actual number of triangles thing piece[20]; // different pieces making up the terrain int piececnt; // the actual number of pieces public: terrain(); terrain(const terrain&); // intentionally omitted... terrain &operator=(const terrain &); // ...to prevent copies ~terrain(); // destroy the terrain's pieces void destroy(); // load the terrain from file bool create(graphics &g, const char *file); // draw the terrain void draw(graphics &); // return the height with X coord "x" and Z coord "z" float height(float x, float z); }; #endif