/* 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: Patrick Boenzli co-programmer: */ #include "environment.h" #include "stdincl.h" #include "world_entity.h" #include "vector.h" using namespace std; //Sorry Bensch #define LEVEL_LENGTH 500 Environment::Environment () : WorldEntity() { /* //Sorry Bensch: x,y = 10 for (int x = 0; x < 50; x++) { for (int y = 0; y < 50; y++) { mountainTest[x][y] =0; } } //Sorry Bensch: x,y = 9 for (int x = 1; x < LEVEL_LENGTH; x++) { for (int y = 1; y < LEVEL_LENGTH; y++) { //mountainTest[x][y] = (float)random() / 900000000; mountainTest[x][y] = (float)(random() % 4); } } */ } Environment::~Environment () {} void Environment::tick (float time) {} void Environment::hit (WorldEntity* weapon, Vector loc) {} void Environment::destroy () {} void Environment::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} void Environment::draw () { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); float matrix[4][4]; glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z); get_placement()->w.matrix (matrix); glMultMatrixf ((float*)matrix); glBegin(GL_TRIANGLES); glColor3f(1,0,1); glVertex3f(0,0,0.5); glVertex3f(-0.5,0,-1); glVertex3f(0.5,0,-1); glVertex3f(0,0,0.5); glVertex3f(0,0.5,-1); glVertex3f(0,-0.5,-1); glEnd(); glBegin(GL_QUADS); glColor3f(1,0,1); glVertex3f(0.5,0.5,-1); glVertex3f(0.5,-0.5,-1); glVertex3f(-0.5,-0.5,-1); glVertex3f(-0.5,0.5,-1); glEnd(); } /* void Environment::paint() { glPushMatrix(); //glScalef(0.5, 0.5, 1.0); //glTranslatef(xCor, yCor, zCor); glTranslatef( -16.0, -2.0, 0.0); glColor3f(0.0, 1.0, 0.0); glBegin(GL_LINES); for (int x = 0; x < LEVEL_LENGTH; x += 1) { for (int y = 0; y < 190; y += 1) { glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]); glVertex3f((float)(2*x), (float)(2*(y+1)), mountainTest[x][y+1]); } } glEnd(); glBegin(GL_LINES); for (int y = 0; y < LEVEL_LENGTH; y += 1) { for (int x = 0; x < 90; x += 1) { glVertex3f((float)(2*x), (float)(2*y), mountainTest[x][y]); glVertex3f((float)(2*(x+1)), (float)(2*y), mountainTest[x+1][y]); } } glEnd(); glPopMatrix(); } void Environment::drawEnvironment() { } */