LookAtCamera Zoom Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering3D.Cameras
Assembly: DeltaEngine.Rendering3D (in DeltaEngine.Rendering3D.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void Zoom(
	float amount
)
Remarks

Tests: DeltaEngine.Rendering3D.Tests.Cameras.LookAtCameraTests
Examples

3 unit tests call DeltaEngine.Rendering3D.Cameras.LookAtCamera.Zoom(System.Single)
[Test, CloseAfterFirstFrame]
public void ZoomTowardTheTarget()
{
    var camera = CreateLookAtCamera(Vector3D.UnitX * 2.0f, Vector3D.Zero);
    camera.Zoom(1.0f);
    Assert.AreEqual(Vector3D.UnitX, camera.Position);
}
[Test, CloseAfterFirstFrame]
public void ZoomOutwardTheTarget()
{
    var camera = CreateLookAtCamera(Vector3D.UnitX, Vector3D.Zero);
    camera.Zoom(-1.0f);
    Assert.AreEqual(Vector3D.UnitX * 2.0f, camera.Position);
}
[Test, CloseAfterFirstFrame]
public void OverZoomTowardTheTarget()
{
    var camera = CreateLookAtCamera(Vector3D.UnitX * 3.0f, Vector3D.Zero);
    camera.Zoom(100.0f);
    Assert.IsTrue(camera.Position.IsNearlyEqual(Vector3D.Zero));
}
See Also