I am quite confused over how GLM library is behaving or I am using it improperly.
glm::vec2 testVec(6,-4);
float len = testVec.length();
I get the value 2
with the above code snippet. I believe I am trying to get the length of the vector defined by testVec
. You know very well that it is not the correct length of the vector. What am I missing here?
length(vecN)
free function returning the norm ofvecN
, andvecN.length()
method, returning dimension ofvecN
. See §5.5 Vector and Scalar Components and Length of GLSL 4.60 spec. – Ruslan Feb 15 '19 at 16:16