Replaced SQUAD interpolation with Cubic Hermite to align with GLTF 2.0 spec #3920
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.
This is a follow up PR on #3919.
During that PR, I went researching for a quaternion cubic spline algorithm that could be used, and landed on SQUAD. Turns out, the GLTF 2.0 very specifically provides an algorithm that is says to use (which looks to me like Cubic Hermite Spline):
However, Cubic Hermite Spline showed flipping/spinning when I was doing tests due to quaternion double-cover. To alleviate this, I added some logic to check the dot product and negate them (and also normalized them).
After this change I'm happy to say it looks pretty good and should be technically more "correct" and compliant with what GLTF 2.0 expects!