Skip to content
modkitv0.2

math.h

#include <modkit/math.h>

Modkit math library - vectors, matrices, transforms, cameras.

A comprehensive math library designed for GPU rendering compatibility (column-major float[16]) and cglm. Uses right-hand coordinate system with Y-up, -Z forward. Features:Vector types: mk_vec2, mk_vec3, mk_vec4Matrix type: mk_mat4 (column-major)Quaternion: mk_quat for rotationsTransform: mk_transform (position + rotation + scale)Camera: mk_camera (perspective/ortho with zoom)Projection utilities: MVP composition, screen/world mapping All types can be used directly with GPU functions via .data member and with cglm via .v/.m members. Example: