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 2 of 2

Thread: Re: glm::length(glm::vec) and glm::vec::length (and naming choice by kronos)

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    7

    Re: glm::length(glm::vec) and glm::vec::length (and naming choice by kronos)

    Hello list, Groovounet,

    I have been debating the same thing as the guy who posted here: 180191-glm-length(glm-vec)-and-glm-vec-length

    and how to avoid problems in our projects related to using the member function length(), as intuitively many users are going to assume this is the same as glm::length( vec ). I realize it is now part of the GLSL standard, but my question is why did they choose this name? Why not size(), like the STL standard? Or even a sizeof( vec ) method, which seems to me to be more in line with the the rest of GLSL's functional style. Perhaps I should be asking this on some khronos forum, but I'm not sure which one is most appropriate.

    As an aside, I was going to ask if it were possible to add a compile time flag to disable the length() member functions, but I see this would be difficult because it is used in the implementations.

    Thanks for your time,
    Rich

  2. #2
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    935
    Quote Originally Posted by reakin View Post
    Hello list, Groovounet,

    I have been debating the same thing as the guy who posted here: 180191-glm-length(glm-vec)-and-glm-vec-length

    and how to avoid problems in our projects related to using the member function length(), as intuitively many users are going to assume this is the same as glm::length( vec ). I realize it is now part of the GLSL standard, but my question is why did they choose this name? Why not size(), like the STL standard? Or even a sizeof( vec ) method, which seems to me to be more in line with the the rest of GLSL's functional style. Perhaps I should be asking this on some khronos forum, but I'm not sure which one is most appropriate.

    As an aside, I was going to ask if it were possible to add a compile time flag to disable the length() member functions, but I see this would be difficult because it is used in the implementations.

    Thanks for your time,
    Rich
    Probably that was totally arbitrary. "length" also appears here and there in the OpenGL API specification and that's pretty much inconsistent.

    For GLM, I haven't done it yet but this is something being considered for 0.9.6.

    Thanks,
    Christophe

Posting Permissions

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