Changeset 4728 in orxonox.OLD for orxonox/trunk/src/lib/physics/physics_engine.cc
- Timestamp:
- Jun 28, 2005, 11:56:46 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/physics_engine.cc
r4597 r4728 21 21 22 22 #include "list.h" 23 #include "game_loader.h" 24 #include "tinyxml.h" 23 25 24 26 using namespace std; … … 51 53 } 52 54 55 /** 56 \param root the XML-element to load settings from 57 */ 58 void loadParams(const TiXmlElement* root) 59 { 60 const TiXmlElement* element; 61 62 PRINTF(4)("Loading Physical Fields\n"); 63 element = root->FirstChildElement("Fields"); 64 { 65 element = element->FirstChildElement(); 66 GameLoader::getInstance()->fabricate(element); 67 68 element = element->NextSiblingElement(); 69 } 70 71 PRINTF(4)("Loading Physical Connections\n"); 72 element = root->FirstChildElement("PhysicsConnections"); 73 { 74 element = element->FirstChildElement(); 75 GameLoader::getInstance()->fabricate(element); 76 77 element = element->NextSiblingElement(); 78 } 79 80 } 81 82 83 53 84 54 85 /** … … 75 106 76 107 /** 108 \param physicsInterfaceName the Name of the PhysicsInterface to search for 109 \returns the PhysicsInterface if found, or NULL if not 110 */ 111 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const char* physicsInterfaceName) const 112 { 113 tIterator<PhysicsInterface>* tmpIt = interfaces->getIterator(); 114 PhysicsInterface* tmpInt = tmpIt->nextElement(); 115 while(tmpInt) 116 { 117 if (!strcmp(physicsInterfaceName, tmpInt->getName())) 118 { 119 delete tmpIt; 120 return tmpInt; 121 } 122 tmpInt = tmpIt->nextElement(); 123 } 124 delete tmpIt; 125 return NULL; 126 } 127 128 /** 77 129 \brief adds a Field to the list of handeled fields 78 130 \param field the field to add … … 97 149 98 150 /** 151 \param FieldName the Name of the PhysicsInterface to search for 152 \returns the Field if found, or NULL if not 153 */ 154 Field* PhysicsEngine::getFieldByName(const char* FieldName) const 155 { 156 tIterator<Field>* tmpIt = fields->getIterator(); 157 Field* tmpField = tmpIt->nextElement(); 158 while(tmpField) 159 { 160 if (!strcmp(FieldName, tmpField->getName())) 161 { 162 delete tmpIt; 163 return tmpField; 164 } 165 tmpField = tmpIt->nextElement(); 166 } 167 delete tmpIt; 168 return NULL; 169 } 170 171 172 173 /** 99 174 \brief adds A Physical Connection to the List of Connections 100 175 \param connection the Connection to add … … 118 193 } 119 194 120 195 /** 196 \param physicsConnectionName the Name of the PhysicsInterface to search for 197 \returns the PhysicsConnection if found, or NULL if not 198 */ 199 PhysicsConnection* PhysicsEngine::getPhysicsConnectionByName(const char* physicsConnectionName) const 200 { 201 tIterator<PhysicsConnection>* tmpIt = connections->getIterator(); 202 PhysicsConnection* tmpConn = tmpIt->nextElement(); 203 while(tmpConn) 204 { 205 if (!strcmp(physicsConnectionName, tmpConn->getName())) 206 { 207 delete tmpIt; 208 return tmpConn; 209 } 210 tmpConn = tmpIt->nextElement(); 211 } 212 delete tmpIt; 213 return NULL; 214 } 121 215 122 216
Note: See TracChangeset
for help on using the changeset viewer.