Changeset 5498 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Nov 7, 2005, 10:43:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r5482 r5498 35 35 /** 36 36 * 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 */ 38 41 WorldEntity::WorldEntity(const TiXmlElement* root) 39 42 { … … 54 57 WorldEntity::~WorldEntity () 55 58 { 56 // if( collisioncluster != NULL) delete collisioncluster;59 // Delete the model (unregister it with the ResourceManager) 57 60 if (likely(this->model != NULL)) 58 61 ResourceManager::getInstance()->unload(this->model); 62 // Delete the obbTree 59 63 if( this->obbTree != NULL) 60 64 delete this->obbTree; 61 65 } 62 66 67 /** 68 * loads the WorldEntity Specific Parameters. 69 * @param root: the XML-Element to load the Data From 70 */ 63 71 void WorldEntity::loadParams(const TiXmlElement* root) 64 72 { 73 // Do the PNode loading stuff 65 74 static_cast<PNode*>(this)->loadParams(root); 75 66 76 // Model Loading 67 77 LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel) … … 77 87 * @param fileName the name of the model to load 78 88 * @param scaling the Scaling of the model 89 * 90 * @todo fix this, so it only has one loadModel-Function. 79 91 */ 80 92 void WorldEntity::loadModelWithScale(const char* fileName, float scaling) … … 126 138 * these attributes don't have to be set, only use them, if you need them 127 139 */ 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 //{} 138 142 139 143 … … 146 150 void WorldEntity::collidesWith(WorldEntity* entity, const Vector& location) 147 151 { 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 */ 148 160 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z); 149 161 } 150 162 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 */ 167 168 void WorldEntity::postSpawn () 168 169 { … … 175 176 * For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a 176 177 * 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 */ 178 181 void WorldEntity::leftWorld () 179 182 { … … 190 193 { 191 194 } 195 192 196 193 197 /** … … 216 220 } 217 221 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 */ 219 227 void WorldEntity::drawBVTree(unsigned int depth, int drawMode) 220 228 {
Note: See TracChangeset
for help on using the changeset viewer.