Skip to content

Quat dot product and lerp#7725

Merged
kpal81xd merged 3 commits intomainfrom
quat
May 30, 2025
Merged

Quat dot product and lerp#7725
kpal81xd merged 3 commits intomainfrom
quat

Conversation

@kpal81xd
Copy link
Contributor

  • Adds methods for dot product and linear lerping between two quaternions

@kpal81xd kpal81xd self-assigned this May 30, 2025
@kpal81xd kpal81xd requested a review from a team May 30, 2025 15:46
@kpal81xd kpal81xd added the enhancement Request for a new feature label May 30, 2025
@kpal81xd kpal81xd requested a review from willeastcott May 30, 2025 15:46
* result.lerp(q1, q2, 0.5); // Return the midpoint interpolant
* result.lerp(q1, q2, 1); // Return q2
*/
lerp(lhs, rhs, alpha) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm. Why would you ever lerp quaternions instead of slerp them?

Copy link
Contributor Author

@kpal81xd kpal81xd May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lerping is less expensive than performing a slerp

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fair enough.

@kpal81xd kpal81xd merged commit 6aa5990 into main May 30, 2025
7 checks passed
@kpal81xd kpal81xd deleted the quat branch May 30, 2025 16:04
@willeastcott
Copy link
Contributor

@kpal81xd Minor point but adding these kinds of functions should also include unit tests (easily done with ChatGPT).

@kpal81xd kpal81xd mentioned this pull request May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants