Header-only math library for linear (and non-linear) transformations made to work with OpenGL.
- Matrix class
- Vector class
- Transformations
- Translation
- Rotation
- Scale
- Projections
- Orthographic
- Perspective
- in memory matrices are laid out in row-major order, therefore
transposeprarmerer inglUniformMat**shuld be set toGL_TRUEwhen sending matrix to a shader - order of matrix multiplication is reversed (just like in glm)
#include <gmath>
gm::mat4 model = gm::rotate(gm::mat(1.f), gm::vec3(0.f, 0.f, 1.f), gm::randians(90.f));
gm::mat4 view = gm::lookAt(gm::vec3(-1.f, 0.f, 0.f), gm::vec3(0.f, 0.f, 0.f), gm::vec3(0.f, 1.f, 0.f));
gm::mat4 projection = gm::perspective(gm::radians(60.f), 4.f/3.f, 0.1f, 100.f);
gm::mat4 MVP = projection * view * model;