c++math3dlinear-algebraglm-math

What glm::normalize does?


I trying to write an MD5 loader in Java from C++ source but I cannot find out what is this line doing:

animatedJoint.m_Orient = glm::normalize(animatedJoint.m_Orient);

where the animatedJoint.m_Orient is vec4. What does it do?


Solution

  • It's normalizing the animatedJoint.m_Orient vector, by taking the normal of the vector and copying it back to the vector itself. The glm::normalize() method does not modify the object you pass to it.