Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/lib/physics


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

Location:
trunk/src/lib/physics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/physics/physics_connection.cc

    r7193 r7221  
    7373 * @param subjectName the name of the Subject for this PhysicsConnection
    7474*/
    75 void PhysicsConnection::setSubject(const char* subjectName)
     75void PhysicsConnection::setSubject(const std::string& subjectName)
    7676{
    7777  this->subject = PhysicsEngine::getInstance()->getPhysicsInterfaceByName(subjectName);
    7878  if (this->subject == NULL)
    7979  {
    80     PRINTF(2)("subject: (%s) not found for PhysicsConnection\n", subjectName);
     80    PRINTF(2)("subject: (%s) not found for PhysicsConnection\n", subjectName.c_str());
    8181  }
    8282  else
     
    8787* @param fieldName the Name of the Field for this connection
    8888*/
    89 void PhysicsConnection::setField(const char* fieldName)
     89void PhysicsConnection::setField(const std::string& fieldName)
    9090{
    9191  this->field = PhysicsEngine::getInstance()->getFieldByName(fieldName);
    9292  if (this->field == NULL)
    9393  {
    94         PRINTF(2)("field: (%s) not found for PhysicsConnection\n", fieldName);
     94    PRINTF(2)("field: (%s) not found for PhysicsConnection\n", fieldName.c_str());
    9595  }
    9696  else
  • trunk/src/lib/physics/physics_connection.h

    r5257 r7221  
    3535  virtual ~PhysicsConnection();
    3636
    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);
    3939
    4040  void apply() const;
  • trunk/src/lib/physics/physics_engine.cc

    r7193 r7221  
    128128  @returns the PhysicsInterface if found, or NULL if not
    129129 */
    130 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const char* physicsInterfaceName) const
     130PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const
    131131{
    132132  BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE);
     
    157157
    158158/**
    159 * @param FieldName the Name of the PhysicsInterface to search for
     159* @param fieldName the Name of the PhysicsInterface to search for
    160160  @returns the Field if found, or NULL if not
    161161 */
    162 Field* PhysicsEngine::getFieldByName(const char* FieldName) const
     162Field* PhysicsEngine::getFieldByName(const std::string& fieldName) const
    163163{
    164164  list<Field*>::const_iterator field;
    165165  for (field = this->fields.begin(); field != this->fields.end(); field++)
    166     if (!strcmp(FieldName, (*field)->getName()))
     166    if (fieldName == (*field)->getName())
    167167      return (*field);
    168168  return NULL;
     
    197197  @returns the PhysicsConnection if found, or NULL if not
    198198 */
    199 PhysicsConnection* PhysicsEngine::getPhysicsConnectionByName(const char* physicsConnectionName) const
     199PhysicsConnection* PhysicsEngine::getPhysicsConnectionByName(const std::string& physicsConnectionName) const
    200200{
    201201  list<PhysicsConnection*>::const_iterator pc;
    202202  for (pc = this->connections.begin(); pc != this->connections.end(); pc++)
    203     if (!strcmp(physicsConnectionName, (*pc)->getName()))
     203    if (physicsConnectionName == (*pc)->getName())
    204204      delete (*pc);
    205205  return NULL;
  • trunk/src/lib/physics/physics_engine.h

    r6512 r7221  
    3131  void loadConnections(const TiXmlElement* root);
    3232
    33   PhysicsInterface*      getPhysicsInterfaceByName(const char* physicsInterfaceName) const;
     33  PhysicsInterface*      getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const;
    3434
    3535  void                   addField(Field* field);
    3636  void                   removeField(Field* field);
    37   Field*                 getFieldByName(const char* FieldName) const;
     37  Field*                 getFieldByName(const std::string& fieldName) const;
    3838
    3939  void                   addConnection(PhysicsConnection* connection);
    4040  void                   removeConnection(PhysicsConnection* connection);
    41   PhysicsConnection*     getPhysicsConnectionByName(const char* physicsConnectionName) const;
     41  PhysicsConnection*     getPhysicsConnectionByName(const std::string& physicsConnectionName) const;
    4242
    4343
Note: See TracChangeset for help on using the changeset viewer.