global functions
glm::cross(...)
glm::vec3 glm::cross(const glm::vec3 &x=P, const glm::vec3 &y=P)
Documentation from code comments
Returns the cross product of x and y.
Type parameters:
valType Floating-point scalar types.
See also: GLSL cross man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::distance(...)
T glm::distance(const vecType< T, P > &p0=P, const vecType< T, P > &p1=P)
Documentation from code comments
Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
Type parameters:
genType Floating-point vector types.
See also: GLSL distance man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::dot(...)
T glm::dot(const vecType< T, P > &x=P, const vecType< T, P > &y=P)
Documentation from code comments
Returns the dot product of x and y, i.e., result = x * y.
Type parameters:
genType Floating-point vector types.
See also: GLSL dot man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::faceforward(...)
vecType< T, P > glm::faceforward(const vecType< T, P > &N=P, const vecType< T, P > &I=P, const vecType< T, P > &Nref=P)
Documentation from code comments
If dot(Nref, I) < 0.0, return N, otherwise, return -N.
Type parameters:
genType Floating-point vector types.
See also: GLSL faceforward man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::length(...)
T glm::length(const vecType< T, P > &x=P)
Documentation from code comments
Returns the length of x, i.e., sqrt(x * x).
Type parameters:
genType Floating-point vector types.
See also: GLSL length man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::normalize(...)
vecType< T, P > glm::normalize(const vecType< T, P > &x=P)
Documentation from code comments
Returns a vector in the same direction as x but with length of 1. According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
See also: GLSL normalize man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::reflect(...)
genType glm::reflect(const genType &I, const genType &N)
Documentation from code comments
For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
Type parameters:
genType Floating-point vector types.
See also: GLSL reflect man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
glm::refract(...)
vecType< T, P > glm::refract(const vecType< T, P > &I=P, const vecType< T, P > &N=P, T eta)
Documentation from code comments
For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector.
Type parameters:
genType Floating-point vector types.
See also: GLSL refract man page
See also: GLSL 4.20.8 specification, section 8.5 Geometric Functions
Last updated Tuesday, 19 November 2024 17:26:18 UTC - 2537ee49f6d46d5fe98e408849448314fd1f180e
If you have any doubt about the usage of this module you can ask in the forum.
If you want to contribute better documentation or start documenting this section you can do so here
If you find anything wrong with this docs you can report any error by opening an issue