Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6135 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 16, 2005, 6:01:26 PM (19 years ago)
Author:
bensch
Message:

om: safer collision-test

Location:
branches/objectmanager/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/objectmanager/src/lib/collision_detection/cd_engine.cc

    r6124 r6135  
    110110{
    111111  BVTree* tree;
    112   std::list<WorldEntity*>::iterator entity1, entity2;
     112  std::list<WorldEntity*>::iterator entity1, entity2, pre1, pre2;
    113113  PRINTF(3)("checking for collisions\n");
    114   for (entity1 = list1.begin(); entity1 != list1.end(); entity1++)
     114
     115  pre1 = list1.begin();
     116  while (pre1 != list1.end())
    115117  {
     118    entity1 = pre1;
     119    pre1++;
    116120    if( likely((*entity1) != this->terrain))
    117121    {
    118       for (entity2 = list2.begin(); entity2 != list2.end(); entity2++)
     122      pre2 = list2.begin();
     123      while (pre2 != list2.end())
    119124      {
     125        entity2 = pre2;
     126        pre2++;
    120127        if( likely((*entity2) != this->terrain))
    121128        {
  • branches/objectmanager/src/story_entities/world.cc

    r6134 r6135  
    690690      this->gameTime += this->dtS;
    691691
    692       this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
     692/*      this->tick(this->objectManager.getObjectList(OM_DEAD_TICK), this->dtS);
    693693      this->tick(this->objectManager.getObjectList(OM_COMMON), this->dtS);
    694       this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);
     694      this->tick(this->objectManager.getObjectList(OM_GROUP_00), this->dtS);*/
    695695      this->tick(this->objectManager.getObjectList(OM_GROUP_01), this->dtS);
    696696      this->tick(this->objectManager.getObjectList(OM_GROUP_01_PROJ), this->dtS);
    697 
    698 //       tIterator<WorldEntity>* iterator = this->entities->getIterator();
    699 //       WorldEntity* entity = iterator->firstElement();
    700 //       while( entity != NULL)
    701 //         {
    702 //           entity->tick (this->dtS);
    703 //           entity = iterator->nextElement();
    704 //         }
    705 //       delete iterator;
    706697
    707698      /* update tick the rest */
     
    747738void World::collide()
    748739{
    749   CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00), this->objectManager.getObjectList(OM_GROUP_01_PROJ));
    750   CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01), this->objectManager.getObjectList(OM_COMMON));
     740  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_00),
     741                                            this->objectManager.getObjectList(OM_GROUP_01_PROJ));
     742  CDEngine::getInstance()->checkCollisions(this->objectManager.getObjectList(OM_GROUP_01),
     743                                            this->objectManager.getObjectList(OM_COMMON));
    751744}
    752745
  • branches/objectmanager/src/world_entities/npcs/npc.cc

    r6134 r6135  
    5050      WorldEntity* powerUp = new TurretPowerUp();
    5151      powerUp->setAbsCoor(this->getAbsCoor());
    52       powerUp->toList(OM_COMMON);
     52//      powerUp->toList(OM_COMMON);
    5353    }
    5454    else if ((float)rand()/RAND_MAX < .3)
  • branches/objectmanager/src/world_entities/space_ships/space_ship.cc

    r6130 r6135  
    112112  PRINTF(4)("SPACESHIP INIT\n");
    113113
    114   EventHandler::getInstance()->grabEvents(false);
     114  EventHandler::getInstance()->grabEvents(true);
    115115
    116116  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
  • branches/objectmanager/src/world_entities/weapons/laser.cc

    r6134 r6135  
    9696  ParticleEngine::getInstance()->breakConnections(this->emitter);
    9797  this->lifeCycle = 0.0;
     98
    9899  this->toList(OM_NULL);
    99 
    100   this->toList(OM_DEAD);
    101100  this->removeNode();
    102101  Laser::fastFactory->kill(this);
     
    133132  this->lifeCycle = .95; //!< @todo calculate this usefully.
    134133  ParticleEngine::getInstance()->addConnection(this->emitter, Laser::explosionParticles);
    135 
    136134}
    137135
Note: See TracChangeset for help on using the changeset viewer.