Changeset 7221 in orxonox.OLD for trunk/src/lib/physics
- Timestamp:
- Mar 15, 2006, 3:10:45 PM (19 years ago)
- Location:
- trunk/src/lib/physics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/physics/physics_connection.cc
r7193 r7221 73 73 * @param subjectName the name of the Subject for this PhysicsConnection 74 74 */ 75 void PhysicsConnection::setSubject(const char*subjectName)75 void PhysicsConnection::setSubject(const std::string& subjectName) 76 76 { 77 77 this->subject = PhysicsEngine::getInstance()->getPhysicsInterfaceByName(subjectName); 78 78 if (this->subject == NULL) 79 79 { 80 PRINTF(2)("subject: (%s) not found for PhysicsConnection\n", subjectName );80 PRINTF(2)("subject: (%s) not found for PhysicsConnection\n", subjectName.c_str()); 81 81 } 82 82 else … … 87 87 * @param fieldName the Name of the Field for this connection 88 88 */ 89 void PhysicsConnection::setField(const char*fieldName)89 void PhysicsConnection::setField(const std::string& fieldName) 90 90 { 91 91 this->field = PhysicsEngine::getInstance()->getFieldByName(fieldName); 92 92 if (this->field == NULL) 93 93 { 94 PRINTF(2)("field: (%s) not found for PhysicsConnection\n", fieldName);94 PRINTF(2)("field: (%s) not found for PhysicsConnection\n", fieldName.c_str()); 95 95 } 96 96 else -
trunk/src/lib/physics/physics_connection.h
r5257 r7221 35 35 virtual ~PhysicsConnection(); 36 36 37 void setSubject(const char*subjectName);38 void setField(const char*fieldName);37 void setSubject(const std::string& subjectName); 38 void setField(const std::string& fieldName); 39 39 40 40 void apply() const; -
trunk/src/lib/physics/physics_engine.cc
r7193 r7221 128 128 @returns the PhysicsInterface if found, or NULL if not 129 129 */ 130 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const char*physicsInterfaceName) const130 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const 131 131 { 132 132 BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE); … … 157 157 158 158 /** 159 * @param FieldName the Name of the PhysicsInterface to search for159 * @param fieldName the Name of the PhysicsInterface to search for 160 160 @returns the Field if found, or NULL if not 161 161 */ 162 Field* PhysicsEngine::getFieldByName(const char* FieldName) const162 Field* PhysicsEngine::getFieldByName(const std::string& fieldName) const 163 163 { 164 164 list<Field*>::const_iterator field; 165 165 for (field = this->fields.begin(); field != this->fields.end(); field++) 166 if ( !strcmp(FieldName, (*field)->getName()))166 if (fieldName == (*field)->getName()) 167 167 return (*field); 168 168 return NULL; … … 197 197 @returns the PhysicsConnection if found, or NULL if not 198 198 */ 199 PhysicsConnection* PhysicsEngine::getPhysicsConnectionByName(const char*physicsConnectionName) const199 PhysicsConnection* PhysicsEngine::getPhysicsConnectionByName(const std::string& physicsConnectionName) const 200 200 { 201 201 list<PhysicsConnection*>::const_iterator pc; 202 202 for (pc = this->connections.begin(); pc != this->connections.end(); pc++) 203 if ( !strcmp(physicsConnectionName, (*pc)->getName()))203 if (physicsConnectionName == (*pc)->getName()) 204 204 delete (*pc); 205 205 return NULL; -
trunk/src/lib/physics/physics_engine.h
r6512 r7221 31 31 void loadConnections(const TiXmlElement* root); 32 32 33 PhysicsInterface* getPhysicsInterfaceByName(const char*physicsInterfaceName) const;33 PhysicsInterface* getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const; 34 34 35 35 void addField(Field* field); 36 36 void removeField(Field* field); 37 Field* getFieldByName(const char* FieldName) const;37 Field* getFieldByName(const std::string& fieldName) const; 38 38 39 39 void addConnection(PhysicsConnection* connection); 40 40 void removeConnection(PhysicsConnection* connection); 41 PhysicsConnection* getPhysicsConnectionByName(const char*physicsConnectionName) const;41 PhysicsConnection* getPhysicsConnectionByName(const std::string& physicsConnectionName) const; 42 42 43 43
Note: See TracChangeset
for help on using the changeset viewer.