Skip to content

Repository files navigation

Handmade Math

Build Status

A single-file, cross-platform, public domain game math library for C/C++.

To get started, go download the latest release.


VersionChanges
1.9.0Added SSE versions of quaternion operations.
1.8.0Added fast vector normalization routines that use fast inverse square roots.
1.7.1Changed operator[] to take a const ref int instead of an int.
1.7.0Renamed the 'Rows' member of hmm_mat4 to 'Columns'. Since our matrices are column-major, this should have been named 'Columns' from the start. 'Rows' is still present, but has been deprecated.
1.6.0Added array subscript operators for vector and matrix types in C++. This is provided as a convenience, but be aware that it may incur an extra function call in unoptimized builds.
1.5.1Fixed a bug with uninitialized elements in HMM_LookAt.
1.5.0Changed internal structure for better performance and inlining. As a result, HANDMADE_MATH_NO_INLINE has been removed and no longer has any effect.
1.4.0Fixed bug when using C mode. SSE'd all vec4 operations. Removed zeroing for better performance.
1.3.0Removed need to #define HANDMADE_MATH_CPP_MODE. C++ definitions are now included automatically in C++ environments.
1.2.0Added equality functions for HMM_Vec2, HMM_Vec3, and HMM_Vec4, and SSE'd HMM_MultiplyMat4 and HMM_Transpose.
1.1.5Added Width and Height to HMM_Vec2, and made it so you can supply your own SqrtF.
1.1.4Fixed SSE being included on platforms that don't support it, and fixed divide-by-zero errors when normalizing zero vectors.
1.1.3Fixed compile error in C mode
1.1.2Fixed invalid HMMDEF's in the function definitions
1.1.1Resolved compiler warnings on gcc and g++
1.1Quaternions!
1.0Lots of testing
0.7Added HMM_Vec2, and HMM_Vec4 versions of HMM_LengthSquared, HMM_Length, and HMM_Normalize.
0.6Made HMM_Power faster, Fixed possible efficiency problem with HMM_Normalize, RENAMED HMM_LengthSquareRoot to HMM_LengthSquared, RENAMED HMM_RSqrtF to HMM_RSquareRootF, RENAMED HMM_SqrtF to HMM_SquareRootF, REMOVED Inner function (user should use Dot now), REMOVED HMM_FastInverseSquareRoot function declaration
0.5.2Fixed SSE code in HMM_SqrtF and HMM_RSqrtF
0.5.1Fixed HMM_Translate producing row-major matrices, ensured column-major order for matrices throughout
0.5Added scalar operations on vectors and matrices, added += and -= for hmm_mat4, reconciled headers and implementations, tidied up in general
0.4Added SSE Optimized HMM_SqrtF, HMM_RSqrtF, Removed use of C Runtime
0.3Added +=,-=, *=, /= for hmm_vec2, hmm_vec3, hmm_vec4
0.2bDisabled warning C4201 on MSVC, Added 64bit percision on HMM_PI
0.2aPrefixed Macros
0.2Updated Documentation, Fixed C Compliance, Prefixed all functions, and added better operator overloading
0.1Initial Version

FAQ

What's the license?

This library is in the public domain. You can do whatever you want with it.

Where can I contact you to ask questions?

Feel free to make Github issues for any questions, concerns, or problems you encounter.

About

A simple math library for games and computer graphics. Compatible with both C and C++.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages