| 1 |  | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | orxonox - the future of 3D-vertical-scrollers | 
|---|
| 5 |  | 
|---|
| 6 | Copyright (C) 2004 orx | 
|---|
| 7 |  | 
|---|
| 8 | This program is free software; you can redistribute it and/or modify | 
|---|
| 9 | it under the terms of the GNU General Public License as published by | 
|---|
| 10 | the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 11 | any later version. | 
|---|
| 12 |  | 
|---|
| 13 | ### File Specific | 
|---|
| 14 | main-programmer: Patrick Boenzli | 
|---|
| 15 | co-programmer: | 
|---|
| 16 | */ | 
|---|
| 17 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY | 
|---|
| 18 |  | 
|---|
| 19 |  | 
|---|
| 20 | #include "environment.h" | 
|---|
| 21 |  | 
|---|
| 22 | #include "util/loading/resource_manager.h" | 
|---|
| 23 |  | 
|---|
| 24 | #include "vector.h" | 
|---|
| 25 | #include "objModel.h" | 
|---|
| 26 | #include "obb_tree.h" | 
|---|
| 27 | #include "util/loading/factory.h" | 
|---|
| 28 |  | 
|---|
| 29 | using namespace std; | 
|---|
| 30 | CREATE_FACTORY(Environment, CL_ENVIRONMENT); | 
|---|
| 31 |  | 
|---|
| 32 | /** | 
|---|
| 33 | *  creates an environment | 
|---|
| 34 | */ | 
|---|
| 35 | Environment::Environment () : WorldEntity() | 
|---|
| 36 | { | 
|---|
| 37 | this->init(); | 
|---|
| 38 | this->loadModel("models/ships/bolido.obj"); | 
|---|
| 39 | //   if(this->obbTree == NULL) | 
|---|
| 40 | //     this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); | 
|---|
| 41 | } | 
|---|
| 42 |  | 
|---|
| 43 | /** | 
|---|
| 44 | * create an environment out of a XML-element | 
|---|
| 45 | * @param root the XML-element to load the Environment from | 
|---|
| 46 | */ | 
|---|
| 47 | Environment::Environment(const TiXmlElement* root) | 
|---|
| 48 | { | 
|---|
| 49 | this->init(); | 
|---|
| 50 | if (root != NULL) | 
|---|
| 51 | this->loadParams(root); | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 | /** | 
|---|
| 55 | *  deletes an environment | 
|---|
| 56 | */ | 
|---|
| 57 | Environment::~Environment () | 
|---|
| 58 | {} | 
|---|
| 59 |  | 
|---|
| 60 | /** | 
|---|
| 61 | * initialize an Environment | 
|---|
| 62 | */ | 
|---|
| 63 | void Environment::init() | 
|---|
| 64 | { | 
|---|
| 65 | this->setClassID(CL_ENVIRONMENT, "Environment"); | 
|---|
| 66 | this->toList(OM_ENVIRON); | 
|---|
| 67 | } | 
|---|
| 68 |  | 
|---|
| 69 | /** | 
|---|
| 70 | * loads the Settings of an Environment from an XML-element. | 
|---|
| 71 | * @param root the XML-element to load the ELements properties from | 
|---|
| 72 | */ | 
|---|
| 73 | void Environment::loadParams(const TiXmlElement* root) | 
|---|
| 74 | { | 
|---|
| 75 | WorldEntity::loadParams(root); | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 | /** | 
|---|
| 80 | *  ticks the environment | 
|---|
| 81 | * @param time the time about which to tick | 
|---|
| 82 | */ | 
|---|
| 83 | void Environment::tick (float time) {} | 
|---|
| 84 |  | 
|---|
| 85 |  | 
|---|