-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a distance_to()
method to Vector2i
#7983
Comments
Perhaps other metrics than Euclidean may be useful for |
Yes, for my project I dont need more than Euclidean, but it seems to me a good idea to let the possibility of choosing the calculation method |
This proposal is a subset of #2297.
I think other metrics are too use case specific for them to be included in vectors (whether as separate method(s) or as argument of Regarding the proposal, adding only |
distance_to()
method to Vector2i
Describe the project you are working on
A 2D colony simulation game, with a tilemap and a lots of calculation everywhere
Describe the problem or limitation you are having in your project
There is no equivalent of Vector2.DistanceTo for Vector2I
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a Vector2I.DistanceTo() function, this function return a float => number of tiles between each position
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The code I use :
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, see my code above
Is there a reason why this should be core and not an add-on in the asset library?
Because its a basic function when we use 2D grid (I guess)
The text was updated successfully, but these errors were encountered: