Magnum/GlmIntegration/Integration.h file

Conversion of basic GLM vector and matrix types.

Provides conversion for the following types. See Magnum/GlmIntegration/GtcIntegration.h and Magnum/GlmIntegration/GtxIntegration.h for conversion of more complex types.

Magnum vector typeEquivalent GLM type
Math::BitVector<2>, Math::BitVector<3>, Math::BitVector<4>glm::bvec2, glm::bvec3, glm::bvec4
Vector2, Vector3, Color3, Vector4, Color4glm::vec2, glm::vec3, glm::vec4
Vector2ui, Vector3ui, Vector4uiglm::uvec2, glm::uvec3, glm::uvec4
Vector2i, Vector3i, Vector4iglm::ivec2, glm::ivec3, glm::ivec4
Vector2d, Vector3d, Vector4dglm::dvec2, glm::dvec3, glm::dvec4
Magnum matrix typeEquivalent GLM type
Matrix2x2 or Matrix2x2dglm::mat2 / glm::mat2x2 or glm::dmat2 / glm::dmat2x2
Matrix3 / Matrix3x3 or Matrix3d / Matrix3x3dglm::mat3 / glm::mat3x3 or glm::dmat3 / glm::dmat3x3
Matrix4 / Matrix4x4 or Matrix4d / Matrix4x4dglm::mat4 / glm::mat4x4 or glm::dmat4 / glm::dmat4x4
Matrix2x3 or Matrix2x3dglm::mat2x3 or glm::dmat2x3
Matrix3x2 or Matrix3x2dglm::mat3x2 or glm::dmat3x2
Matrix2x4 or Matrix2x4dglm::mat2x4 or glm::dmat2x4
Matrix4x2 or Matrix4x2dglm::mat4x2 or glm::dmat4x2
Matrix3x4 or Matrix3x4dglm::mat3x4 or glm::dmat3x4
Matrix4x3 or Matrix4x3dglm::mat4x3 or glm::dmat4x3

Types with extra qualifiers (such as glm::mediump_dmat3x4) are treated the same as types with no qualifier. Debug output using Corrade::Utility::Debug for all types is provided as well. Example usage:

#include <Magnum/GlmIntegration/Integration.h>

glm::vec3 a{1.0f, 2.0f, 3.0f};
Vector3 b(a);

glm::mat3 c = glm::mat3(Matrix3::rotation(35.0_degf));

Debug{} << glm::lowp_ivec3{1, 42, -3}; // prints ivec3(1, 42, -3)

Namespaces

namespace glm
GLM namespace.

Functions

template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tvec2<T, q>& value) -> Corrade::Utility::Debug&
Debug output operator for GLM vector types.
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tvec3<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tvec4<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat2x2<T, q>& value) -> Corrade::Utility::Debug&
Debug output operator for GLM matrix types.
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat2x3<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat2x4<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat3x2<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat3x3<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat3x4<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat4x2<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat4x3<T, q>& value) -> Corrade::Utility::Debug&
template<class T, glm::precision q>
auto operator<<(Corrade::Utility::Debug& debug, const tmat4x4<T, q>& value) -> Corrade::Utility::Debug&