Ticket #3717: fastSpatial.patch
File fastSpatial.patch, 1.8 KB (added by , 8 years ago) |
---|
-
source/simulation2/components/CCmpRangeManager.cpp
1087 1087 1088 1088 r.push_back(it->first); 1089 1089 } 1090 std::sort(r.begin(), r.end()); 1090 1091 } 1091 1092 // check a regular range (i.e. not the entire world, and not parabolic) 1092 1093 else … … 1117 1118 1118 1119 r.push_back(it->first); 1119 1120 } 1121 std::sort(r.begin(), r.end()); 1120 1122 } 1121 1123 } 1122 1124 -
source/simulation2/helpers/Spatial.h
514 514 } 515 515 516 516 /** 517 * Returns a sortedlist of items that are either in the square or close to it.518 * It's the responsibility of the querier to do proper distance checking .517 * Returns a (non sorted) list of items that are either in the square or close to it. 518 * It's the responsibility of the querier to do proper distance checking and entity sorting. 519 519 */ 520 520 void GetInRange(std::vector<entity_id_t>& out, CFixedVector2D posMin, CFixedVector2D posMax) 521 521 { … … 545 545 out.insert(out.end(), subdivision.begin(), subdivision.end()); 546 546 } 547 547 } 548 549 std::sort(out.begin(), out.end());550 548 } 551 549 552 550 /** 553 * Returns a sortedlist of items that are either in the circle or close to it.554 * It's the responsibility of the querier to do proper distance checking .551 * Returns a (non sorted) list of items that are either in the circle or close to it. 552 * It's the responsibility of the querier to do proper distance checking and entity sorting. 555 553 */ 556 554 void GetNear(std::vector<entity_id_t>& out, CFixedVector2D pos, entity_pos_t range) 557 555 {