Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Rendering3D.Tests.Cameras IsometricCameraTests
Namespace: DeltaEngine.Rendering3D.Tests.Cameras
Assembly: DeltaEngine.Rendering3D.Tests (in DeltaEngine.Rendering3D.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The IsometricCameraTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
IsometricCameraTests | Initializes a new instance of the IsometricCameraTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreateWithLookDirection | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
MoveDown | ||
MoveIsometricCamera | ||
MoveLeft | ||
MoveRight | ||
MoveUp | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SettingPositionMovesTarget | ||
SettingTargetMovesPosition | ||
SetUp | ||
Zoom |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void MoveIsometricCamera() { RegisterCommand(Key.J, () => camera.MoveLeft(MoveDistance)); RegisterCommand(Key.L, () => camera.MoveRight(MoveDistance)); RegisterCommand(Key.I, () => camera.MoveUp(MoveDistance)); RegisterCommand(Key.K, () => camera.MoveDown(MoveDistance)); RegisterCommand(Key.U, () => camera.Zoom(ZoomAmount)); RegisterCommand(Key.O, () => camera.Zoom(1 / ZoomAmount)); }
[Test, CloseAfterFirstFrame] public void SettingPositionMovesTarget() { camera.Position = new Vector3D(10.0f, 10.0f, 10.0f); Assert.AreEqual(new Vector3D(10.0f, 11.0f, 10.0f), camera.Target); }
[Test, CloseAfterFirstFrame] public void SettingTargetMovesPosition() { camera.Target = new Vector3D(10.0f, 10.0f, 10.0f); Assert.AreEqual(new Vector3D(10.0f, 9.0f, 10.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void MoveLeft() { camera.MoveLeft(1.0f); Assert.AreEqual(new Vector3D(-1.0f, -1.0f, 0.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void MoveRight() { camera.MoveRight(1.0f); Assert.AreEqual(new Vector3D(1.0f, -1.0f, 0.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void MoveUp() { camera.MoveUp(1.0f); Assert.AreEqual(new Vector3D(0.0f, -1.0f, 1.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void MoveDown() { camera.MoveDown(1.0f); Assert.AreEqual(new Vector3D(0.0f, -1.0f, -1.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void Zoom() { camera.Zoom(4.0f); Assert.AreEqual(0.25f, camera.ZoomScale); }
[Test, CloseAfterFirstFrame] public void CreateWithLookDirection() { var lookDirection = Vector3D.UnitY; camera = new IsometricCamera(Resolve<Device>(), Resolve<Window>(), lookDirection); Assert.AreEqual(-lookDirection, camera.Position); Assert.AreEqual(Vector3D.Zero, camera.Target); }
See Also