mirror of
https://github.com/HandmadeMath/HandmadeMath.git
synced 2025-12-29 16:04:33 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3908aa6a10 | ||
|
|
d0ae200589 | ||
|
|
30633daa77 | ||
|
|
1f0c6ba493 | ||
|
|
1d82b4f0bc | ||
|
|
2fa0b36715 | ||
|
|
ad169e649c | ||
|
|
1900cc9275 | ||
|
|
ddb9971e71 | ||
|
|
341a376a17 |
6408
HandmadeMath.h
6408
HandmadeMath.h
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,9 @@ 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.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. |
|
||||||
**1.10.0** | Made HMM_Perspective use vertical FOV instead of horizontal FOV for consistency with other graphics APIs. |
|
**1.10.0** | Made HMM_Perspective use vertical FOV instead of horizontal FOV for consistency with other graphics APIs. |
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user