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

Slerp special cases #657

Open
Diggsey opened this issue Sep 25, 2019 · 0 comments
Open

Slerp special cases #657

Diggsey opened this issue Sep 25, 2019 · 0 comments

Comments

@Diggsey
Copy link

Diggsey commented Sep 25, 2019

Colinear, opposite direction inputs

Returns None if the two vectors are almost collinear and with opposite direction
/// (in this case, there is an infinity of possible results).

This is only true for the 3D slerp, for 2D slerp there are only two possibilities. In either case, it might be more useful to return some result, rather than None. At the moment, the non-try variant will just return the original rotation which is quite surprising. IMO it would be better to return any rotation which is a valid solution rather than the original input.

You could have a slerp variation which returns Result<Rotation, RotationSet> where RotationSet would be a pair of rotations in 2D, and an implicitly defined "circle" of rotations in 3D, from which the user could pull out a single rotation by specifying a preferred solution in some way. The normal "slerp" function could call this function and then use an arbitrary method of selection.

Colinear, very close

At the moment, there is a special case for when they are exactly aligned, but there's no special case for when they are just very close - the Wikipedia article on SLERP suggests falling back to linear interpolation when the inputs are very close together. Do you think this is worthwhile?

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

No branches or pull requests

1 participant