143 Commits

Author SHA1 Message Date
Matt Mascarenhas
774630b7cf Add wrappers for expf and logf 2016-08-31 02:10:39 +01:00
Matt Mascarenhas
24caf7e8dd Add header for HMM_PowerF() 2016-08-31 01:35:24 +01:00
Zak Strange
59db096948 Merge pull request #42 from StrangeZak/lerp
Add header and test for HMM_Lerp
2016-08-30 20:32:07 -04:00
Ben Visness
2d729a3b34 Add header and test for HMM_Lerp 2016-08-30 19:19:04 -05:00
Ben Visness
5ddb0ed10d Tweak whitespace 2016-08-30 19:14:31 -05:00
Ben Visness
2ea471b3ce Add HMM_Transpose 2016-08-30 18:53:53 -05:00
Matt Mascarenhas
224d543d79 Introduce HMM_PowerF() 2016-08-31 00:44:14 +01:00
Zak Strange
de08310dbd Fixed HMM_Vec4 2016-08-30 13:46:50 -07:00
Zak Strange
8578602799 Fixed issues in last commit and added a function overloaded HMM_Dot 2016-08-30 13:24:55 -07:00
Zak Strange
b087efc561 Added HMM_DotVec2, HMM_DotVec3, and HMM_DotVec4 2016-08-30 12:05:33 -07:00
Zak Strange
712e5aa6db Fixed issue #33, #32, #27, #30 2016-08-30 11:58:26 -07:00
Matt Mascarenhas
cad7efa639 Accelerate HMM_Power() with the squaring technique
Thanks to @mmozeiko for the algorithm
2016-08-30 01:19:47 +01:00
Zak Strange
c58043db84 Merge pull request #26 from bvisness/bug-fixes
Fix issues that came up in testing
2016-08-29 11:27:22 -04:00
Ben Visness
44be431b65 Fix issues that came up in testing
Refs #25
2016-08-28 23:27:24 -05:00
Zak Strange
b638056bcd Updated README.md and Fixed SSE code 2016-08-25 16:11:03 -07:00
Ben Visness
bcf7937eec Ensure column-major order for matrices and fix HMM_Translate
Most of the changes in this patch are cosmetic (such as looping by
columns first.) HMM_Translate was incorrectly producing row-major
matrices, which should now be fixed.

Fixes #22
2016-08-25 14:14:22 -05:00
Ben Visness
c9ec065fd5 Add documentation for v0.5 2016-08-23 18:20:59 -05:00
Ben Visness
077bdcd346 Initialize structs the Zak way
And generally make formatting consistent throughout.

Refs #20
2016-08-23 17:57:07 -05:00
Ben Visness
99bad6fd6e Clean up C++ versions of functions
Prefixed functions that needed it, added functions to match all new
operators, and ensured that headers were accurate.

Fixes #20
2016-08-23 15:39:35 -05:00
Ben Visness
c55baa9086 Ensure that all Result variables are initialized 2016-08-23 15:11:03 -05:00
Ben Visness
fb652d1467 Add lots and lots of missing operations
- Scalar multiplication of vectors and matrices
  - This was present for only vec2's and vec3's using operator
    overloading. In addition, there was only operator overloading for
    [structure] * float, not float * [structure].
  - Additionally, the two operators that were already defined were
    updated to use the new C-style functions that were defined.
