Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5115 in orxonox.OLD for trunk/src/lib/collision_detection


Ignore:
Timestamp:
Aug 24, 2005, 1:30:13 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: reimplemented the list functions, as i did before in revision 5110.
This time, i looked out for the bugs, and i think i found one

@patrick: i know, that you do not want to code at the moment… :/ → see mail

Location:
trunk/src/lib/collision_detection
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/cd_engine.cc

    r5111 r5115  
    7171}
    7272
    73 
     73#include "class_list.h"
     74#include "state.h"
    7475/**
    7576 *  this checks the collisions with the objects
     
    8081  tIterator<WorldEntity>* iterator1 = entityList->getIterator();
    8182  tIterator<WorldEntity>* iterator2 = entityList->getIterator();
    82   WorldEntity* entity1 = iterator1->nextElement();
    83   WorldEntity* entity2 = iterator2->seekElement(entity1);
     83  WorldEntity* entity1 = iterator1->firstElement();
     84  WorldEntity* entity2 = iterator2->iteratorElement(iterator1);
     85  //entity2 = iterator2->nextElement();
    8486  PRINTF(3)("checking for collisions\n");
    8587  while( entity1 != NULL)
     
    8789    if( likely(entity1 != this->terrain))
    8890    {
     91      entity2 = iterator2->nextElement();
     92
    8993      while( entity2 != NULL)
    9094      {
    91         if( likely(entity2 != this->terrain))
     95//        if (entity2 != NULL)
     96//          printf("entity2::%s::%s", entity2->getClassName(), getName());
     97
     98        ///////////////// FIXME
     99        ///////////////// COMMENTED OUT, because some part of it generated a segfault
     100        ////////////////
     101
     102/*                if( likely(entity2 != this->terrain))
    92103        {
    93           PRINTF(3)("checking object %s against %s\n", entity1->getName(), entity2->getName());
     104          PRINTF(4)("checking object %s against %s\n", entity1->getName(), entity2->getName());
    94105          tree = entity1->getOBBTree();
    95           if( likely(tree != NULL)) tree->collideWith(entity1, entity2);
    96         }
     106          if( likely(tree != NULL) && entity2->getOBBTree() != NULL) tree->collideWith(entity1, entity2);
     107        }*/
    97108        entity2 = iterator2->nextElement();
    98109      }
     110//      printf("\n");
    99111    }
    100112    entity1 = iterator1->nextElement();
    101     entity2 = iterator2->seekElement(entity1);
    102 
     113    entity2 = iterator2->iteratorElement(iterator1);
    103114  }
    104115  delete iterator1;
     
    133144
    134145  tIterator<WorldEntity>* iterator = entityList->getIterator();
    135   WorldEntity* entity = iterator->nextElement();
     146  WorldEntity* entity = iterator->firstElement();
    136147  while( entity != NULL)
    137148  {
  • trunk/src/lib/collision_detection/obb_tree.cc

    r5028 r5115  
    4747{
    4848  this->setClassID(CL_OBB_TREE, "OBBTree");
     49
     50  this->rootNode = NULL;
    4951
    5052  material = new Material*[5];
  • trunk/src/lib/collision_detection/obb_tree_node.cc

    r5111 r5115  
    574574
    575575  iterator = partition1.getIterator();
    576   element = iterator->nextElement();
     576  element = iterator->firstElement();
    577577  index = 0;
    578578  while( element != NULL)
     
    592592
    593593  iterator = partition2.getIterator();
    594   element = iterator->nextElement();
     594  element = iterator->firstElement();
    595595  index = 0;
    596596  while( element != NULL)
Note: See TracChangeset for help on using the changeset viewer.