Changeset 5217 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Sep 22, 2005, 5:06:55 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/model.cc
r5216 r5217 107 107 delete this->firstFace; 108 108 109 // deleting the glList 110 if (this->listNumber != 0) 111 glDeleteLists(this->listNumber, 1); 112 109 113 if (this->next !=NULL) 110 114 delete this->next; 111 115 112 // if (this->listNumber != 0)113 // glDeleteLists(this->listNumber, 1);114 116 } 115 117 -
trunk/src/lib/physics/physics_engine.cc
r5216 r5217 18 18 #include "physics_engine.h" 19 19 20 #include "class_list.h" 20 21 #include "list.h" 21 22 #include "tinyxml.h" … … 34 35 this->setName("PhysicsEngine"); 35 36 this->connections = new tList<PhysicsConnection>; 36 this->interfaces = new tList<PhysicsInterface>;37 37 this->fields = new tList<Field>; 38 this->interfaces = NULL; 38 39 } 39 40 … … 70 71 // } 71 72 // delete itPI; 72 delete this->interfaces;73 73 // 74 74 // // delete all PhysicsFields, still in existence (this could be dangerous) … … 133 133 134 134 /** 135 * adds a PhysicsInterface to the list of handeled physicsInterfaces136 * @param physicsInterface the interface to add137 138 this is normally done in the constructor of any PhysicsInterface139 */140 void PhysicsEngine::addPhysicsInterface(PhysicsInterface* physicsInterface)141 {142 this->interfaces->add(physicsInterface);143 }144 145 /**146 * removes a PhysicsInterface from the list of handeled physicsInterfaces147 * @param physicsInterface the interface to remove148 149 this is normally done in the destructor of any PhysicsInterface150 */151 void PhysicsEngine::removePhysicsInterface(PhysicsInterface* physicsInterface)152 {153 this->interfaces->remove(physicsInterface);154 }155 156 /**157 135 * @param physicsInterfaceName the Name of the PhysicsInterface to search for 158 136 @returns the PhysicsInterface if found, or NULL if not … … 160 138 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const char* physicsInterfaceName) const 161 139 { 162 tIterator< PhysicsInterface>* tmpIt = interfaces->getIterator();163 PhysicsInterface* tmpInt = tmpIt->firstElement();140 tIterator<BaseObject>* tmpIt = ClassList::getList(CL_PHYSICS_INTERFACE)->getIterator(); 141 BaseObject* tmpInt = tmpIt->firstElement(); 164 142 while(tmpInt) 165 143 { … … 167 145 { 168 146 delete tmpIt; 169 return tmpInt;147 return dynamic_cast<PhysicsInterface*>(tmpInt); 170 148 } 171 149 tmpInt = tmpIt->nextElement(); … … 286 264 287 265 /* actually tick all the PhysicsInterfaces. Move the objects around */ 288 tIterator<PhysicsInterface>* itPI = this->interfaces->getIterator(); 289 PhysicsInterface* enumPI = itPI->firstElement(); 290 while (enumPI) 291 { 292 enumPI->tickPhys(dt); 293 294 enumPI = itPI->nextElement(); 295 } 296 delete itPI; 266 if (this->interfaces != NULL || (this->interfaces = ClassList::getList(CL_PHYSICS_INTERFACE)) != NULL) 267 { 268 tIterator<BaseObject>* itPI = this->interfaces->getIterator(); 269 PhysicsInterface* enumPI = dynamic_cast<PhysicsInterface*>(itPI->firstElement()); 270 while (enumPI) 271 { 272 enumPI->tickPhys(dt); 273 274 enumPI = dynamic_cast<PhysicsInterface*>(itPI->nextElement()); 275 } 276 delete itPI; 277 } 297 278 } 298 279 … … 308 289 PRINT(0)("====================================\n"); 309 290 PRINT(0)(" reference: %p\n", this); 310 PRINT(0)(" number of Interfaces: %d\n", this->interfaces->getSize()); 291 if (this->interfaces != NULL) 292 PRINT(0)(" number of Interfaces: %d\n", this->interfaces->getSize()); 311 293 PRINT(0)(" number of Fields: %d\n", this->fields->getSize()); 312 294 PRINT(0)(" number of Connections: %d\n", this->connections->getSize()); -
trunk/src/lib/physics/physics_engine.h
r5039 r5217 30 30 void loadConnections(const TiXmlElement* root); 31 31 32 void addPhysicsInterface(PhysicsInterface* physicsInterface);33 void removePhysicsInterface(PhysicsInterface* physicsInterface);34 32 PhysicsInterface* getPhysicsInterfaceByName(const char* physicsInterfaceName) const; 35 33 … … 53 51 static PhysicsEngine* singletonRef; //!< the singleton reference of the PhysicsEngine 54 52 55 tList<PhysicsInterface>* interfaces; //!< a list of physically based objects56 53 tList<Field>* fields; //!< a list of physicsl fields. 57 tList<PhysicsConnection>* connections; //!< a list of physical connections 54 tList<PhysicsConnection>* connections; //!< a list of physical connections. 55 const tList<BaseObject>* interfaces; //!< The list of physical interfaces. 58 56 }; 59 57 -
trunk/src/lib/physics/physics_interface.cc
r5115 r5217 45 45 this->bForceApplied = false; 46 46 47 PhysicsEngine::getInstance()->addPhysicsInterface(this);47 // PhysicsEngine::getInstance()->addPhysicsInterface(this); 48 48 } 49 49 … … 53 53 PhysicsInterface::~PhysicsInterface () 54 54 { 55 PhysicsEngine::getInstance()->removePhysicsInterface(this);55 // PhysicsEngine::getInstance()->removePhysicsInterface(this); 56 56 } 57 57
Note: See TracChangeset
for help on using the changeset viewer.