A single-file public domain math library for game and graphics programming with C/C++ support.
Handmade Math is a single-file, public domain math library specifically designed for game development and computer graphics. It provides essential vector, matrix, and quaternion operations with support for multiple graphics conventions and programming languages.
Game developers and graphics programmers working in C or C++ who need a lightweight, flexible math library without licensing restrictions.
Developers choose Handmade Math for its simplicity, cross-language compatibility, and convention flexibility, offering a public domain alternative to more complex libraries like GLM.
A simple math library for games and computer graphics. Compatible with both C and C++. Public domain and easy to modify.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Just include 'HandmadeMath.h' with no separate implementation file, as all functions are static inline, making integration straightforward.
Supports both C and C++ with operator overloading for C++ and _Generic for C11, allowing seamless use in mixed codebases.
Provides left- and right-handed variants for operations and zero-to-one or negative-one-to-one NDC conventions, adapting to different graphics APIs.
Vector components can be accessed via multiple naming schemes like XYZ, RGB, or UVW using unions, offering intuitive swizzling-like functionality.
To remove or change the HMM_ prefix, developers must manually perform a find and replace in the source, which is tedious and error-prone.
Compared to libraries like GLM, Handmade Math has fewer community contributions, extensions, and third-party integrations, which may limit tooling support.
The use of unions for data access in C++ may not align with modern type safety best practices and could lead to undefined behavior if misused.
Handmade Math is an open-source alternative to the following products: