Changeset 8081 in orxonox.OLD for branches/bsp_model/src/world_entities/bsp_entity.cc
- Timestamp:
- Jun 1, 2006, 4:42:01 PM (19 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/world_entities/bsp_entity.cc
r7540 r8081 14 14 */ 15 15 16 #include " proto_world_entity.h"17 16 #include "bsp_entity.h" 17 #include "util/loading/resource_manager.h" 18 18 using namespace std; 19 19 20 20 CREATE_FACTORY(BSPEntity, CL_BSP_ENTITY); 21 21 /** 22 * constructs and loads a ProtoWorldEntity from a XML-element22 * constructs and loads a BSPEntity from a XML-element 23 23 * @param root the XML-element to load from 24 24 */ 25 ProtoWorldEntity::ProtoWorldEntity(const TiXmlElement* root)25 BSPEntity::BSPEntity(const TiXmlElement* root) 26 26 { 27 27 this->init(); … … 34 34 * standard deconstructor 35 35 */ 36 ProtoWorldEntity::~ProtoWorldEntity ()36 BSPEntity::~BSPEntity () 37 37 { 38 38 39 39 } 40 40 41 void BSPEntity::setName(const std::string& name) 42 { 43 printf("+++++++++++ LOADING NAME %s\n", name.c_str()); 44 45 this->bspManager->load(name.c_str(), 0.1f); 46 } 47 48 41 49 42 50 /** 43 * initializes the ProtoWorldEntity51 * initializes the BSPEntity 44 52 * @todo change this to what you wish 45 53 */ 46 void ProtoWorldEntity::init()54 void BSPEntity::init() 47 55 { 48 this->setClassID(CL_PROTO_WORLD_ENTITY, "ProtoWorldEntity"); 56 this->bspManager = new BspManager(); 57 this->setClassID(CL_BSP_ENTITY, "BSPEntity"); 49 58 59 this->toList(OM_ENVIRON); 60 50 61 /** 51 * @todo: Write CL_ PROTO_WORLD_ENTITY INTO THE src/defs/class_id.h (your own definition)62 * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition) 52 63 */ 53 64 … … 56 67 57 68 /** 58 * loads a ProtoWorldEntity from a XML-element69 * loads a BSPEntity from a XML-element 59 70 * @param root the XML-element to load from 60 71 * @todo make the class Loadable 61 72 */ 62 void ProtoWorldEntity::loadParams(const TiXmlElement* root)73 void BSPEntity::loadParams(const TiXmlElement* root) 63 74 { 64 75 // all the clases this Entity is directly derived from must be called in this way, to load all settings. 65 WorldEntity::loadParam(root); 76 // WorldEntity::loadParam(root); 77 78 LoadParam(root, "Name", this, BSPEntity, setName) 79 .describe("Sets the of the BSP file."); 66 80 81 /* LoadParam(root, "Scale", this, BSpEntity, setScale) 82 .describe("Sets the scale factore of the bsp level."); 83 */ 67 84 68 85 /** … … 73 90 74 91 /** 75 * advances the ProtoWorldEntity about time seconds92 * advances the BSPEntity about time seconds 76 93 * @param time the Time to step 77 94 */ 78 ProtoWorldEntity::tick(float time)95 void BSPEntity::tick(float time) 79 96 { 80 97 81 98 } 82 99 100 83 101 /** 84 102 * draws this worldEntity 85 103 */ 86 void ProtoWorldEntity::draw () const104 void BSPEntity::draw () const 87 105 { 88 glMatrixMode(GL_MODELVIEW); 89 glPushMatrix(); 90 float matrix[4][4]; 91 92 /* translate */ 93 glTranslatef (this->getAbsCoor ().x, 94 this->getAbsCoor ().y, 95 this->getAbsCoor ().z); 96 /* rotate */ 97 this->getAbsDir().matrix(matrix); 98 glMultMatrixf((float*)matrix); 99 100 if (model) 101 model->draw(); 102 glPopMatrix(); 106 this->bspManager->draw(); 103 107 } 104 108 … … 108 112 * 109 113 */ 110 void ProtoWorldEntity::collidesWith (WorldEntity* entity, const Vector& location)114 void BSPEntity::collidesWith (WorldEntity* entity, const Vector& location) 111 115 { 112 116
Note: See TracChangeset
for help on using the changeset viewer.