A camera that can be moved in any direction and rotated around any axis
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Rendering3D.Cameras Camera
DeltaEngine.Rendering3D.Cameras FreeCamera
DeltaEngine.Editor.LevelEditor LevelEditorCamera
Namespace: DeltaEngine.Rendering3D.Cameras
Assembly: DeltaEngine.Rendering3D (in DeltaEngine.Rendering3D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The FreeCamera type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FreeCamera | Initializes a new instance of the FreeCamera class |
Methods
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) | |
window | (Inherited from Camera.) |
Properties
Name | Description | |
---|---|---|
FarPlane | (Inherited from Camera.) | |
FieldOfView | (Inherited from Camera.) | |
IsActive | (Inherited from Entity.) | |
IsPauseable | (Inherited from Entity.) | |
NearPlane | (Inherited from Camera.) | |
NumberOfComponents | (Inherited from Entity.) | |
Position | (Inherited from Camera.) | |
Rotation | ||
UpdatePriority | (Inherited from Entity.) |
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 AdjustPitch() { camera.AdjustPitch(45.0f); Assert.AreEqual(new EulerAngles(45.0f, 0.0f, 0.0f), camera.Rotation.ToEuler()); }
See Also