Changeset 8490 in orxonox.OLD for trunk/src/world_entities/bsp_entity.cc
- Timestamp:
- Jun 15, 2006, 9:34:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/bsp_entity.cc
r8186 r8490 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Claudio Botta 13 13 co-programmer: ... 14 14 */ … … 17 17 #include "util/loading/resource_manager.h" 18 18 19 CREATE_FACTORY(B SPEntity, CL_BSP_ENTITY);19 CREATE_FACTORY(BspEntity, CL_BSP_ENTITY); 20 20 21 21 22 22 /** 23 * constructs and loads a B SPEntity from a XML-element23 * constructs and loads a BspEntity from a XML-element 24 24 * @param root the XML-element to load from 25 25 */ 26 B SPEntity::BSPEntity(const TiXmlElement* root)26 BspEntity::BspEntity(const TiXmlElement* root) 27 27 { 28 28 this->init(); 29 29 30 if (root != NULL) 30 31 this->loadParams(root); … … 35 36 * standard deconstructor 36 37 */ 37 B SPEntity::~BSPEntity ()38 BspEntity::~BspEntity () 38 39 { 39 40 if( this->bspManager) 41 delete this->bspManager; 40 42 } 41 43 42 void BSPEntity::setName(const std::string& name) 44 45 /** 46 * initializes the BspEntity 47 * @todo change this to what you wish 48 */ 49 void BspEntity::init() 43 50 { 44 printf("+++++++++++ LOADING NAME %s\n", name.c_str()); 51 this->setClassID(CL_BSP_ENTITY, "BspEntity"); 52 53 this->bspManager = new BspManager(this); 54 this->toList(OM_ENVIRON); 55 56 /** 57 * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition) 58 */ 59 } 60 61 62 void BspEntity::setName(const std::string& name) 63 { 64 PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str()); 45 65 46 66 this->bspManager->load(name.c_str(), 0.1f); … … 48 68 49 69 50 51 70 /** 52 * initializes the BSPEntity 53 * @todo change this to what you wish 54 */ 55 void BSPEntity::init() 56 { 57 this->bspManager = new BspManager(); 58 this->setClassID(CL_BSP_ENTITY, "BSPEntity"); 59 60 this->toList(OM_ENVIRON); 61 62 /** 63 * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition) 64 */ 65 66 } 67 68 69 /** 70 * loads a BSPEntity from a XML-element 71 * loads a BspEntity from a XML-element 71 72 * @param root the XML-element to load from 72 73 * @todo make the class Loadable 73 74 */ 74 void B SPEntity::loadParams(const TiXmlElement* root)75 void BspEntity::loadParams(const TiXmlElement* root) 75 76 { 76 77 // all the clases this Entity is directly derived from must be called in this way, to load all settings. 77 78 // WorldEntity::loadParam(root); 78 79 79 LoadParam(root, "Name", this, B SPEntity, setName)80 LoadParam(root, "Name", this, BspEntity, setName) 80 81 .describe("Sets the of the BSP file."); 81 82 … … 91 92 92 93 /** 93 * advances the B SPEntity about time seconds94 * advances the BspEntity about time seconds 94 95 * @param time the Time to step 95 96 */ 96 void B SPEntity::tick(float time)97 void BspEntity::tick(float time) 97 98 { 98 99 this->bspManager->tick(time); 99 100 } 100 101 … … 103 104 * draws this worldEntity 104 105 */ 105 void B SPEntity::draw () const106 void BspEntity::draw () const 106 107 { 107 108 this->bspManager->draw(); … … 113 114 * 114 115 */ 115 void B SPEntity::collidesWith (WorldEntity* entity, const Vector& location)116 void BspEntity::collidesWith (WorldEntity* entity, const Vector& location) 116 117 { 117 118
Note: See TracChangeset
for help on using the changeset viewer.