/* 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 "resource_manager.h" #include "vector.h" #include "objModel.h" #include "obb_tree.h" using namespace std; /** * creates an environment */ Environment::Environment () : WorldEntity() { this->setClassID(CL_ENVIRONMENT, "Environment"); this->model = (Model*)ResourceManager::getInstance()->load("models/ships/bolido.obj", OBJ, RP_CAMPAIGN); if(this->obbTree == NULL) this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); } /** * deletes an environment */ Environment::~Environment () {} /** * ticks the environment * @param time the time about which to tick */ void Environment::tick (float time) {} /** * draws the Environment */ void Environment::draw () { glMatrixMode(GL_MODELVIEW); glPushMatrix(); float matrix[4][4]; glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); //rotate this->getAbsDir().matrix (matrix); glMultMatrixf((float*)matrix); this->model->draw(); glPopMatrix(); }