public void GetWidthAndHeightTest() { float width, height; PerspectiveViewVolume.GetWidthAndHeight(MathHelper.ToRadians(90), 1, 1, out width, out height); Assert.IsTrue(Numeric.AreEqual(2, width)); Assert.IsTrue(Numeric.AreEqual(2, height)); PerspectiveViewVolume.GetWidthAndHeight(MathHelper.ToRadians(60), 16.0f / 9.0f, 1, out width, out height); Assert.IsTrue(Numeric.AreEqual(2.0528009f, width)); Assert.IsTrue(Numeric.AreEqual(1.1547005f, height)); }
public void GetWidthAndHeightTest() { float width, height; PerspectiveViewVolume.GetWidthAndHeight(MathHelper.ToRadians(90), 1, 1, out width, out height); Assert.IsTrue(Numeric.AreEqual(2, width)); Assert.IsTrue(Numeric.AreEqual(2, height)); PerspectiveViewVolume.GetWidthAndHeight(MathHelper.ToRadians(60), 16.0f / 9.0f, 1, out width, out height); Assert.IsTrue(Numeric.AreEqual(2.0528009f, width)); Assert.IsTrue(Numeric.AreEqual(1.1547005f, height)); // We are pretty confident that the Projection.CreateProjectionXxx() works. // Use Projection.CreateProjectionXxx() to test GetWidthAndHeight(). Matrix44F projection = Matrix44F.CreatePerspectiveFieldOfView(MathHelper.ToRadians(60), 16.0f / 9.0f, 1, 10); Matrix44F projection2 = Matrix44F.CreatePerspective(width, height, 1, 10); Assert.IsTrue(Matrix44F.AreNumericallyEqual(projection, projection2)); }
public void GetWidthAndHeightException3() { float width, height; PerspectiveViewVolume.GetWidthAndHeight(MathHelper.ToRadians(90), 1, -0.1f, out width, out height); }
public void GetWidthAndHeightException() { float width, height; PerspectiveViewVolume.GetWidthAndHeight(-0.1f, 1, 1, out width, out height); }