public void SetProjectionOffCenterTest() { OrthographicProjection projection = new OrthographicProjection(); projection.SetOffCenter(0, 4, 1, 4, 2, 10); OrthographicProjection camera2 = new OrthographicProjection(); camera2.SetOffCenter(0, 4, 1, 4); camera2.Near = 2; camera2.Far = 10; Projection camera3 = new OrthographicProjection { Left = 0, Right = 4, Bottom = 1, Top = 4, Near = 2, Far = 10, }; Matrix expected = Matrix.CreateOrthographicOffCenter(0, 4, 1, 4, 2, 10); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, projection)); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, camera2)); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, camera3.ToMatrix())); }
public void SetProjectionTest() { OrthographicProjection projection = new OrthographicProjection(); projection.Set(4, 3, 2, 10); OrthographicProjection camera2 = new OrthographicProjection(); camera2.Set(4, 3); camera2.Near = 2; camera2.Far = 10; OrthographicProjection camera3 = new OrthographicProjection { Left = -2, Right = 2, Bottom = -1.5f, Top = 1.5f, Near = 2, Far = 10, }; Matrix expected = Matrix.CreateOrthographic(4, 3, 2, 10); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, projection)); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, camera2)); Assert.IsTrue(Matrix.AreNumericallyEqual(expected, camera3.ToMatrix())); }