Change naming convention for NO/ZO (the update tool needs updating)

This commit is contained in:
Ben Visness
2023-01-26 22:27:09 -06:00
parent d4918a514e
commit 22d743ce3d
3 changed files with 40 additions and 40 deletions

View File

@@ -1697,10 +1697,10 @@ static inline HMM_Mat4 HMM_InvGeneralM4(HMM_Mat4 Matrix)
* Common graphics transformations
*/
COVERAGE(HMM_Orthographic_N0_RH, 1)
static inline HMM_Mat4 HMM_Orthographic_N0_RH(float Left, float Right, float Bottom, float Top, float Near, float Far)
COVERAGE(HMM_Orthographic_RH_NO, 1)
static inline HMM_Mat4 HMM_Orthographic_RH_NO(float Left, float Right, float Bottom, float Top, float Near, float Far)
{
ASSERT_COVERED(HMM_Orthographic_N0_RH);
ASSERT_COVERED(HMM_Orthographic_RH_NO);
HMM_Mat4 Result = {0};
@@ -1717,10 +1717,10 @@ static inline HMM_Mat4 HMM_Orthographic_N0_RH(float Left, float Right, float Bot
return Result;
}
COVERAGE(HMM_Orthographic_Z0_RH, 1)
static inline HMM_Mat4 HMM_Orthographic_Z0_RH(float Left, float Right, float Bottom, float Top, float Near, float Far)
COVERAGE(HMM_Orthographic_RH_ZO, 1)
static inline HMM_Mat4 HMM_Orthographic_RH_ZO(float Left, float Right, float Bottom, float Top, float Near, float Far)
{
ASSERT_COVERED(HMM_Orthographic_Z0_RH);
ASSERT_COVERED(HMM_Orthographic_RH_ZO);
HMM_Mat4 Result = {0};
@@ -1737,23 +1737,23 @@ static inline HMM_Mat4 HMM_Orthographic_Z0_RH(float Left, float Right, float Bot
return Result;
}
COVERAGE(HMM_Orthographic_N0_LH, 1)
static inline HMM_Mat4 HMM_Orthographic_N0_LH(float Left, float Right, float Bottom, float Top, float Near, float Far)
COVERAGE(HMM_Orthographic_LH_NO, 1)
static inline HMM_Mat4 HMM_Orthographic_LH_NO(float Left, float Right, float Bottom, float Top, float Near, float Far)
{
ASSERT_COVERED(HMM_Orthographic_N0_LH);
ASSERT_COVERED(HMM_Orthographic_LH_NO);
HMM_Mat4 Result = HMM_Orthographic_N0_RH(Left, Right, Bottom, Top, Near, Far);
HMM_Mat4 Result = HMM_Orthographic_RH_NO(Left, Right, Bottom, Top, Near, Far);
Result.Elements[2][2] = -Result.Elements[2][2];
return Result;
}
COVERAGE(HMM_Orthographic_Z0_LH, 1)
static inline HMM_Mat4 HMM_Orthographic_Z0_LH(float Left, float Right, float Bottom, float Top, float Near, float Far)
COVERAGE(HMM_Orthographic_LH_ZO, 1)
static inline HMM_Mat4 HMM_Orthographic_LH_ZO(float Left, float Right, float Bottom, float Top, float Near, float Far)
{
ASSERT_COVERED(HMM_Orthographic_Z0_LH);
ASSERT_COVERED(HMM_Orthographic_LH_ZO);
HMM_Mat4 Result = HMM_Orthographic_Z0_RH(Left, Right, Bottom, Top, Near, Far);
HMM_Mat4 Result = HMM_Orthographic_RH_ZO(Left, Right, Bottom, Top, Near, Far);
Result.Elements[2][2] = -Result.Elements[2][2];
return Result;
@@ -1777,10 +1777,10 @@ static inline HMM_Mat4 HMM_InvOrthographic(HMM_Mat4 OrthoMatrix)
return Result;
}
COVERAGE(HMM_Perspective_N0_RH, 1)
static inline HMM_Mat4 HMM_Perspective_N0_RH(float FOV, float AspectRatio, float Near, float Far)
COVERAGE(HMM_Perspective_RH_NO, 1)
static inline HMM_Mat4 HMM_Perspective_RH_NO(float FOV, float AspectRatio, float Near, float Far)
{
ASSERT_COVERED(HMM_Perspective_N0_RH);
ASSERT_COVERED(HMM_Perspective_RH_NO);
HMM_Mat4 Result = {0};
@@ -1797,10 +1797,10 @@ static inline HMM_Mat4 HMM_Perspective_N0_RH(float FOV, float AspectRatio, float
return Result;
}
COVERAGE(HMM_Perspective_Z0_RH, 1)
static inline HMM_Mat4 HMM_Perspective_Z0_RH(float FOV, float AspectRatio, float Near, float Far)
COVERAGE(HMM_Perspective_RH_ZO, 1)
static inline HMM_Mat4 HMM_Perspective_RH_ZO(float FOV, float AspectRatio, float Near, float Far)
{
ASSERT_COVERED(HMM_Perspective_Z0_RH);
ASSERT_COVERED(HMM_Perspective_RH_ZO);
HMM_Mat4 Result = {0};
@@ -1817,24 +1817,24 @@ static inline HMM_Mat4 HMM_Perspective_Z0_RH(float FOV, float AspectRatio, float
return Result;
}
COVERAGE(HMM_Perspective_N0_LH, 1)
static inline HMM_Mat4 HMM_Perspective_N0_LH(float FOV, float AspectRatio, float Near, float Far)
COVERAGE(HMM_Perspective_LH_NO, 1)
static inline HMM_Mat4 HMM_Perspective_LH_NO(float FOV, float AspectRatio, float Near, float Far)
{
ASSERT_COVERED(HMM_Perspective_N0_LH);
ASSERT_COVERED(HMM_Perspective_LH_NO);
HMM_Mat4 Result = HMM_Perspective_N0_RH(FOV, AspectRatio, Near, Far);
HMM_Mat4 Result = HMM_Perspective_RH_NO(FOV, AspectRatio, Near, Far);
Result.Elements[2][2] = -Result.Elements[2][2];
Result.Elements[2][3] = -Result.Elements[2][3];
return Result;
}
COVERAGE(HMM_Perspective_Z0_LH, 1)
static inline HMM_Mat4 HMM_Perspective_Z0_LH(float FOV, float AspectRatio, float Near, float Far)
COVERAGE(HMM_Perspective_LH_ZO, 1)
static inline HMM_Mat4 HMM_Perspective_LH_ZO(float FOV, float AspectRatio, float Near, float Far)
{
ASSERT_COVERED(HMM_Perspective_Z0_LH);
ASSERT_COVERED(HMM_Perspective_LH_ZO);
HMM_Mat4 Result = HMM_Perspective_Z0_RH(FOV, AspectRatio, Near, Far);
HMM_Mat4 Result = HMM_Perspective_RH_ZO(FOV, AspectRatio, Near, Far);
Result.Elements[2][2] = -Result.Elements[2][2];
Result.Elements[2][3] = -Result.Elements[2][3];

View File

@@ -249,7 +249,7 @@ TEST(InvMatrix, InvGeneral)
TEST(InvMatrix, Mat4Inverses)
{
{
HMM_Mat4 Matrix = HMM_Orthographic_N0_RH(-160+100, 160+100, -90+200, 90+200, 10, 10000);
HMM_Mat4 Matrix = HMM_Orthographic_RH_NO(-160+100, 160+100, -90+200, 90+200, 10, 10000);
HMM_Mat4 Expect = HMM_M4D(1.0f);
HMM_Mat4 Inverse = HMM_InvOrthographic(Matrix);
HMM_Mat4 Result = HMM_MulM4(Matrix, Inverse);
@@ -275,7 +275,7 @@ TEST(InvMatrix, Mat4Inverses)
EXPECT_FLOAT_EQ(Result.Elements[3][3], Expect.Elements[3][3]);
}
{
HMM_Mat4 Matrix = HMM_Perspective_N0_RH(HMM_AngleDeg(120), 16.0/9.0, 10, 10000);
HMM_Mat4 Matrix = HMM_Perspective_RH_NO(HMM_AngleDeg(120), 16.0/9.0, 10, 10000);
HMM_Mat4 Expect = HMM_M4D(1.0f);
HMM_Mat4 Inverse = HMM_InvPerspective(Matrix);
HMM_Mat4 Result = HMM_MulM4(Matrix, Inverse);

View File

@@ -3,7 +3,7 @@
TEST(Projection, Orthographic)
{
{
HMM_Mat4 projection = HMM_Orthographic_N0_RH(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, 10.0f);
HMM_Mat4 projection = HMM_Orthographic_RH_NO(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, 10.0f);
HMM_Vec4 original = HMM_V4(5.0f, 5.0f, -1.0f, 1.0);
HMM_Vec4 projected = HMM_MulM4V4(projection, original);
@@ -13,12 +13,12 @@ TEST(Projection, Orthographic)
EXPECT_FLOAT_EQ(projected.W, 1.0f);
/* Z0 */
projection = HMM_Orthographic_Z0_RH(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
projection = HMM_Orthographic_RH_ZO(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.Z, 0.0f);
}
{
HMM_Mat4 projection = HMM_Orthographic_N0_LH(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
HMM_Mat4 projection = HMM_Orthographic_LH_NO(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
HMM_Vec4 original = HMM_V4(5.0f, 5.0f, 1.0f, 1.0);
HMM_Vec4 projected = HMM_MulM4V4(projection, original);
@@ -28,7 +28,7 @@ TEST(Projection, Orthographic)
EXPECT_FLOAT_EQ(projected.W, 1.0f);
/* Z0 */
projection = HMM_Orthographic_Z0_LH(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
projection = HMM_Orthographic_LH_ZO(-10.0f, 10.0f, -5.0f, 5.0f, 1.0f, -10.0f);
projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.Z, 0.0f);
}
@@ -37,7 +37,7 @@ TEST(Projection, Orthographic)
TEST(Projection, Perspective)
{
{
HMM_Mat4 projection = HMM_Perspective_N0_RH(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
HMM_Mat4 projection = HMM_Perspective_RH_NO(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
HMM_Vec4 original = HMM_V4(5.0f, 5.0f, -1.0f, 1.0f);
HMM_Vec4 projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.X, 2.5f);
@@ -45,14 +45,14 @@ TEST(Projection, Perspective)
EXPECT_FLOAT_EQ(projected.Z, -1.0f);
EXPECT_FLOAT_EQ(projected.W, 1.0f);
/* Z0 */
projection = HMM_Perspective_Z0_RH(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
/* ZO */
projection = HMM_Perspective_RH_ZO(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.Z, 0.0f);
}
{
HMM_Mat4 projection = HMM_Perspective_N0_LH(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
HMM_Mat4 projection = HMM_Perspective_LH_NO(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
HMM_Vec4 original = HMM_V4(5.0f, 5.0f, 1.0f, 1.0f);
HMM_Vec4 projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.X, 2.5f);
@@ -60,8 +60,8 @@ TEST(Projection, Perspective)
EXPECT_FLOAT_EQ(projected.Z, -1.0f);
EXPECT_FLOAT_EQ(projected.W, 1.0f);
/* Z0 */
projection = HMM_Perspective_Z0_LH(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
/* ZO */
projection = HMM_Perspective_LH_ZO(HMM_AngleDeg(90.0f), 2.0f, 1.0f, 15.0f);
projected = HMM_MulM4V4(projection, original);
EXPECT_FLOAT_EQ(projected.Z, 0.0f);
}