Changeset 7368 in orxonox.OLD for trunk/src/util/object_manager.cc
- Timestamp:
- Apr 25, 2006, 11:37:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/object_manager.cc
r7221 r7368 105 105 106 106 /** 107 * returns a new List with a list of WorldEntities of distance Radius from center108 */ 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 */ 109 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID) 110 110 { 111 111 const std::list<BaseObject*>* objectList = ClassList::getList(classID); 112 112 if (objectList != NULL) 113 113 { 114 std::list<WorldEntity*>* newList = new std::list<WorldEntity*>;115 114 116 115 list<BaseObject*>::const_iterator node; 117 116 for (node = objectList->begin(); node != objectList->end(); node++) 118 117 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 } 123 120 } 124 121
Note: See TracChangeset
for help on using the changeset viewer.