| 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 "objModel.h" | 
|---|
| 23 | #include "obb_tree.h" | 
|---|
| 24 | #include "util/loading/factory.h" | 
|---|
| 25 |  | 
|---|
| 26 | #include "class_id_DEPRECATED.h" | 
|---|
| 27 | ObjectListDefinitionID(Environment, CL_ENVIRONMENT); | 
|---|
| 28 | CREATE_FACTORY(Environment); | 
|---|
| 29 |  | 
|---|
| 30 | /** | 
|---|
| 31 | *  creates an environment | 
|---|
| 32 | */ | 
|---|
| 33 | Environment::Environment () : WorldEntity() | 
|---|
| 34 | { | 
|---|
| 35 | this->init(); | 
|---|
| 36 | this->loadModel("models/ships/bolido.obj"); | 
|---|
| 37 | //   if(this->obbTree == NULL) | 
|---|
| 38 | //     this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); | 
|---|
| 39 | } | 
|---|
| 40 |  | 
|---|
| 41 | /** | 
|---|
| 42 | * create an environment out of a XML-element | 
|---|
| 43 | * @param root the XML-element to load the Environment from | 
|---|
| 44 | */ | 
|---|
| 45 | Environment::Environment(const TiXmlElement* root) | 
|---|
| 46 | { | 
|---|
| 47 | this->init(); | 
|---|
| 48 | if (root != NULL) | 
|---|
| 49 | this->loadParams(root); | 
|---|
| 50 | } | 
|---|
| 51 |  | 
|---|
| 52 | /** | 
|---|
| 53 | *  deletes an environment | 
|---|
| 54 | */ | 
|---|
| 55 | Environment::~Environment () | 
|---|
| 56 | {} | 
|---|
| 57 |  | 
|---|
| 58 | /** | 
|---|
| 59 | * initialize an Environment | 
|---|
| 60 | */ | 
|---|
| 61 | void Environment::init() | 
|---|
| 62 | { | 
|---|
| 63 | this->registerObject(this, Environment::_objectList); | 
|---|
| 64 | this->toList(OM_ENVIRON); | 
|---|
| 65 | } | 
|---|
| 66 |  | 
|---|
| 67 | /** | 
|---|
| 68 | * loads the Settings of an Environment from an XML-element. | 
|---|
| 69 | * @param root the XML-element to load the ELements properties from | 
|---|
| 70 | */ | 
|---|
| 71 | void Environment::loadParams(const TiXmlElement* root) | 
|---|
| 72 | { | 
|---|
| 73 | WorldEntity::loadParams(root); | 
|---|
| 74 | } | 
|---|
| 75 |  | 
|---|
| 76 |  | 
|---|
| 77 | /** | 
|---|
| 78 | *  ticks the environment | 
|---|
| 79 | * @param time the time about which to tick | 
|---|
| 80 | */ | 
|---|
| 81 | void Environment::tick (float time) {} | 
|---|
| 82 |  | 
|---|
| 83 |  | 
|---|