Esempio n. 1
0
        public void ShadowTest()
        {
            Vector4 light = Utilities.GenerateVector4();
            light.W = 0f;
            Plane plane = Utilities.GeneratePlane();
            plane.Normalize();

            Microsoft.DirectX.Matrix temp = new Microsoft.DirectX.Matrix();
            temp.Shadow(Utilities.ConvertToMdx(light), Utilities.ConvertToMdx(plane));
            Matrix expected = Utilities.ConvertFrom(temp);

            Matrix actual;
            actual = Matrix.Shadow(light, plane);
            Utilities.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void ShadowByRefTest()
        {
            Vector4 light = Utilities.GenerateVector4();
            Vector4 lightExpected = light;
            Plane plane = Utilities.GeneratePlane();
            plane.Normalize();
            Plane planeExpected = plane;
            Matrix result;

            Microsoft.DirectX.Matrix temp = new Microsoft.DirectX.Matrix();
            temp.Shadow(Utilities.ConvertToMdx(light), Utilities.ConvertToMdx(plane));
            Matrix resultExpected = Utilities.ConvertFrom(temp);

            Matrix.Shadow(ref light, ref plane, out result);
            Utilities.AreEqual(lightExpected, light);
            Utilities.AreEqual(planeExpected, plane);
            Utilities.AreEqual(resultExpected, result);
        }