Ticket #3717: fastSpatial.patch

File fastSpatial.patch, 1.8 KB (added by mimo, 8 years ago)
  • source/simulation2/components/CCmpRangeManager.cpp

     
    10871087
    10881088                r.push_back(it->first);
    10891089            }
     1090            std::sort(r.begin(), r.end());
    10901091        }
    10911092        // check a regular range (i.e. not the entire world, and not parabolic)
    10921093        else
     
    11171118
    11181119                r.push_back(it->first);
    11191120            }
     1121            std::sort(r.begin(), r.end());
    11201122        }
    11211123    }
    11221124
  • source/simulation2/helpers/Spatial.h

     
    514514    }
    515515
    516516    /**
    517      * Returns a 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.
     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.
    519519     */
    520520    void GetInRange(std::vector<entity_id_t>& out, CFixedVector2D posMin, CFixedVector2D posMax)
    521521    {
     
    545545                    out.insert(out.end(), subdivision.begin(), subdivision.end());
    546546            }
    547547        }
    548 
    549         std::sort(out.begin(), out.end());
    550548    }
    551549
    552550    /**
    553      * Returns a sorted list 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.
    555553     */
    556554    void GetNear(std::vector<entity_id_t>& out, CFixedVector2D pos, entity_pos_t range)
    557555    {