Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5498 in orxonox.OLD for trunk/src/world_entities/world_entity.cc


Ignore:
Timestamp:
Nov 7, 2005, 10:43:22 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: redocumented the WorldEntity and Weapon classes

File:
1 edited

Legend:

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

    r5482 r5498  
    3535/**
    3636 *  Loads the WordEntity-specific Part of any derived Class
    37 */
     37 *
     38 * @param root: Normally NULL, as the Derived Entities define a loadParams Function themeselves,
     39 *              that can calls WorldEntities loadParams for itself.
     40 */
    3841WorldEntity::WorldEntity(const TiXmlElement* root)
    3942{
     
    5457WorldEntity::~WorldEntity ()
    5558{
    56   // if( collisioncluster != NULL) delete collisioncluster;
     59  // Delete the model (unregister it with the ResourceManager)
    5760  if (likely(this->model != NULL))
    5861    ResourceManager::getInstance()->unload(this->model);
     62  // Delete the obbTree
    5963  if( this->obbTree != NULL)
    6064    delete this->obbTree;
    6165}
    6266
     67/**
     68 * loads the WorldEntity Specific Parameters.
     69 * @param root: the XML-Element to load the Data From
     70 */
    6371void WorldEntity::loadParams(const TiXmlElement* root)
    6472{
     73  // Do the PNode loading stuff
    6574  static_cast<PNode*>(this)->loadParams(root);
     75
    6676  // Model Loading
    6777  LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel)
     
    7787 * @param fileName the name of the model to load
    7888 * @param scaling the Scaling of the model
     89 *
     90 * @todo fix this, so it only has one loadModel-Function.
    7991*/
    8092void WorldEntity::loadModelWithScale(const char* fileName, float scaling)
     
    126138 * these attributes don't have to be set, only use them, if you need them
    127139*/
    128 void WorldEntity::setCharacterAttributes(CharacterAttributes* charAttr)
    129 {}
    130 
    131 
    132 /**
    133  * gets the Character attributes of this worldentity
    134  * @returns character attributes
    135 */
    136 CharacterAttributes* WorldEntity::getCharacterAttributes()
    137 {}
     140//void WorldEntity::setCharacterAttributes(CharacterAttributes* charAttr)
     141//{}
    138142
    139143
     
    146150void WorldEntity::collidesWith(WorldEntity* entity, const Vector& location)
    147151{
     152  /**
     153   * THIS IS A DEFAULT COLLISION-Effect.
     154   * IF YOU WANT TO CREATE A SPECIFIC COLLISION ON EACH OBJECT
     155   * USE::
     156   * if (entity->isA(CL_WHAT_YOU_ARE_LOOKING_FOR)) { printf "dothings"; };
     157   *
     158   * You can always define a default Action.... don't be affraid just test it :)
     159   */
    148160//  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
    149161}
    150162
    151 /**
    152  *  this function is called, when the ship is hit by a waepon
    153  * @param weapon: the laser/rocket/shoot that hits.
    154  * @param loc: place where it is hit
    155  *
    156  * calculate the damage depending
    157 */
    158 void WorldEntity::hit(WorldEntity* weapon, Vector* loc) {}
    159 
    160 
    161 /**
    162  *  this is called immediately after the Entity has been constructed and initialized
    163  *
    164  * Put any initialisation code that requires knowledge of location (placement if the Entity is free) and owner of the entity here.
    165  * DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
    166 */
     163
     164/**
     165 *  this is called immediately after the Entity has been constructed, initialized and then Spawned into the World
     166 *
     167 */
    167168void WorldEntity::postSpawn ()
    168169{
     
    175176 * For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
    176177 * place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
    177 */
     178 *
     179 * NOT YET IMPLEMENTED
     180 */
    178181void WorldEntity::leftWorld ()
    179182{
     
    190193{
    191194}
     195
    192196
    193197/**
     
    216220}
    217221
    218 
     222/**
     223 * DEBUG-DRAW OF THE BV-Tree.
     224 * @param depth What depth to draw
     225 * @param drawMode the mode to draw this entity under
     226 */
    219227void WorldEntity::drawBVTree(unsigned int depth, int drawMode)
    220228{
Note: See TracChangeset for help on using the changeset viewer.