Пример #1
0
        public void PlaneCreateFromVerticesTest()
        {
            Vector3 point1 = new Vector3(0.0f, 1.0f, 1.0f);
            Vector3 point2 = new Vector3(0.0f, 0.0f, 1.0f);
            Vector3 point3 = new Vector3(1.0f, 0.0f, 1.0f);

            Plane target   = Plane.CreateFromVertices(point1, point2, point3);
            Plane expected = new Plane(new Vector3(0, 0, 1), -1.0f);

            Assert.Equal(target, expected);
        }
Пример #2
0
        public void PlaneCreateFromVerticesTest2()
        {
            Vector3 point1 = new Vector3(0.0f, 0.0f, 1.0f);
            Vector3 point2 = new Vector3(1.0f, 0.0f, 0.0f);
            Vector3 point3 = new Vector3(1.0f, 1.0f, 0.0f);

            Plane  target   = Plane.CreateFromVertices(point1, point2, point3);
            Single invRoot2 = (Single)(1 / Math.Sqrt(2));

            Plane expected = new Plane(new Vector3(invRoot2, 0, invRoot2), -invRoot2);

            Assert.True(MathHelper.Equal(target, expected), "Plane.cstor did not return the expected value.");
        }