Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 2:36:54 PM (18 years ago)
Author:
bensch
Message:

new_class_id: many more classes done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/physics/physics_engine.cc

    r9406 r9686  
    1818#include "physics_engine.h"
    1919
    20 #include "class_list.h"
    2120#include "parser/tinyxml/tinyxml.h"
    2221#include "util/loading/factory.h"
     
    2524
    2625
    27 
    28 /**
    29  * standard constructor
    30 */
     26NewObjectListDefinition(PhysicsEngine);
     27/**
     28 * @brief standard constructor
     29 */
    3130PhysicsEngine::PhysicsEngine()
    3231{
    33   this->setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine");
     32  this->registerObject(this, PhysicsEngine::_objectList);
    3433  this->setName("PhysicsEngine");
    3534  this->interfaces = NULL;
     
    130129PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const
    131130{
    132   BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE);
    133   return (interface != NULL)?  dynamic_cast<PhysicsInterface*>(interface) : NULL;
     131  return PhysicsInterface::objectList().getObject(physicsInterfaceName);
    134132}
    135133
     
    223221
    224222  /* actually tick all the PhysicsInterfaces. Move the objects around */
    225   if (this->interfaces != NULL || (this->interfaces = ClassList::getList(CL_PHYSICS_INTERFACE)) != NULL)
    226   {
    227     std::list<BaseObject*>::const_iterator tickPhys;
    228     for (tickPhys = this->interfaces->begin(); tickPhys != this->interfaces->end(); tickPhys++)
    229       dynamic_cast<PhysicsInterface*>(*tickPhys)->tickPhys(dt);
    230   }
     223
     224  NewObjectList<PhysicsInterface>::const_iterator it;
     225  for (it = PhysicsInterface::objectList().begin();
     226       it != PhysicsInterface::objectList().end();
     227       ++it)
     228      (*it)->tickPhys(dt);
    231229}
    232230
Note: See TracChangeset for help on using the changeset viewer.