mirror of
https://github.com/recp/cglm.git
synced 2025-10-03 16:51:35 +00:00
90259e673f6cd8db9fba25cdc8d95167d9e941fe
🎥 OpenGL Mathematics (glm) for C
The original glm library is for C++ only (templates, namespaces, classes...), this library targeted to C99 but currently you can use it for C89 safely by language extensions e.g __register
This library is header only so you dont need link to application. All functions are marked inline (always_inline) so compiler probably will inline all these functions
Most of math functions are optimized manualy with SSE2 if available, if not? Dont worry there are non-sse versions of all operations
This library provides:
- Simple usage
- Small memory usage
- The codes are small and more readable than C++ templates, metafuncs
- Optimized operations with SIMD and non-SIMD
- Small code size
- All operations are inline (if compiler will do), no function call overhead
- Chain matrix multiplication (square only)
You can pass matrices and vectors as array to functions rather than get address.
mat4 m = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
glm_translate(m, (vec3){1.0f, 0.0f, 0.0f});
##License MIT. check the LICENSE file
##Install Import the library to your include folder, thats it!
##Notes
- This library uses float types only, does not support Integers, Double... yet
Description
📽 Highly Optimized Graphics Math (glm) for C
3d3d-mathaffine-transform-matricesavxbezierbounding-boxesceulerfrustummarix-inversemathmatrixmatrix-decompositionsneonopenglopengl-mathsimdssevectorwasm
Readme
MIT
6.6 MiB
Languages
C
98.2%
Makefile
0.9%
CMake
0.4%
Meson
0.2%
M4
0.1%