Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: GLM fast sqrt functions ambiguity

  1. #1
    Intern Newbie
    Join Date
    Feb 2014
    Location
    Poland
    Posts
    43

    GLM fast sqrt functions ambiguity

    Hello.

    I would like to use some of fast* functions of GLM framework (latest version for this day), but I can't overpass ambiguity problem.
    It always screams that function is ambiguous, even if I specify ridiculously precise types, for example:

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

    gives me error

    Code :
    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 I miss something small, but I can't find it. What should I do to make it work?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    876
    Untested, but if you're lucky specifying the template argument yourself resolved the ambiguity:

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

    However, if I read it correctly the two function templates the compiler sees essentially only differ in return type, so even this may not be enough. Perhaps worth opening a glm bug report over at glm github issues page.

  3. #3
    Intern Newbie
    Join Date
    Feb 2014
    Location
    Poland
    Posts
    43
    Unfortunatelly still no luck.
    I too noticed, that only returning type differs. Also the thing is, the function which returns genType isn't even documented at their website. It only mentions the one with genType::value_type.

    I guess I will try luck in there. I spend like half an hour trying to get it to work, including googling, but nothing helped.
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •