Add methods to vector2i for consistency with vector2 #47653
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the Vector2i side of proposal # 2297 by adding the following methods to Vector2i that already exist in Vector2 and exposing them to GDScript:
angle
angle_to
angle_to_point
cross
distance_to
distance_squared_to
dot
length
length_squared
posmodv
snapped
These methods were chosen based on discussions in proposal godotengine/godot-proposals#2297
Below is a project that I used for testing.
Vector2iTest.zip
If this PR is accepted then I will start work on the Vector3i portion of this.