Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the GLM library for OpenGL not have a magnitude function?

I'm new to using the GLM library, but it appears it does not have a magnitude function. Is this correct? If so, what is the reasoning?

like image 784
Darkenor Avatar asked Nov 08 '13 19:11

Darkenor


People also ask

What library is GLM in?

GLM is written as a platform independent library with no dependence and officially supports the following compilers: GCC 3.4 and higher. LLVM 2.3 and higher. Visual Studio 2005 and higher.

Is GLM a header library?

OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications.


1 Answers

glm::length():

genType::value_type glm::length( genType const & x )

Returns the length of x, i.e., sqrt(x * x).

And as @bcrist pointed out, glm::length2 from GLM_GTX_norm:

T glm::length2( vecType< T, P > const& x )

Returns the squared length of x.

like image 94
genpfault Avatar answered Oct 18 '22 18:10

genpfault