Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7368 in orxonox.OLD for trunk/src/util/object_manager.cc


Ignore:
Timestamp:
Apr 25, 2006, 11:37:59 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: some renamings, and GameWorldData now has lists for what EntityLists should be drawed/ticked/collided(not yet implemented).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/object_manager.cc

    r7221 r7368  
    105105
    106106/**
    107  * returns a new List with a list of WorldEntities of distance Radius from center
    108  */
    109 std::list<WorldEntity*>* ObjectManager::distanceFromObject(const PNode& center, float radius, ClassID classID)
     107 * @returns a new List with a list of WorldEntities of distance Radius from center
     108 */
     109void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID)
    110110{
    111111  const std::list<BaseObject*>* objectList = ClassList::getList(classID);
    112112  if (objectList != NULL)
    113113  {
    114     std::list<WorldEntity*>* newList = new std::list<WorldEntity*>;
    115114
    116115    list<BaseObject*>::const_iterator node;
    117116    for (node = objectList->begin(); node != objectList->end(); node++)
    118117      if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
    119         newList->push_back(dynamic_cast<WorldEntity*>(*node));
    120     return newList;
    121   }
    122   return NULL;
     118        entities.push_back(dynamic_cast<WorldEntity*>(*node));
     119  }
    123120}
    124121
Note: See TracChangeset for help on using the changeset viewer.