Compare commits

..

8 Commits

Author SHA1 Message Date
strangezak
3908aa6a10 Updated Docs 2021-03-14 18:29:07 -07:00
Zakary Strange
d0ae200589 Fix comment location 2021-03-11 11:54:36 -08:00
strangezak
30633daa77 Inline all functions 2021-03-11 11:52:05 -08:00
Zak Strange
1f0c6ba493 Update Docs. 2021-03-09 16:37:00 -08:00
Zak Strange
1d82b4f0bc Unary minus vectors (#130)
* Unary Minus operator for vec2, vec3, and vec4

* Update README.md

Co-authored-by: zak <zak@DESKTOP-V1AQ0IT>
2021-03-06 18:39:17 -06:00
Zak Strange
2fa0b36715 Add HMM_STATIC option to statically link instead of extern (#127)
Co-authored-by: zak <zak@DESKTOP-V1AQ0IT>
2021-02-17 19:36:05 -08:00
Ben Visness
ad169e649c Make HMM_Clamp branchless in optimized builds (#122) 2020-12-22 11:19:58 -06:00
Zak Strange
1900cc9275 Updated email in HandmadeMath.h 2020-07-09 18:22:22 -07:00
3 changed files with 3200 additions and 3239 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,8 @@ To get started, go download [the latest release](https://github.com/HandmadeMath
Version | Changes | Version | Changes |
----------------|----------------| ----------------|----------------|
**1.13.0** | Inline all Handmade Math functions. Remove need for HANDMADE_MATH_IMPLEMENTATION |
**1.11.1** | Added HMM_PREFIX macro to a few functions that were missing it. | **1.11.1** | Added HMM_PREFIX macro to a few functions that were missing it. |
**1.11.0** | Added ability to customize or remove the default `HMM_` prefix on function names by defining a macro called `HMM_PREFIX(name)`. | **1.11.0** | Added ability to customize or remove the default `HMM_` prefix on function names by defining a macro called `HMM_PREFIX(name)`. |
**1.10.1** | Removed stdint.h, this doesn't exist on some really old compilers and we didn't really use it anyways. | **1.10.1** | Removed stdint.h, this doesn't exist on some really old compilers and we didn't really use it anyways. |

View File

@@ -199,3 +199,32 @@ TEST(Subtraction, Quaternion)
EXPECT_FLOAT_EQ(q1.W, -4.0f); EXPECT_FLOAT_EQ(q1.W, -4.0f);
#endif #endif
} }
#ifdef __cplusplus
TEST(UnaryMinus, Vec2)
{
hmm_vec2 VectorOne = {1.0f, 2.0f};
hmm_vec2 Result = -VectorOne;
EXPECT_FLOAT_EQ(Result.X, -1.0f);
EXPECT_FLOAT_EQ(Result.Y, -2.0f);
}
TEST(UnaryMinus, Vec3)
{
hmm_vec3 VectorOne = {1.0f, 2.0f, 3.0f};
hmm_vec3 Result = -VectorOne;
EXPECT_FLOAT_EQ(Result.X, -1.0f);
EXPECT_FLOAT_EQ(Result.Y, -2.0f);
EXPECT_FLOAT_EQ(Result.Z, -3.0f);
}
TEST(UnaryMinus, Vec4)
{
hmm_vec4 VectorOne = {1.0f, 2.0f, 3.0f, 4.0f};
hmm_vec4 Result = -VectorOne;
EXPECT_FLOAT_EQ(Result.X, -1.0f);
EXPECT_FLOAT_EQ(Result.Y, -2.0f);
EXPECT_FLOAT_EQ(Result.Z, -3.0f);
EXPECT_FLOAT_EQ(Result.W, -4.0f);
}
#endif