-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Suggestion] Easing GTX #761
Comments
Slow evening, so I made a version that builds in Visual Studio 2013 for If you want any refinements made, or it's worth submitting a pull request, let me know. Thanks Edit 3 : Having checked them all visually, Edit 2 : I've made the changes specified in edit 1 to the gist . Edit 1 : Having thought more on this, two things come to mind.
This leads to the thought that it would be better structured closer to the original file mentioned in the OP. With each function instead taking the form e.g. template <typename genType>
GLM_FUNC_DECL genType cubicEaseOut(genType const & a); Such that they can be used e.g. {
float a, b, c;
c = glm::mix(a, b, glm::cubicEaseOut(0.5f));
}
{
glm::vec3 a, b, c;
c = glm::mix(a, b, glm::cubicEaseOut(0.5f));
}
{
glm::dvec3 a, b, c;
c = glm::mix(a, b, glm::cubicEaseOut(0.5));
}
{
glm::quat a, b, c;
c = glm::slerp(a, b, glm::cubicEaseOut(0.5f));
} This would also make the underlying code alot cleaner. But without working directly on the types it feels a little less GLM relevant imo. |
Hi, Thanks for contributing, |
Easing functions are useful in animation and similar, currently as far I can tell, glm only has linear interpolation (
mix
,lerp
) and spherical interpolation (slerp
for quaternions).Examples of the kind of things I'm talking about here.
An easy strategy would be to convert this file (it has one of the ultra liberal licenses), so that each contained function is templated and returns the result of forwarding the original return value to the corresponding linear interpolation function.
I'm happy to produce the above if you agree that it would be a useful addition.
The text was updated successfully, but these errors were encountered: