Skip to content
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

Clarify the results of VectorN.normalized() in the docs #92707

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

GrahameGW
Copy link
Contributor

@GrahameGW GrahameGW commented Jun 2, 2024

The current documentation for VectorN.normalized() does not explicitly state what happens if you normalize a zero-length vector. As there are at least two logical outcomes (a divide by zero error or VectorN.Zero), it is worth it to specify how godot handles this case; something which is potentially further confused by the note RE potential odd behavior when the vector length is very small.

This change simply adds the clarifying note that normalizing a zero-length vector will return (0,0), (0,0,0), or (0,0,0,0), depending on the vector size normalized.

@GrahameGW GrahameGW requested a review from a team as a code owner June 2, 2024 23:14
doc/classes/Vector2.xml Outdated Show resolved Hide resolved
@AThousandShips AThousandShips added enhancement documentation cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Jun 3, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone Jun 3, 2024
@GrahameGW GrahameGW force-pushed the vector_normalized_docs branch from a0d3b67 to bbf1a7f Compare June 3, 2024 15:10
@GrahameGW
Copy link
Contributor Author

Fixed space typo and adjusted vector format to (0, 0) from (0,0)-- thanks guys for the review

@AThousandShips AThousandShips changed the title Clarify the results of VectorN.normalized() in the docs Clarify the results of VectorN.normalized() in the docs Jun 3, 2024
@AThousandShips
Copy link
Member

Could you please update the commit message to match the PR title?

@GrahameGW GrahameGW force-pushed the vector_normalized_docs branch from bbf1a7f to 0560e89 Compare June 3, 2024 21:17
@GrahameGW
Copy link
Contributor Author

Could you please update the commit message to match the PR title?

Yep, all set

@akien-mga akien-mga merged commit 2f26842 into godotengine:master Jun 4, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@GrahameGW GrahameGW deleted the vector_normalized_docs branch June 4, 2024 18:13
@GrahameGW GrahameGW restored the vector_normalized_docs branch June 4, 2024 18:13
@GrahameGW GrahameGW deleted the vector_normalized_docs branch June 4, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants