Implemented Sorting by distance to locatable

Discussion in 'Client & Site Suggestions' started by Furor, Mar 14, 2015.

  1. We have an option to sort gameobjects by distance to the player via .sortByDistance, however there doesn't seem to be an option to sort by distance to another locatable.

    So we could do something like:

    Code (Text):
    1. GameObjects.newQuery().names("Granite rocks").results().sortByDistanceTo(new Coordinate(x ,y, z)).limit(0, 2);
    This would allow us to save a bit of work trying to figure out how to manually sort by distance to a locatable.

  2. I implemented it, but should it be sortByDistanceTo or sortByDistanceFrom?
    Furor likes this.
  3. We already have nearestTo(), so to keep things routine I would say SortByDistanceTo, but 'From' appears to be the more accurate term when it comes to the dictionary. It's up to you.
  4. I think I'm going to use the word from because sortByDistanceFrom sounds better (and the reason we use the word to elsewhere is because nearestTo sounds much better than nearestFrom lol)

Share This Page