Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2006, 5:25:42 PM (18 years ago)
Author:
patrick
Message:

door proximity algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/door.cc

    r8874 r8875  
    100100  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
    101101  WorldEntity* entity;
     102  float distance;
    102103
    103104  if( list == NULL)
     
    109110    entity = dynamic_cast<WorldEntity*>(*it);
    110111
     112    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
     113    if( distance < this->actionRadius)
     114      return true;
    111115  }
    112116
     
    117121  for( it = list->begin(); it != list->end(); it++)
    118122  {
     123    entity = dynamic_cast<WorldEntity*>(*it);
    119124
     125    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
     126    if( distance < this->actionRadius)
     127      return true;
    120128  }
    121129
Note: See TracChangeset for help on using the changeset viewer.