/* 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" #include "objModel.h" #include "obb_tree.h" using namespace std; /** \brief creates an environment */ Environment::Environment () : WorldEntity() { this->setClassID(CL_ENVIRONMENT, "Environment"); this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj"/*"worlds/vulcania.obj"*/, OBJ, RP_CAMPAIGN); this->obbTree = new OBBTree(15, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); } /** \brief deletes an environment */ Environment::~Environment () { } /** \brief ticks the environment \param time the time about which to tick */ void Environment::tick (float time) {} /** \brief if a hit occures */ void Environment::hit (WorldEntity* weapon, Vector* loc) {} /** \brief destroys an Environment */ void Environment::destroy () {} /** \brief a collision with some ship */ void Environment::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} /** \brief draws the Environment */ void Environment::draw () { //this->getRelCoor().debug(); 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(); }