Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 23, 2005, 11:07:40 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: changed the behaviour of the iterator.
Now it is soon possible to walk through a List from front and back, and tell the Iterator from where to seek

@patrick: i had to disable your Collision-Detection algorithms, because they had a seekElement inside, that i did not entirely grasp the meaning of….
trying to fix this now

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

Legend:

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

    r4836 r5110  
    5252{
    5353  // delete all PhysicsConnections that are still in existence
    54   tIterator<PhysicsConnection>* itPC = this->connections->getIterator();
    55   PhysicsConnection* enumPC = itPC->nextElement();
    56   while (enumPC)
    57   {
    58     delete enumPC;
    59     enumPC = itPC->nextElement();
    60   }
    61   delete itPC;
    62   delete this->connections;
    63 
    64   // delete all PhysicsInterfaces, still in existence (this could be dangerous)
    65   tIterator<PhysicsInterface>* itPI = this->interfaces->getIterator();
    66   PhysicsInterface* enumPI = itPI->nextElement();
    67   while (enumPI)
    68   {
    69     delete enumPI;
    70 
    71     enumPI = itPI->nextElement();
    72   }
    73   delete itPI;
    74   delete this->interfaces;
    75 
    76   // delete all PhysicsFields, still in existence (this could be dangerous)
    77   tIterator<Field>* itF = this->fields->getIterator();
    78   Field* enumF = itF->nextElement();
    79   while (enumF)
    80   {
    81     delete enumF;
    82 
    83     enumF = itF->nextElement();
    84   }
    85   delete itF;
    86   delete this->fields;
     54//   tIterator<PhysicsConnection>* itPC = this->connections->getIterator();
     55//   PhysicsConnection* enumPC = itPC->firstElement();
     56//   while (enumPC)
     57//   {
     58//     delete enumPC;
     59//     enumPC = itPC->nextElement();
     60//   }
     61//   delete itPC;
     62//   delete this->connections;
     63//
     64//   // delete all PhysicsInterfaces, still in existence (this could be dangerous)
     65//   tIterator<PhysicsInterface>* itPI = this->interfaces->getIterator();
     66//   PhysicsInterface* enumPI = itPI->firstElement();
     67//   while (enumPI)
     68//   {
     69//     delete enumPI;
     70//
     71//     enumPI = itPI->nextElement();
     72//   }
     73//   delete itPI;
     74//   delete this->interfaces;
     75//
     76//   // delete all PhysicsFields, still in existence (this could be dangerous)
     77//   tIterator<Field>* itF = this->fields->getIterator();
     78//   Field* enumF = itF->firstElement();
     79//   while (enumF)
     80//   {
     81//     delete enumF;
     82//
     83//     enumF = itF->nextElement();
     84//   }
     85//   delete itF;
     86//   delete this->fields;
    8787
    8888
     
    163163{
    164164  tIterator<PhysicsInterface>* tmpIt = interfaces->getIterator();
    165   PhysicsInterface* tmpInt = tmpIt->nextElement();
     165  PhysicsInterface* tmpInt = tmpIt->firstElement();
    166166  while(tmpInt)
    167167  {
     
    206206{
    207207  tIterator<Field>* tmpIt = fields->getIterator();
    208   Field* tmpField = tmpIt->nextElement();
     208  Field* tmpField = tmpIt->firstElement();
    209209  while(tmpField)
    210210  {
     
    251251{
    252252  tIterator<PhysicsConnection>* tmpIt = connections->getIterator();
    253   PhysicsConnection* tmpConn = tmpIt->nextElement();
     253  PhysicsConnection* tmpConn = tmpIt->firstElement();
    254254  while(tmpConn)
    255255  {
     
    278278  meaning let the fields work */
    279279  tIterator<PhysicsConnection>* itPC = this->connections->getIterator();
    280   PhysicsConnection* enumPC = itPC->nextElement();
     280  PhysicsConnection* enumPC = itPC->firstElement();
    281281  while (enumPC)
    282282    {
     
    289289  /* actually tick all the PhysicsInterfaces. Move the objects around */
    290290  tIterator<PhysicsInterface>* itPI = this->interfaces->getIterator();
    291   PhysicsInterface* enumPI = itPI->nextElement();
     291  PhysicsInterface* enumPI = itPI->firstElement();
    292292  while (enumPI)
    293293    {
  • trunk/src/lib/physics/physics_interface.cc

    r4836 r5110  
    6868
    6969    tIterator<PNode>* iterator = massCalcPNode->children->getIterator();
    70     PNode* pn = iterator->nextElement();
     70    PNode* pn = iterator->firstElement();
    7171    while( pn != NULL)
    7272    {
Note: See TracChangeset for help on using the changeset viewer.