CameraControlFree

Description

sealed class Tinman.Engine.Components.CameraControlFree

Derived from

CameraControlBase abstract

A six-degree of freedom camera control.

The mouse X-axis is used to yaw the camera, the Y-axis is used to pitch the camera. The mouse wheel zooms the camera. Clicking MouseButton.Middle resets the zoom factor to one.

The default key binding is this:

+----+---+---+---+---+--
|    | 1 | 2 | 3 | 4 |
+-----+---+---+---+---+--
| TAB | Q*| W*| E | R |
+------+---+---+---+---+--
| CAPS | A*| S | D |~F~|
+------+---+---+---+---+--

KeyboardKey.LetterW, KeyboardKey.LetterA, KeyboardKey.LetterS, KeyboardKey.LetterD:
Move camera forwards, to the left, backwards and to the right.
KeyboardKey.LetterQ, KeyboardKey.LetterE:
Roll camera to the left and to the right.
KeyboardKey.LetterR, KeyboardKey.LetterF:
Move camera upwards and downwards.

The alternative key binding is this:

+----+---+---+---+---+--
|    | 1 | 2 | 3 | 4 |
+-----+---+---+---+---+--
| TAB | A*| Z*| E | R |
+------+---+---+---+---+--
| CAPS | Q*| S | D |~F~|
+------+---+---+---+---+--

KeyboardKey.LetterZ, KeyboardKey.LetterQ, KeyboardKey.LetterS, KeyboardKey.LetterD:
Move camera forwards, to the left, backwards and to the right.
KeyboardKey.LetterA, KeyboardKey.LetterE:
Roll camera to the left and to the right.
KeyboardKey.LetterR, KeyboardKey.LetterF:
Move camera upwards and downwards.

Public / Constructors

CameraControlFree


public constructor CameraControlFree → ()

Creates a new instance of CameraControlFree.

Public / Attributes

Azerty


public attribute Azerty → (get,set)

value : bool

true to use the alternative binding, false to use the default one.

Use the alternative key binding?

The default value is false.

Distance


public attribute Distance → (get)

value : float64

[>=0]
The distance to the terrain.

Distance to the terrain that that has been computed during the last call to IUpdateableFrameTime.UpdateFrameTime.

See also

DistanceToGround

IsRolling


public attribute IsRolling → (get)

value : bool

true if the camera has rolled, false if not.

Has the camera performed a rolling rotation in the last frame update?

RotationFactor


public attribute RotationFactor → (get,set)

value : float64

The rotation speed, in degrees per pixel. Set to 0 to disable rotation.

Controls the rotation speed (yaw, pitch, roll).

A mouse movement of X pixels on the screen corresponds to a rotation of X*abs(F)/Z degrees, where F is the rotation factor and Z is the camera zoom factor (see Camera.Zoom).

When the rotation factor is positive, the camera will pitch down when the mouse is moved towards the screen. If negative, the pitch rotation is flipped.

The default value is -0.1 (i.e. 10 pixels per degree, flipped pitch rotation).

SpeedBoost


public attribute SpeedBoost → (get,set)

value : float64

[>=1]
The boost factor.

The movement speed boost factor.

Defaults to 3.

SpeedFactor


public attribute SpeedFactor → (get,set)

value : Vec3D

The coefficient vector S (see remarks).

Controls the movement speed.

The movement speed M (world units per second) is computed from the speed factor S as follows:

M = S.X * pow(d / S.Y, S.Z)

where d is the distance of the camera position to the terrain surface (see DistanceToGround).

Set S.X to the desired movement speed, in world-units per second. To use a constant movement speed, set S.Y to 1 and S.Z to 0.

The default value is (1, 1, 0.8).

SpeedInertness


public attribute SpeedInertness → (get,set)

value : float64

[0..1]
The movement speed inertness factor. Set to 0 or 1 to disable inertness.

Controls the movement speed inertness.

Smaller values result in smoother camera movement.

The default value is 0.5.

ZoomTarget


public attribute ZoomTarget → (get,set)

value : float64

The target camera zoom factor.

The target camera zoom factor.

Defaults to 1.0.

See also

Camera.Zoom