| Index: cc/math_util_unittest.cc
|
| diff --git a/cc/math_util_unittest.cc b/cc/math_util_unittest.cc
|
| index c9daf9c12704f345aa881d92bd4d643c65d58894..0aa05234bb0bc0a1954ff670faba50eaa5d9298e 100644
|
| --- a/cc/math_util_unittest.cc
|
| +++ b/cc/math_util_unittest.cc
|
| @@ -21,27 +21,27 @@ TEST(MathUtilTest, verifyBackfaceVisibilityBasicCases)
|
| gfx::Transform transform;
|
|
|
| transform.MakeIdentity();
|
| - EXPECT_FALSE(MathUtil::isBackFaceVisible(transform));
|
| + EXPECT_FALSE(transform.IsBackFaceVisible());
|
|
|
| transform.MakeIdentity();
|
| MathUtil::rotateEulerAngles(&transform, 0, 80, 0);
|
| - EXPECT_FALSE(MathUtil::isBackFaceVisible(transform));
|
| + EXPECT_FALSE(transform.IsBackFaceVisible());
|
|
|
| transform.MakeIdentity();
|
| MathUtil::rotateEulerAngles(&transform, 0, 100, 0);
|
| - EXPECT_TRUE(MathUtil::isBackFaceVisible(transform));
|
| + EXPECT_TRUE(transform.IsBackFaceVisible());
|
|
|
| // Edge case, 90 degree rotation should return false.
|
| transform.MakeIdentity();
|
| MathUtil::rotateEulerAngles(&transform, 0, 90, 0);
|
| - EXPECT_FALSE(MathUtil::isBackFaceVisible(transform));
|
| + EXPECT_FALSE(transform.IsBackFaceVisible());
|
| }
|
|
|
| TEST(MathUtilTest, verifyBackfaceVisibilityForPerspective)
|
| {
|
| gfx::Transform layerSpaceToProjectionPlane;
|
|
|
| - // This tests if isBackFaceVisible works properly under perspective transforms.
|
| + // This tests if IsBackFaceVisible works properly under perspective transforms.
|
| // Specifically, layers that may have their back face visible in orthographic
|
| // projection, may not actually have back face visible under perspective projection.
|
|
|
| @@ -52,7 +52,7 @@ TEST(MathUtilTest, verifyBackfaceVisibilityForPerspective)
|
| layerSpaceToProjectionPlane.ApplyPerspectiveDepth(1);
|
| layerSpaceToProjectionPlane.Translate3d(0, 0, 0);
|
| MathUtil::rotateEulerAngles(&layerSpaceToProjectionPlane, 0, 100, 0);
|
| - EXPECT_TRUE(MathUtil::isBackFaceVisible(layerSpaceToProjectionPlane));
|
| + EXPECT_TRUE(layerSpaceToProjectionPlane.IsBackFaceVisible());
|
|
|
| // Case 2: Layer is rotated by slightly more than 90 degrees, but shifted off to the
|
| // side of the camera. Because of the wide field-of-view, the layer's front
|
| @@ -72,12 +72,12 @@ TEST(MathUtilTest, verifyBackfaceVisibilityForPerspective)
|
| layerSpaceToProjectionPlane.ApplyPerspectiveDepth(1);
|
| layerSpaceToProjectionPlane.Translate3d(-10, 0, 0);
|
| MathUtil::rotateEulerAngles(&layerSpaceToProjectionPlane, 0, 100, 0);
|
| - EXPECT_FALSE(MathUtil::isBackFaceVisible(layerSpaceToProjectionPlane));
|
| + EXPECT_FALSE(layerSpaceToProjectionPlane.IsBackFaceVisible());
|
|
|
| // Case 3: Additionally rotating the layer by 180 degrees should of course show the
|
| // opposite result of case 2.
|
| MathUtil::rotateEulerAngles(&layerSpaceToProjectionPlane, 0, 180, 0);
|
| - EXPECT_TRUE(MathUtil::isBackFaceVisible(layerSpaceToProjectionPlane));
|
| + EXPECT_TRUE(layerSpaceToProjectionPlane.IsBackFaceVisible());
|
| }
|
|
|
| TEST(MathUtilTest, verifyProjectionOfPerpendicularPlane)
|
| @@ -727,13 +727,104 @@ TEST(MathUtilGfxTransformTest, verifyRotateEulerAnglesOrderOfCompositeRotations)
|
| EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| }
|
|
|
| -TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForAlignedAxes)
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutXAxis)
|
| +{
|
| + gfx::Transform A;
|
| + double sin45 = 0.5 * sqrt(2.0);
|
| + double cos45 = sin45;
|
| +
|
| + A.MakeIdentity();
|
| + A.RotateAboutXAxis(90);
|
| + EXPECT_ROW1_EQ(1, 0, 0, 0, A);
|
| + EXPECT_ROW2_NEAR(0, 0, -1, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_NEAR(0, 1, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + A.MakeIdentity();
|
| + A.RotateAboutXAxis(45);
|
| + EXPECT_ROW1_EQ(1, 0, 0, 0, A);
|
| + EXPECT_ROW2_NEAR(0, cos45, -sin45, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_NEAR(0, sin45, cos45, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + // Verify that rotateAboutXAxis(angle) post-multiplies the existing matrix.
|
| + A.MakeIdentity();
|
| + A.Scale3d(6, 7, 8);
|
| + A.RotateAboutXAxis(90);
|
| + EXPECT_ROW1_NEAR(6, 0, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_NEAR(0, 0, -7, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_NEAR(0, 8, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +}
|
| +
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutYAxis)
|
| +{
|
| + gfx::Transform A;
|
| + double sin45 = 0.5 * sqrt(2.0);
|
| + double cos45 = sin45;
|
| +
|
| + // Note carefully, the expected pattern is inverted compared to rotating about x axis or z axis.
|
| + A.MakeIdentity();
|
| + A.RotateAboutYAxis(90);
|
| + EXPECT_ROW1_NEAR(0, 0, 1, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_EQ(0, 1, 0, 0, A);
|
| + EXPECT_ROW3_NEAR(-1, 0, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + A.MakeIdentity();
|
| + A.RotateAboutYAxis(45);
|
| + EXPECT_ROW1_NEAR(cos45, 0, sin45, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_EQ(0, 1, 0, 0, A);
|
| + EXPECT_ROW3_NEAR(-sin45, 0, cos45, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + // Verify that rotateAboutYAxis(angle) post-multiplies the existing matrix.
|
| + A.MakeIdentity();
|
| + A.Scale3d(6, 7, 8);
|
| + A.RotateAboutYAxis(90);
|
| + EXPECT_ROW1_NEAR(0, 0, 6, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_NEAR(0, 7, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_NEAR(-8, 0, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +}
|
| +
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutZAxis)
|
| +{
|
| + gfx::Transform A;
|
| + double sin45 = 0.5 * sqrt(2.0);
|
| + double cos45 = sin45;
|
| +
|
| + A.MakeIdentity();
|
| + A.RotateAboutZAxis(90);
|
| + EXPECT_ROW1_NEAR(0, -1, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_NEAR(1, 0, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_EQ(0, 0, 1, 0, A);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + A.MakeIdentity();
|
| + A.RotateAboutZAxis(45);
|
| + EXPECT_ROW1_NEAR(cos45, -sin45, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_NEAR(sin45, cos45, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_EQ(0, 0, 1, 0, A);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +
|
| + // Verify that rotateAboutZAxis(angle) post-multiplies the existing matrix.
|
| + A.MakeIdentity();
|
| + A.Scale3d(6, 7, 8);
|
| + A.RotateAboutZAxis(90);
|
| + EXPECT_ROW1_NEAR(0, -6, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW2_NEAR(7, 0, 0, 0, A, ERROR_THRESHOLD);
|
| + EXPECT_ROW3_EQ(0, 0, 8, 0, A);
|
| + EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| +}
|
| +
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutForAlignedAxes)
|
| {
|
| gfx::Transform A;
|
|
|
| // Check rotation about z-axis
|
| A.MakeIdentity();
|
| - MathUtil::rotateAxisAngle(&A, 0, 0, 1, 90);
|
| + A.RotateAbout(gfx::Vector3dF(0, 0, 1), 90);
|
| EXPECT_ROW1_NEAR(0, -1, 0, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW2_NEAR(1, 0, 0, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW3_EQ(0, 0, 1, 0, A);
|
| @@ -741,7 +832,7 @@ TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForAlignedAxes)
|
|
|
| // Check rotation about x-axis
|
| A.MakeIdentity();
|
| - MathUtil::rotateAxisAngle(&A, 1, 0, 0, 90);
|
| + A.RotateAbout(gfx::Vector3dF(1, 0, 0), 90);
|
| EXPECT_ROW1_EQ(1, 0, 0, 0, A);
|
| EXPECT_ROW2_NEAR(0, 0, -1, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW3_NEAR(0, 1, 0, 0, A, ERROR_THRESHOLD);
|
| @@ -750,7 +841,7 @@ TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForAlignedAxes)
|
| // Check rotation about y-axis.
|
| // Note carefully, the expected pattern is inverted compared to rotating about x axis or z axis.
|
| A.MakeIdentity();
|
| - MathUtil::rotateAxisAngle(&A, 0, 1, 0, 90);
|
| + A.RotateAbout(gfx::Vector3dF(0, 1, 0), 90);
|
| EXPECT_ROW1_NEAR(0, 0, 1, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW2_EQ(0, 1, 0, 0, A);
|
| EXPECT_ROW3_NEAR(-1, 0, 0, 0, A, ERROR_THRESHOLD);
|
| @@ -759,18 +850,18 @@ TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForAlignedAxes)
|
| // Verify that rotate3d(axis, angle) post-multiplies the existing matrix.
|
| A.MakeIdentity();
|
| A.Scale3d(6, 7, 8);
|
| - MathUtil::rotateAxisAngle(&A, 0, 0, 1, 90);
|
| + A.RotateAboutZAxis(90);
|
| EXPECT_ROW1_NEAR(0, -6, 0, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW2_NEAR(7, 0, 0, 0, A, ERROR_THRESHOLD);
|
| EXPECT_ROW3_EQ(0, 0, 8, 0, A);
|
| EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| }
|
|
|
| -TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForArbitraryAxis)
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutForArbitraryAxis)
|
| {
|
| // Check rotation about an arbitrary non-axis-aligned vector.
|
| gfx::Transform A;
|
| - MathUtil::rotateAxisAngle(&A, 1, 1, 1, 90);
|
| + A.RotateAbout(gfx::Vector3dF(1, 1, 1), 90);
|
| EXPECT_ROW1_NEAR(0.3333333333333334258519187,
|
| -0.2440169358562924717404030,
|
| 0.9106836025229592124219380,
|
| @@ -786,18 +877,18 @@ TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForArbitraryAxis)
|
| EXPECT_ROW4_EQ(0, 0, 0, 1, A);
|
| }
|
|
|
| -TEST(MathUtilGfxTransformTest, verifyRotateAxisAngleForDegenerateAxis)
|
| +TEST(MathUtilGfxTransformTest, verifyRotateAboutForDegenerateAxis)
|
| {
|
| // Check rotation about a degenerate zero vector.
|
| // It is expected to skip applying the rotation.
|
| gfx::Transform A;
|
|
|
| - MathUtil::rotateAxisAngle(&A, 0, 0, 0, 45);
|
| + A.RotateAbout(gfx::Vector3dF(0, 0, 0), 45);
|
| // Verify that A remains unchanged.
|
| EXPECT_TRUE(A.IsIdentity());
|
|
|
| initializeTestMatrix(&A);
|
| - MathUtil::rotateAxisAngle(&A, 0, 0, 0, 35);
|
| + A.RotateAbout(gfx::Vector3dF(0, 0, 0), 35);
|
|
|
| // Verify that A remains unchanged.
|
| EXPECT_ROW1_EQ(10, 14, 18, 22, A);
|
| @@ -869,31 +960,31 @@ TEST(MathUtilGfxTransformTest, verifyHasPerspective)
|
| {
|
| gfx::Transform A;
|
| A.ApplyPerspectiveDepth(1);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.ApplyPerspectiveDepth(0);
|
| - EXPECT_FALSE(MathUtil::hasPerspective(A));
|
| + EXPECT_FALSE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 0, -1);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 1, -1);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 2, -0.3);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 3, 0.5);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 3, 0);
|
| - EXPECT_TRUE(MathUtil::hasPerspective(A));
|
| + EXPECT_TRUE(A.HasPerspective());
|
| }
|
|
|
| TEST(MathUtilGfxTransformTest, verifyIsInvertible)
|
| @@ -1033,80 +1124,166 @@ TEST(MathUtilGfxTransformTest, verifyIsIdentityOrTranslation)
|
| gfx::Transform A;
|
|
|
| initializeTestMatrix(&A);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
|
|
| A.MakeIdentity();
|
| - EXPECT_TRUE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsIdentityOrTranslation());
|
|
|
| - // Modifying any non-translation components should cause isIdentityOrTranslation() to
|
| + // Modifying any non-translation components should cause IsIdentityOrTranslation() to
|
| // return false. NOTE: (0, 3), (1, 3), and (2, 3) are the translation components, so
|
| - // modifying them should still return true for isIdentityOrTranslation().
|
| + // modifying them should still return true.
|
| A.MakeIdentity();
|
| A.matrix().setDouble(0, 0, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(1, 0, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(2, 0, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 0, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(0, 1, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
|
|
| A.MakeIdentity();
|
| + A.matrix().setDouble(1, 1, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(2, 1, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(3, 1, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(0, 2, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(1, 2, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(2, 2, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(3, 2, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +
|
| + // Note carefully - expecting true here.
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(0, 3, 2);
|
| + EXPECT_TRUE(A.IsIdentityOrTranslation());
|
| +
|
| + // Note carefully - expecting true here.
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(1, 3, 2);
|
| + EXPECT_TRUE(A.IsIdentityOrTranslation());
|
| +
|
| + // Note carefully - expecting true here.
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(2, 3, 2);
|
| + EXPECT_TRUE(A.IsIdentityOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(3, 3, 2);
|
| + EXPECT_FALSE(A.IsIdentityOrTranslation());
|
| +}
|
| +
|
| +TEST(MathUtilGfxTransformTest, verifyIsScaleOrTranslation)
|
| +{
|
| + gfx::Transform A;
|
| +
|
| + initializeTestMatrix(&A);
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
| +
|
| + // Modifying any non-scale or non-translation components should cause
|
| + // IsScaleOrTranslation() to return false. (0, 0), (1, 1), (2, 2), (0, 3),
|
| + // (1, 3), and (2, 3) are the scale and translation components, so
|
| + // modifying them should still return true.
|
| +
|
| + // Note carefully - expecting true here.
|
| + A.MakeIdentity();
|
| A.matrix().setDouble(0, 0, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(1, 0, 2);
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| + A.matrix().setDouble(2, 0, 2);
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(3, 0, 2);
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
| +
|
| + A.MakeIdentity();
|
| + A.matrix().setDouble(0, 1, 2);
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
| +
|
| + // Note carefully - expecting true here.
|
| + A.MakeIdentity();
|
| A.matrix().setDouble(1, 1, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(2, 1, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 1, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(0, 2, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(1, 2, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| + // Note carefully - expecting true here.
|
| A.MakeIdentity();
|
| A.matrix().setDouble(2, 2, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 2, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
|
|
| // Note carefully - expecting true here.
|
| A.MakeIdentity();
|
| A.matrix().setDouble(0, 3, 2);
|
| - EXPECT_TRUE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
|
|
| // Note carefully - expecting true here.
|
| A.MakeIdentity();
|
| A.matrix().setDouble(1, 3, 2);
|
| - EXPECT_TRUE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
|
|
| // Note carefully - expecting true here.
|
| A.MakeIdentity();
|
| A.matrix().setDouble(2, 3, 2);
|
| - EXPECT_TRUE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_TRUE(A.IsScaleOrTranslation());
|
|
|
| A.MakeIdentity();
|
| A.matrix().setDouble(3, 3, 2);
|
| - EXPECT_FALSE(MathUtil::isIdentityOrTranslation(A));
|
| + EXPECT_FALSE(A.IsScaleOrTranslation());
|
| }
|
|
|
| } // namespace
|
|
|