- Scalar division of vectors and matrices
- Matrix subtraction
- += operator for matrices
2016-08-23 09:43:27 -05:00
Ben Visness
2c265f0e1d Add missing headers for operators
And flip the order of those two other operators, because having vec2
after vec3 was bugging me.
2016-08-22 19:00:04 -05:00
Ben Visness
a85eb07b3d Merge branch 'vec4v' 2016-08-20 19:50:08 -05:00
Ben Visness
83aa7f404a Merge branch 'add-mat4' 2016-08-20 19:49:57 -05:00
Ben Visness
6259f1b47f Add ability to construct vec4 from vec3 and float
This is very useful for applications using homogeneous coordinates, since I can
take a vec3 representing a position or normal, and construct the appropriate
vec4 in homogeneous coordinates.
2016-08-20 19:46:07 -05:00
Ben Visness
31a6bd200b Implement addition for mat4's 2016-08-20 19:30:08 -05:00
Zak Strange
ed4aef49e1 0.4 - Removed use of CRT 2016-08-20 09:13:37 -07:00
Zak Strange
80d2492d86 0.3 - Added +=,-=, *=, /= for hmm_vec2, hmm_vec3, hmm_vec4 2016-08-19 20:28:32 -07:00
Ben Visness
4d21fc5388 Add ability to disable inlining of functions
Some build environments build each source file individually to .o files
and then link after the fact. With inlined functions, this tends to
just produce empty .o files, undefined symbol errors, and grumpy
programmers like me.

This change simply adds the option to disable inlining of functions so
Handmade Math can function properly as a library unto itself.
2016-08-12 23:35:22 -05:00
StrangeZak
140c1caaf2 Fixed return values for HMM_SinF and HMM_TanF 2016-07-31 12:28:09 -07:00
StrangeZak
4fc4e53a60 Fixed HMM_TanF 2016-07-31 09:05:39 -07:00
StrangeZak
cd4f29a703 Added SSE Optimization HMM_Rsqrtf, and HMM_Sqrtf. Removed all direct calls to the CRT, and updated README.md 2016-07-30 15:18:45 -07:00
StrangeZak
08dd60ce55 Updated file header 2016-07-21 05:32:52 -07:00
StrangeZak
1c11130d5c Fixed HMM_PI, and disabled warning 4201 on MSVC 2016-07-21 05:30:33 -07:00
Kyle De'Vir
2386f967b3 Fixed calculations for HMM_Rotate 2016-06-08 05:19:11 +10:00
Kyle De'Vir
de5c1fbb59 Small fix for HMM_Rotate 2016-06-08 03:36:03 +10:00
Kyle De'Vir
2f6b2fd260 HMM_Rotate - normalize vec3 Axis 2016-06-08 03:30:22 +10:00
Kyle De'Vir
b63e6b558f More changes 2016-06-08 03:11:12 +10:00
Kyle De'Vir
8a9bd47985 Revert change to Perspective function 2016-06-08 00:48:13 +10:00
Kyle De'Vir
b9c83866ff Revert "Revert "Revert "Corrected errors in Perspective function"""
This reverts commit 92f5150a01.
2016-06-08 00:45:57 +10:00
Kyle De'Vir
cbcc1e583e Small fixes 2016-06-08 00:43:39 +10:00
Kyle De'Vir
92f5150a01 Revert "Revert "Corrected errors in Perspective function""
This reverts commit 743d03451d.
2016-06-08 00:39:30 +10:00
Kyle De'Vir
743d03451d Revert "Corrected errors in Perspective function"
This reverts commit 136b049106.
2016-06-08 00:38:27 +10:00
Kyle De'Vir
b4eff02912 Trimmed HMM_Rotate a bit further 2016-06-08 00:37:07 +10:00
Kyle De'Vir
46ce164880 Modified HMM_Rotate 2016-06-08 00:08:16 +10:00
Kyle De'Vir
60d035692b Added Wikipedia reference for HMM_FastInverseSquareRoot 2016-06-05 20:19:59 +10:00
Kyle De'Vir
a1f4117d4b Fixed Rotate function and precomputed SinTheta and CosTheta 2016-06-05 19:57:25 +10:00
Kyle De'Vir
693551b11a Fixed Rotate function and precomputed SinTheta and CosTheta 2016-06-05 18:02:55 +10:00
Kyle De'Vir
f8ef00f23d Added f suffix to HMM_PI 2016-06-05 17:36:40 +10:00
Kyle De'Vir
c3fdab8ff2 Translate function - removed redundant 1.0f 2016-06-04 20:28:12 +10:00