Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8490 in orxonox.OLD for trunk/src/world_entities/bsp_entity.cc


Ignore:
Timestamp:
Jun 15, 2006, 9:34:48 PM (18 years ago)
Author:
patrick
Message:

merged the bsp branche back to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/bsp_entity.cc

    r8186 r8490  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Claudio Botta
    1313   co-programmer: ...
    1414*/
     
    1717#include "util/loading/resource_manager.h"
    1818
    19 CREATE_FACTORY(BSPEntity, CL_BSP_ENTITY);
     19CREATE_FACTORY(BspEntity, CL_BSP_ENTITY);
    2020
    2121
    2222/**
    23  * constructs and loads a BSPEntity from a XML-element
     23 * constructs and loads a BspEntity from a XML-element
    2424 * @param root the XML-element to load from
    2525 */
    26 BSPEntity::BSPEntity(const TiXmlElement* root)
     26BspEntity::BspEntity(const TiXmlElement* root)
    2727{
    2828  this->init();
     29
    2930  if (root != NULL)
    3031    this->loadParams(root);
     
    3536 * standard deconstructor
    3637 */
    37 BSPEntity::~BSPEntity ()
     38BspEntity::~BspEntity ()
    3839{
    39 
     40  if( this->bspManager)
     41    delete this->bspManager;
    4042}
    4143
    42 void BSPEntity::setName(const std::string& name)
     44
     45/**
     46 * initializes the BspEntity
     47 * @todo change this to what you wish
     48 */
     49void BspEntity::init()
    4350{
    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
     62void BspEntity::setName(const std::string& name)
     63{
     64  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
    4565
    4666  this->bspManager->load(name.c_str(), 0.1f);
     
    4868
    4969
    50 
    5170/**
    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
    7172 * @param root the XML-element to load from
    7273 * @todo make the class Loadable
    7374 */
    74 void BSPEntity::loadParams(const TiXmlElement* root)
     75void BspEntity::loadParams(const TiXmlElement* root)
    7576{
    7677  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
    7778 // WorldEntity::loadParam(root);
    7879
    79   LoadParam(root, "Name", this, BSPEntity, setName)
     80  LoadParam(root, "Name", this, BspEntity, setName)
    8081      .describe("Sets the of the BSP file.");
    8182
     
    9192
    9293/**
    93  * advances the BSPEntity about time seconds
     94 * advances the BspEntity about time seconds
    9495 * @param time the Time to step
    9596 */
    96 void BSPEntity::tick(float time)
     97void BspEntity::tick(float time)
    9798{
    98 
     99  this->bspManager->tick(time);
    99100}
    100101
     
    103104 * draws this worldEntity
    104105 */
    105 void BSPEntity::draw () const
     106void BspEntity::draw () const
    106107{
    107108  this->bspManager->draw();
     
    113114 *
    114115 */
    115 void BSPEntity::collidesWith (WorldEntity* entity, const Vector& location)
     116void BspEntity::collidesWith (WorldEntity* entity, const Vector& location)
    116117{
    117118
Note: See TracChangeset for help on using the changeset viewer.