FreeCamera ClassDelta Engine Documentation
A camera that can be moved in any direction and rotated around any axis View code on GitHub
Inheritance Hierarchy

System Object
  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

public class FreeCamera : Camera

The FreeCamera type exposes the following members.

Constructors

  NameDescription
Public methodFreeCamera
Initializes a new instance of the FreeCamera class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Public methodAdjustPitch
Public methodAdjustRoll
Public methodAdjustYaw
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Camera.)
Protected methodForceProjectionMatrixUpdate (Inherited from Camera.)
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Protected methodGetCurrentProjectionMatrix (Inherited from Camera.)
Protected methodGetCurrentViewMatrix (Overrides Camera GetCurrentViewMatrix .)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Public methodInitialize (Inherited from Camera.)
Public methodMove(Vector3D)
Public methodMove(Vector3D, Single)
Public methodMoveBackward
Public methodMoveDown
Public methodMoveForward
Public methodMoveLeft
Public methodMoveRight
Public methodMoveUp
Protected methodOnViewportSizeChanged (Inherited from Camera.)
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodResetDefaults (Overrides Camera ResetDefaults .)
Public methodRotate
Public methodScreenPointToRay (Inherited from Camera.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Public methodWorldToScreenPoint (Inherited from Camera.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldwindow (Inherited from Camera.)
Top
Properties

  NameDescription
Public propertyFarPlane (Inherited from Camera.)
Public propertyFieldOfView (Inherited from Camera.)
Public propertyIsActive (Inherited from Entity.)
Public propertyIsPauseable (Inherited from Entity.)
Public propertyNearPlane (Inherited from Camera.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyPosition (Inherited from Camera.)
Public propertyRotation
Public propertyUpdatePriority (Inherited from Entity.)
Top
Remarks

Tests: DeltaEngine.Rendering3D.Tests.Cameras.FreeCameraTests
Examples

12 unit tests call DeltaEngine.Rendering3D.Cameras.FreeCamera
[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