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

Potential bug with mix in 0.9.9.3? #842

Closed
alexanderbock opened this issue Dec 2, 2018 · 2 comments
Closed

Potential bug with mix in 0.9.9.3? #842

alexanderbock opened this issue Dec 2, 2018 · 2 comments
Assignees
Milestone

Comments

@alexanderbock
Copy link

Just updated our code base from 0.9.8.x to 0.9.9.3 and a previously working code no longer compiles:

glm::dmat4 start = ...;
glm::dmat4 end = ...;
float t = "...";
glm::dmat4 res = glm::mix(start, end, t);

Fails in the

	template<typename T, typename U>
	struct compute_mix
	{
		GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a)
		{
			GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");

			return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
		}
	};

with the second static_cast from the left, where it tries to cast a glm::dmat4 into a float

@alexanderbock alexanderbock changed the title Potential bug with mix? Potential bug with mix in 0.9.9.3? Dec 2, 2018
@Groovounet Groovounet self-assigned this Dec 30, 2018
@Groovounet Groovounet added this to the GLM 0.9.9 milestone Dec 30, 2018
@nealmcb
Copy link

nealmcb commented Feb 6, 2019

If previously-working code doesn't work with newer versions, is that a regression, rather than an enhancement request?

@Groovounet
Copy link
Member

This issue is resolve in master branch for GLM 0.9.9.4 release.

Please include <glm/ext/matrix_common.hpp> to access this feature.

Thanks!

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

No branches or pull requests

3 participants