LookAtCamera Target Property Delta Engine Documentation

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

public override Vector3D Target { get; set; }

Property Value

Type: Vector3D
Remarks

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

6 unit tests call DeltaEngine.Rendering3D.Cameras.LookAtCamera.Target
[Test, CloseAfterFirstFrame]
public void PositionToTargetDistance()
{
    var camera = CreateLookAtCamera(Vector3D.UnitZ * 5.0f, Vector3D.Zero);
    Assert.AreEqual(5.0f, camera.Position.Length - camera.Target.Length);
}
[Test, CloseAfterFirstFrame]
public void RotateCamera90DegreesAroundZAxis()
{
    var camera = CreateLookAtCamera(Vector3D.UnitY, Vector3D.Zero);
    Assert.AreEqual(Vector3D.Zero, camera.YawPitchRoll);
    camera.YawPitchRoll = new Vector3D(90.0f, 0.0f, 0.0f);
    Assert.IsTrue(camera.Position.IsNearlyEqual(-Vector3D.UnitX));
    Assert.AreEqual(Vector3D.Zero, camera.Target);
}
[Test, CloseAfterFirstFrame]
public void ZoomTowardTheTarget()
{
    var camera = CreateLookAtCamera(Vector3D.UnitX * 2.0f, Vector3D.Zero);
    camera.Zoom(1.0f);
    Assert.AreEqual(Vector3D.UnitX, camera.Position);
}
See Also