Namespace: DeltaEngine.Rendering3D.Cameras
Assembly: DeltaEngine.Rendering3D (in DeltaEngine.Rendering3D.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Rendering3D.Tests.Cameras.FreeCameraTests
9 unit tests call DeltaEngine.Rendering3D.Cameras.FreeCamera.Move(DeltaEngine.Datatypes.Vector3D)
Assembly: DeltaEngine.Rendering3D (in DeltaEngine.Rendering3D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- localAxisDistance
- Type: DeltaEngine.Datatypes Vector3D
Remarks
Examples
[Test] public void MoveFreeCamera() { new Grid3D(new Size(100)); 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.MoveForward(MoveDistance)); RegisterCommand(Key.O, () => camera.MoveBackward(MoveDistance)); RegisterCommand(Key.A, () => camera.AdjustYaw(RotationAngle)); RegisterCommand(Key.D, () => camera.AdjustYaw(-RotationAngle)); RegisterCommand(Key.W, () => camera.AdjustPitch(RotationAngle)); RegisterCommand(Key.S, () => camera.AdjustPitch(-RotationAngle)); RegisterCommand(Key.Q, () => camera.AdjustRoll(-RotationAngle)); RegisterCommand(Key.E, () => camera.AdjustRoll(RotationAngle)); }
[Test, CloseAfterFirstFrame] public void Move() { camera.Move(Vector3D.UnitX, 1.0f); Assert.AreEqual(new Vector3D(1.0f, 5.0f, 5.0f), camera.Position); }
[Test, CloseAfterFirstFrame] public void RotateThenMove() { camera.Rotate(Vector3D.UnitZ, 90.0f); camera.Move(Vector3D.UnitX, 1.0f); Assert.IsTrue(camera.Position.IsNearlyEqual(new Vector3D(0.0f, 6.0f, 5.0f))); }
See Also