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

Fast sqrt functions ambiguity #215

Closed
rwypior opened this issue Jun 17, 2014 · 3 comments
Closed

Fast sqrt functions ambiguity #215

rwypior opened this issue Jun 17, 2014 · 3 comments
Assignees
Milestone

Comments

@rwypior
Copy link

rwypior commented Jun 17, 2014

Hello.

I encountered difficulties using fast sqrt functions (GLM_GTX_fast_square_root extension).
The problem is ambiguity between the functions, that only differ in returning type, which (the returning type) is genType or genType::value_type.

The example:

glm::mediump_float32 dist = glm::fastDistance(glm::mediump_f32vec2(destination.x, destination.z), glm::mediump_f32vec2(loc.x, loc.z));

Above line generates error:

more than one instance of overloaded function "glm::fastDistance" matches the argument list:
function template "genType::value_type glm::fastDistance(const genType &x, const genType &y)"
function template "genType glm::fastDistance(const genType &x, const genType &y)"
argument types are: (glm::mediump_f32vec2, glm::mediump_f32vec2)

I believe it is a GLM bug. Is there any known workaround solution for this?

@Groovounet
Copy link
Member

Hi,

With GLM 0.9.5, if you use glm::lowp_float32 dist = glm::distance(glm::lowp_f32vec2(destination.x, destination.z), glm::lowp_f32vec2(loc.x, loc.z)); you will access the same fast path.

glm::fastDistance should probably be fixed as well.

Thanks,
Christophe

@Groovounet Groovounet self-assigned this Jun 17, 2014
@Groovounet Groovounet added this to the GLM 0.9.5 milestone Jun 17, 2014
@rwypior
Copy link
Author

rwypior commented Jun 18, 2014

It's good to know.

Thank you for help!

Groovounet pushed a commit that referenced this issue Jun 19, 2014
@Groovounet
Copy link
Member

This issue is fixed in GLM 0.9.5 branch and for GLM 0.9.5.4 release.

Thanks for contributing,
Christophe

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

2 participants