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

Add Vec3::rotate_towards #586

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tim-blackbird
Copy link
Contributor

@tim-blackbird tim-blackbird commented Nov 11, 2024

Added Vec3::rotate_towards with identical behavior to Vec2::rotate_towards

I added some extra tests to Vec2::rotate_towards as well, and adjusted the docs to be more accurate since the method does not interpolate the lengths of the vectors.

I noticed another issue with that. Vec2::rotate_towards returned rhs when the angle is too small. This means that only in that case the length of the resulting vector is equal to that of rhs instead of self.
It also differs from Quat::rotate_towards which returns self when the angle is too small, so I've updated it to return self instead.

@bitshifter
Copy link
Owner

I think perhaps returning the rhs when the angle is too small in both this and the quat version might be a better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants