Camera2DScreenSpaceTests LoopingToAndFromPixelSpaceLeavesAPointUnchanged Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.ScreenSpaces
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void LoopingToAndFromPixelSpaceLeavesAPointUnchanged()
Examples

[Test]
public void LoopingToAndFromPixelSpaceLeavesAPointUnchanged()
{
    var camera = new Camera2DScreenSpace(window)
    {
        LookAt = new Vector2D(-0.5f, 0.6f),
        Zoom = 3.0f
    };
    Assert.IsTrue(
        camera.ToPixelSpace(camera.FromPixelSpace(new Vector2D(1.2f, 3.4f))).IsNearlyEqual(
            new Vector2D(1.2f, 3.4f)));
    Assert.IsTrue(
        camera.FromPixelSpace(camera.ToPixelSpace(new Vector2D(1.2f, 3.4f))).IsNearlyEqual(
            new Vector2D(1.2f, 3.4f)));
}
See Also