/* 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: ... co-programmer: ... */ #include "bsp_entity.h" #include "util/loading/resource_manager.h" CREATE_FACTORY(BSPEntity, CL_BSP_ENTITY); /** * constructs and loads a BSPEntity from a XML-element * @param root the XML-element to load from */ BSPEntity::BSPEntity(const TiXmlElement* root) { this->init(); if (root != NULL) this->loadParams(root); } /** * standard deconstructor */ BSPEntity::~BSPEntity () { } void BSPEntity::setName(const std::string& name) { printf("+++++++++++ LOADING NAME %s\n", name.c_str()); this->bspManager->load(name.c_str(), 0.1f); } /** * initializes the BSPEntity * @todo change this to what you wish */ void BSPEntity::init() { this->bspManager = new BspManager(); this->setClassID(CL_BSP_ENTITY, "BSPEntity"); this->toList(OM_ENVIRON); /** * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition) */ } /** * loads a BSPEntity from a XML-element * @param root the XML-element to load from * @todo make the class Loadable */ void BSPEntity::loadParams(const TiXmlElement* root) { // all the clases this Entity is directly derived from must be called in this way, to load all settings. // WorldEntity::loadParam(root); LoadParam(root, "Name", this, BSPEntity, setName) .describe("Sets the of the BSP file."); /* LoadParam(root, "Scale", this, BSpEntity, setScale) .describe("Sets the scale factore of the bsp level."); */ /** * @todo: make the class Loadable */ } /** * advances the BSPEntity about time seconds * @param time the Time to step */ void BSPEntity::tick(float time) { } /** * draws this worldEntity */ void BSPEntity::draw () const { this->bspManager->draw(); } /** * * */ void BSPEntity::collidesWith (WorldEntity* entity, const Vector& location) { }