| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6124867 commit b46f7c7
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -819,11 +819,38 @@ public void Matrix4x4CreateReflectionTest01() | |||
| 819 | 819 | Vector3 v = point - pp; | |
| 820 | 820 | float d = Vector3.Dot(v, plane.Normal); | |
| 821 | 821 | Vector3 vp = point - 2.0f * d * plane.Normal; | |
| 822 | - Assert.True(MathHelper.Equal(rp, vp), "Matrix4x4.Reflection did not provide expected value."); | ||
| 822 | + Assert.True(MathHelper.Equal(rp, vp), "Matrix4x4.CreateReflection did not provide expected value."); | ||
| 823 | 823 | } | |
| 824 | 824 | } | |
| 825 | 825 | } | |
| 826 | 826 | ||
| 827 | + [Fact] | ||
| 828 | + public void Matrix4x4CreateReflectionTest02() | ||
| 829 | + { | ||
| 830 | + Plane plane = new Plane(0, 1, 0, 60); | ||
| 831 | + Matrix4x4 actual = Matrix4x4.CreateReflection(plane); | ||
| 832 | + | ||
| 833 | + AssertExtensions.Equal(1.0f, actual.M11, 0.0f); | ||
| 834 | + AssertExtensions.Equal(0.0f, actual.M12, 0.0f); | ||
| 835 | + AssertExtensions.Equal(0.0f, actual.M13, 0.0f); | ||
| 836 | + AssertExtensions.Equal(0.0f, actual.M14, 0.0f); | ||
| 837 | + | ||
| 838 | + AssertExtensions.Equal(0.0f, actual.M21, 0.0f); | ||
| 839 | + AssertExtensions.Equal(-1.0f, actual.M22, 0.0f); | ||
| 840 | + AssertExtensions.Equal(0.0f, actual.M23, 0.0f); | ||
| 841 | + AssertExtensions.Equal(0.0f, actual.M24, 0.0f); | ||
| 842 | + | ||
| 843 | + AssertExtensions.Equal(0.0f, actual.M31, 0.0f); | ||
| 844 | + AssertExtensions.Equal(0.0f, actual.M32, 0.0f); | ||
| 845 | + AssertExtensions.Equal(1.0f, actual.M33, 0.0f); | ||
| 846 | + AssertExtensions.Equal(0.0f, actual.M34, 0.0f); | ||
| 847 | + | ||
| 848 | + AssertExtensions.Equal(0.0f, actual.M41, 0.0f); | ||
| 849 | + AssertExtensions.Equal(-120.0f, actual.M42, 0.0f); | ||
| 850 | + AssertExtensions.Equal(0.0f, actual.M43, 0.0f); | ||
| 851 | + AssertExtensions.Equal(1.0f, actual.M44, 0.0f); | ||
| 852 | + } | ||
| 853 | + | ||
| 827 | 854 | // A test for CreateRotationZ (float) | |
| 828 | 855 | [Fact] | |
| 829 | 856 | public void Matrix4x4CreateRotationZTest() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -620,7 +620,7 @@ public static Impl CreateReflection(in Plane value) | |||
| 620 | 620 | // https://github.com/microsoft/DirectXMath/blob/master/Inc/DirectXMathMatrix.inl | |
| 621 | 621 | ||
| 622 | 622 | Vector4 p = Plane.Normalize(value).AsVector4(); | |
| 623 | - Vector4 s = p * -2.0f; | ||
| 623 | + Vector4 s = p * Vector4.Create(-2.0f, -2.0f, -2.0f, 0.0f); | ||
| 624 | 624 | ||
| 625 | 625 | Impl result; | |
| 626 | 626 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments